{ "version": 3, "sources": ["../../node_modules/basiclightbox/dist/basicLightbox.min.js", "../../node_modules/sweetalert2/dist/sweetalert2.all.js", "../../node_modules/photoswipe/dist/photoswipe.js", "../../node_modules/photoswipe/dist/photoswipe-ui-default.js", "../../node_modules/exif-js/exif.js", "../../node_modules/sweetalert2/dist/sweetalert2.js", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/BitMatrix.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/binarizer/index.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/decoder/decodeData/BitStream.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/decoder/decodeData/index.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/decoder/reedsolomon/GenericGFPoly.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/decoder/reedsolomon/GenericGF.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/decoder/reedsolomon/index.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/decoder/version.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/decoder/decoder.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/extractor/index.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/locator/index.ts", "../../node_modules/qr-scanner/node_modules/jsqr-es6/src/index.ts", "../../node_modules/qr-scanner/src/worker.ts", "../../node_modules/qr-scanner/src/qr-scanner.ts", "../../node_modules/local-storage/stub.js", "../../node_modules/local-storage/parse.js", "../../node_modules/local-storage/tracking.js", "../../node_modules/local-storage/local-storage.js", "../../node_modules/mobile-detect/mobile-detect.js", "../../node_modules/ts-input-mask/dist/model/caret-string.js", "../../node_modules/ts-input-mask/dist/model/next.js", "../../node_modules/ts-input-mask/dist/model/notation.js", "../../node_modules/ts-input-mask/dist/util/isNull.js", "../../node_modules/ts-input-mask/dist/model/state.js", "../../node_modules/ts-input-mask/dist/model/state/e-o-l-state.js", "../../node_modules/ts-input-mask/dist/model/state/fixed-state.js", "../../node_modules/ts-input-mask/dist/model/state/free-state.js", "../../node_modules/ts-input-mask/dist/util/string.js", "../../node_modules/ts-input-mask/dist/model/state/optional-value-state.js", "../../node_modules/ts-input-mask/dist/model/state/value-state.js", "../../node_modules/ts-input-mask/dist/model/index.js", "../../node_modules/ts-input-mask/dist/helper/affinity-calculation-strategy.js", "../../node_modules/ts-input-mask/dist/helper/format-sanitizer.js", "../../node_modules/ts-input-mask/dist/helper/compiler.js", "../../node_modules/ts-input-mask/dist/helper/caret-string-iterator.js", "../../node_modules/ts-input-mask/dist/helper/mask.js", "../../node_modules/ts-input-mask/dist/helper/mask-affinity.js", "../../node_modules/ts-input-mask/dist/masked-text-changed-listener.js", "../../node_modules/ts-input-mask/dist/index.js", "../../node_modules/tslib/tslib.es6.mjs", "../../Typescript/Lib/Types/Map.ts", "../../Typescript/Lib/AxSystem/AxInit.ts", "../../Typescript/Lib/AxSystem/AxLoad.ts", "../../Typescript/Limestone/AxAlert/AxAlert.ts", "../../Typescript/Limestone/AxButton/AxButton.ts", "../../Typescript/Limestone/AxPortlet/AxPortletExpandable.ts", "../../Typescript/Limestone/AxPortlet/AxTab.ts", "../../Typescript/Limestone/AxLimeStone.ts", "../../node_modules/ssr-window/ssr-window.esm.js", "../../node_modules/dom7/dom7.esm.js", "../../node_modules/swiper/esm/utils/dom.js", "../../node_modules/swiper/esm/utils/utils.js", "../../node_modules/swiper/esm/utils/get-support.js", "../../node_modules/swiper/esm/utils/get-device.js", "../../node_modules/swiper/esm/utils/get-browser.js", "../../node_modules/swiper/esm/modules/resize/resize.js", "../../node_modules/swiper/esm/modules/observer/observer.js", "../../node_modules/swiper/esm/components/core/modular.js", "../../node_modules/swiper/esm/components/core/events-emitter.js", "../../node_modules/swiper/esm/components/core/update/updateSize.js", "../../node_modules/swiper/esm/components/core/update/updateSlides.js", "../../node_modules/swiper/esm/components/core/update/updateAutoHeight.js", "../../node_modules/swiper/esm/components/core/update/updateSlidesOffset.js", "../../node_modules/swiper/esm/components/core/update/updateSlidesProgress.js", "../../node_modules/swiper/esm/components/core/update/updateProgress.js", "../../node_modules/swiper/esm/components/core/update/updateSlidesClasses.js", "../../node_modules/swiper/esm/components/core/update/updateActiveIndex.js", "../../node_modules/swiper/esm/components/core/update/updateClickedSlide.js", "../../node_modules/swiper/esm/components/core/update/index.js", "../../node_modules/swiper/esm/components/core/translate/getTranslate.js", "../../node_modules/swiper/esm/components/core/translate/setTranslate.js", "../../node_modules/swiper/esm/components/core/translate/minTranslate.js", "../../node_modules/swiper/esm/components/core/translate/maxTranslate.js", "../../node_modules/swiper/esm/components/core/translate/translateTo.js", "../../node_modules/swiper/esm/components/core/translate/index.js", "../../node_modules/swiper/esm/components/core/transition/setTransition.js", "../../node_modules/swiper/esm/components/core/transition/transitionStart.js", "../../node_modules/swiper/esm/components/core/transition/transitionEnd.js", "../../node_modules/swiper/esm/components/core/transition/index.js", "../../node_modules/swiper/esm/components/core/slide/slideTo.js", "../../node_modules/swiper/esm/components/core/slide/slideToLoop.js", "../../node_modules/swiper/esm/components/core/slide/slideNext.js", "../../node_modules/swiper/esm/components/core/slide/slidePrev.js", "../../node_modules/swiper/esm/components/core/slide/slideReset.js", "../../node_modules/swiper/esm/components/core/slide/slideToClosest.js", "../../node_modules/swiper/esm/components/core/slide/slideToClickedSlide.js", "../../node_modules/swiper/esm/components/core/slide/index.js", "../../node_modules/swiper/esm/components/core/loop/loopCreate.js", "../../node_modules/swiper/esm/components/core/loop/loopFix.js", "../../node_modules/swiper/esm/components/core/loop/loopDestroy.js", "../../node_modules/swiper/esm/components/core/loop/index.js", "../../node_modules/swiper/esm/components/core/grab-cursor/setGrabCursor.js", "../../node_modules/swiper/esm/components/core/grab-cursor/unsetGrabCursor.js", "../../node_modules/swiper/esm/components/core/grab-cursor/index.js", "../../node_modules/swiper/esm/components/core/manipulation/appendSlide.js", "../../node_modules/swiper/esm/components/core/manipulation/prependSlide.js", "../../node_modules/swiper/esm/components/core/manipulation/addSlide.js", "../../node_modules/swiper/esm/components/core/manipulation/removeSlide.js", "../../node_modules/swiper/esm/components/core/manipulation/removeAllSlides.js", "../../node_modules/swiper/esm/components/core/manipulation/index.js", "../../node_modules/swiper/esm/components/core/events/onTouchStart.js", "../../node_modules/swiper/esm/components/core/events/onTouchMove.js", "../../node_modules/swiper/esm/components/core/events/onTouchEnd.js", "../../node_modules/swiper/esm/components/core/events/onResize.js", "../../node_modules/swiper/esm/components/core/events/onClick.js", "../../node_modules/swiper/esm/components/core/events/onScroll.js", "../../node_modules/swiper/esm/components/core/events/index.js", "../../node_modules/swiper/esm/components/core/breakpoints/setBreakpoint.js", "../../node_modules/swiper/esm/components/core/breakpoints/getBreakpoint.js", "../../node_modules/swiper/esm/components/core/breakpoints/index.js", "../../node_modules/swiper/esm/components/core/classes/addClasses.js", "../../node_modules/swiper/esm/components/core/classes/removeClasses.js", "../../node_modules/swiper/esm/components/core/classes/index.js", "../../node_modules/swiper/esm/components/core/images/loadImage.js", "../../node_modules/swiper/esm/components/core/images/preloadImages.js", "../../node_modules/swiper/esm/components/core/images/index.js", "../../node_modules/swiper/esm/components/core/check-overflow/index.js", "../../node_modules/swiper/esm/components/core/defaults.js", "../../node_modules/swiper/esm/components/core/core-class.js", "../../node_modules/swiper/esm/components/navigation/navigation.js", "../../node_modules/swiper/esm/components/pagination/pagination.js", "../../Typescript/Modules/AxProdSelection/AxProdDetail.ts", "../../node_modules/@glidejs/glide/dist/glide.esm.js", "../../Typescript/Modules/AxProdSelection/AxProdMain.ts", "../../Typescript/Lib/Mapper/ProductMapper.ts", "../../Typescript/Lib/Helper/I18nHelper.ts", "../../Typescript/Limestone/AxProgressBar/AxProgressBar.ts", "../../Typescript/Modules/Global/Progressbar.ts", "../../node_modules/i18next/dist/esm/i18next.js", "../../node_modules/@axess/limestone/build/js/i18n/en.json", "../../node_modules/@axess/limestone/build/js/ts/i18n.js", "../../node_modules/@axess/limestone/build/js/ts/lib/JQElementHelper.js", "../../node_modules/@axess/limestone/build/js/ts/AxDropdown/lib/AxDropdownInteraction.js", "../../node_modules/rxjs/src/internal/util/isFunction.ts", "../../node_modules/rxjs/src/internal/util/createErrorClass.ts", "../../node_modules/rxjs/src/internal/util/UnsubscriptionError.ts", "../../node_modules/rxjs/src/internal/util/arrRemove.ts", "../../node_modules/rxjs/src/internal/Subscription.ts", "../../node_modules/rxjs/src/internal/config.ts", "../../node_modules/rxjs/src/internal/scheduler/timeoutProvider.ts", "../../node_modules/rxjs/src/internal/util/reportUnhandledError.ts", "../../node_modules/rxjs/src/internal/util/noop.ts", "../../node_modules/rxjs/src/internal/NotificationFactories.ts", "../../node_modules/rxjs/src/internal/util/errorContext.ts", "../../node_modules/rxjs/src/internal/Subscriber.ts", "../../node_modules/rxjs/src/internal/symbol/observable.ts", "../../node_modules/rxjs/src/internal/util/identity.ts", "../../node_modules/rxjs/src/internal/util/pipe.ts", "../../node_modules/rxjs/src/internal/Observable.ts", "../../node_modules/rxjs/src/internal/util/lift.ts", "../../node_modules/rxjs/src/internal/operators/OperatorSubscriber.ts", "../../node_modules/rxjs/src/internal/util/ObjectUnsubscribedError.ts", "../../node_modules/rxjs/src/internal/Subject.ts", "../../node_modules/rxjs/src/internal/BehaviorSubject.ts", "../../node_modules/rxjs/src/internal/scheduler/dateTimestampProvider.ts", "../../node_modules/rxjs/src/internal/scheduler/Action.ts", "../../node_modules/rxjs/src/internal/scheduler/intervalProvider.ts", "../../node_modules/rxjs/src/internal/scheduler/AsyncAction.ts", "../../node_modules/rxjs/src/internal/Scheduler.ts", "../../node_modules/rxjs/src/internal/scheduler/AsyncScheduler.ts", "../../node_modules/rxjs/src/internal/scheduler/async.ts", "../../node_modules/rxjs/src/internal/util/isArrayLike.ts", "../../node_modules/rxjs/src/internal/util/isPromise.ts", "../../node_modules/rxjs/src/internal/util/isInteropObservable.ts", "../../node_modules/rxjs/src/internal/util/isAsyncIterable.ts", "../../node_modules/rxjs/src/internal/util/throwUnobservableError.ts", "../../node_modules/rxjs/src/internal/symbol/iterator.ts", "../../node_modules/rxjs/src/internal/util/isIterable.ts", "../../node_modules/rxjs/src/internal/util/isReadableStreamLike.ts", "../../node_modules/rxjs/src/internal/observable/innerFrom.ts", "../../node_modules/rxjs/src/internal/util/executeSchedule.ts", "../../node_modules/rxjs/src/internal/operators/map.ts", "../../node_modules/rxjs/src/internal/util/mapOneOrManyArgs.ts", "../../node_modules/rxjs/src/internal/operators/mergeInternals.ts", "../../node_modules/rxjs/src/internal/operators/mergeMap.ts", "../../node_modules/rxjs/src/internal/observable/fromEvent.ts", "../../node_modules/rxjs/src/internal/operators/debounceTime.ts", "../../node_modules/@popperjs/core/lib/enums.js", "../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js", "../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js", "../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js", "../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js", "../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js", "../../node_modules/@popperjs/core/lib/utils/math.js", "../../node_modules/@popperjs/core/lib/utils/userAgent.js", "../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js", "../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js", "../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js", "../../node_modules/@popperjs/core/lib/dom-utils/contains.js", "../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js", "../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js", "../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js", "../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js", "../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js", "../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js", "../../node_modules/@popperjs/core/lib/utils/within.js", "../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js", "../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js", "../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js", "../../node_modules/@popperjs/core/lib/modifiers/arrow.js", "../../node_modules/@popperjs/core/lib/utils/getVariation.js", "../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js", "../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js", "../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js", "../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js", "../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js", "../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js", "../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js", "../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js", "../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js", "../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js", "../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js", "../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js", "../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js", "../../node_modules/@popperjs/core/lib/utils/computeOffsets.js", "../../node_modules/@popperjs/core/lib/utils/detectOverflow.js", "../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js", "../../node_modules/@popperjs/core/lib/modifiers/flip.js", "../../node_modules/@popperjs/core/lib/modifiers/hide.js", "../../node_modules/@popperjs/core/lib/modifiers/offset.js", "../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js", "../../node_modules/@popperjs/core/lib/utils/getAltAxis.js", "../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js", "../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js", "../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js", "../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js", "../../node_modules/@popperjs/core/lib/utils/orderModifiers.js", "../../node_modules/@popperjs/core/lib/utils/debounce.js", "../../node_modules/@popperjs/core/lib/utils/mergeByName.js", "../../node_modules/@popperjs/core/lib/createPopper.js", "../../node_modules/@popperjs/core/lib/popper.js", "../../node_modules/tippy.js/src/constants.ts", "../../node_modules/tippy.js/src/utils.ts", "../../node_modules/tippy.js/src/dom-utils.ts", "../../node_modules/tippy.js/src/bindGlobalEventListeners.ts", "../../node_modules/tippy.js/src/browser.ts", "../../node_modules/tippy.js/src/validation.ts", "../../node_modules/tippy.js/src/props.ts", "../../node_modules/tippy.js/src/template.ts", "../../node_modules/tippy.js/src/createTippy.ts", "../../node_modules/tippy.js/src/index.ts", "../../node_modules/tippy.js/src/addons/createSingleton.ts", "../../node_modules/tippy.js/src/addons/delegate.ts", "../../node_modules/tippy.js/src/plugins/animateFill.ts", "../../node_modules/tippy.js/src/plugins/followCursor.ts", "../../node_modules/tippy.js/src/plugins/inlinePositioning.ts", "../../node_modules/tippy.js/src/plugins/sticky.ts", "../../node_modules/tippy.js/build/base.js", "../../node_modules/@axess/limestone/build/js/ts/AxDropdown/lib/AxDropdownEvents.js", "../../node_modules/@axess/limestone/build/js/ts/AxDropdown/AxDropdown.js", "../../node_modules/@axess/limestone/build/js/ts/AxInput/Helper/InputIconHelper.js", "../../node_modules/@axess/limestone/build/js/ts/AxInput/Helper/InputEventHelper.js", "../../node_modules/@axess/limestone/build/js/ts/AxInput/AxInput.js", "../../node_modules/@axess/limestone/build/js/ts/AxFormValidation/AxFormValidation.js", "../../node_modules/@axess/limestone/build/js/ts/AxModal/AxModal.js", "../../Typescript/Limestone/AxCounter/AxCounter.ts", "../../Typescript/Components/AxUtility/BodyUtility.ts", "../../Typescript/Modules/Packages/PackageMinMaxConstraint.ts", "../../Typescript/Lib/Enums/LoadingSpinnerPositionEnum.ts", "../../Typescript/Lib/Helper/RandomHelper.ts", "../../Typescript/Limestone/AxLoading/AxLoading.ts", "../../Typescript/Models/BestMatch/ProductCalcModel.ts", "../../Typescript/Components/BestMatch/BestMatchHandler.ts", "../../Typescript/Components/ProductList/TicketList.ts", "../../Typescript/Lib/Helper/RequestHelper.ts", "../../Typescript/Lib/Helper/AxProdSelection/SummaryRedirect.ts", "../../Typescript/Modules/AxProdSelection/Abstraction/NonPreDateable.ts", "../../Typescript/Modules/AxProdSelection/Packages/AxPackNonPredateable.ts", "../../Typescript/Components/AxDatepicker/InteractionHelper.ts", "../../Typescript/Components/AxDatepicker/EventHelper.ts", "../../Typescript/Components/AxDatepicker/RenderHelper.ts", "../../Typescript/Components/AxDatepicker/AxDatepicker.ts", "../../Typescript/Modules/AxProdSelection/Abstraction/PreDateable.ts", "../../Typescript/Modules/AxProdSelection/Packages/AxPackPredateable.ts", "../../Typescript/Modules/AxProdSelection/Tickets/AxProdNonPredateable.ts", "../../Typescript/Modules/AxProdSelection/Tickets/AxProdPredateable.ts", "../../Typescript/Models/Tickets/Product.ts", "../../Typescript/Modules/AxProdSelection/AxProdSelection.ts", "../../Typescript/Components/AxCalendar/AxCalendar.ts", "../../Typescript/Components/AxScrollspy/AxScrollspy.ts", "../../Typescript/Modules/AxProdSelection/Abstraction/SubCCalendar.ts", "../../Typescript/Modules/AxProdSelection/Tickets/AxProdSelectionCalendar.ts", "../../Typescript/Components/AxSlide/AxSlide.ts", "../../Typescript/Models/Reservation/TimeSlotKey.ts", "../../Typescript/Lib/Helper/Config/ConfigHelper.ts", "../../Typescript/Lib/Helper/DateHelper.ts", "../../Typescript/Modules/AxProdSelection/Abstraction/AxBooking.ts", "../../Typescript/Models/Reservation/TimeSlotKeyDto.ts", "../../Typescript/Modules/AxProdSelection/Tickets/AxProdBooking.ts", "../../Typescript/Modules/AxProdSelection/AxProdSummary.ts", "../../Typescript/Modules/Global/AxTopBar.ts", "../../Typescript/Utility/AxMain.ts", "../../Typescript/Modules/AxProdSelection/Packages/AxPackSelectionCalendar.ts", "../../Typescript/Modules/B2B/B2bMode.ts", "../../Typescript/Modules/ShoppingCart/ShoppingCart.ts", "../../Typescript/Lib/Constants/ProductTypeConstant.ts", "../../Typescript/Lib/Helper/ArrayHelper.ts", "../../Typescript/Lib/Helper/CookieHelper.ts", "../../Typescript/Modules/AxProdSelection/Packages/AxPackBooking.ts", "../../Typescript/Modules/Reservations/TimeSlots.ts", "../../Typescript/Limestone/AxMessage/AxAlertBanner.ts", "../../Typescript/Modules/Reservations/Reserved.ts", "../../Typescript/Modules/Categories/CategoryFilter.ts", "../../Typescript/Modules/Global/SubmenuAim.ts", "../../Typescript/Modules/Retail/RetailDetail.ts", "../../Typescript/Lib/Helper/AssetHelper.ts", "../../Typescript/Lib/Helper/ColorHelper.ts", "../../Typescript/Lib/Constants/KeyCollection/LocalStorageKeyCollection.ts", "../../Typescript/Lib/Helper/Retail/RetailHelper.ts", "../../Typescript/Modules/Retail/RetailMain.ts", "../../Typescript/Modules/Shipping/Shipping.ts", "../../Typescript/Models/Shipping/CustomerShippingInfo.ts", "../../Typescript/Modules/Retail/RetailFilter.ts", "../../Typescript/Modules/Profile/OrderHistory.ts", "../../Typescript/Modules/Global/AxBirthDateInputTriple.ts", "../../Typescript/Components/AxInput/AxCounterWithInput.ts", "../../Typescript/Modules/GiftCard/ProgressbarGiftCards.ts", "../../Typescript/Modules/GiftCard/MainGiftCards.ts", "../../Typescript/Modules/GiftCard/PersonalizeGiftCard.ts", "../../Typescript/Lib/Helper/PriceHelper.ts", "../../Typescript/Modules/Profile/PasswordValidation.ts", "../../Typescript/Modules/Profile/MyFamily.ts", "../../Typescript/Modules/Account/AccountRentalData.ts", "../../Typescript/Modules/Account/CustomerLessonProperties.ts", "../../Typescript/Lib/Helper/InputMaskHelper.ts", "../../Typescript/Modules/Reservations/SeasonCardBooking.ts", "../../Typescript/Components/AxForm/AxCheck.ts", "../../Typescript/Modules/ComplexPackages/ComplexPackageFilter.ts", "../../Typescript/Modules/ComplexPackages/ComplexPackageSelection.ts", "../../Typescript/Modules/ComplexPackages/ComplexPackageDetails.ts", "../../Typescript/Modules/ComplexPackages/ComplexPackageBookingOptions.ts", "../../Typescript/Models/ComplexPackages/BookingOptions/CompPackBookingValues.ts", "../../Typescript/Models/ComplexPackages/BookingOptions/CompPackOrderTicketValues.ts", "../../Typescript/Modules/ComplexPackages/BookingOptions/ComplexPackageBookingTicketsOptions.ts", "../../Typescript/Models/ComplexPackages/BookingOptions/CompPackOrderLessonProgramValues.ts", "../../Typescript/Modules/ComplexPackages/BookingOptions/CompPackBookingLessonProgramOptions.ts", "../../Typescript/Modules/ComplexPackages/BookingOptions/CompPackBookingPersonOptions.ts", "../../Typescript/Models/ComplexPackages/BookingOptions/CompPackOrderRentalValues.ts", "../../Typescript/Modules/ComplexPackages/BookingOptions/CompPackBookingRentalOptions.ts", "../../Typescript/Models/ComplexPackages/BookingOptions/CompPackOrderLessonValues.ts", "../../Typescript/Modules/ComplexPackages/BookingOptions/CompPackBookingLessonOptions.ts", "../../Typescript/Modules/Redirect/Redirect.ts", "../../Typescript/Modules/ComplexPackages/ComplexPackageSearchBar.ts", "../../Typescript/Modules/Lessons/LessonsLoadingSpinner.ts", "../../Typescript/Modules/Payment/Eguma.ts", "../../Typescript/Modules/ShoppingCart/ShoppingCartPersonalisation.ts", "../../Typescript/Modules/ShoppingCart/ShoppingCartReservationTimer.ts", "../../Typescript/Modules/B2B/B2BHistory.ts", "../../Typescript/Modules/ShoppingCart/ShoppingCartEntryRetail.ts", "../../Typescript/Modules/FindMyTicket/FindMyTicket.ts", "../../Typescript/Lib/Helper/wtpScanner.ts", "../../Typescript/Modules/Profile/MyChipCards.ts", "../../Typescript/Modules/Global/UtilityInit.ts", "../../Typescript/Components/AxFireShoppingCartModal/AxFireShoppingCartModal.ts", "../../Typescript/Modules/AxConfig/AxStaticConfigModule.ts", "../../Typescript/Modules/AxGA4/AxGA4Module.ts", "../../Typescript/Modules/ErrorHandling/ServerErrorPopUp.ts", "../../Typescript/Modules/Payment/VoucherPayment.ts", "../../Typescript/Modules/NewsLetterSubscription/Unsubscribe.ts", "../../Typescript/Modules/Global/Banner.ts", "../../Typescript/Modules/Hero/HeroModule.ts", "../../Typescript/Modules/Payment/Payment.ts", "../../Typescript/Service/Account/AccountStorageService.ts", "../../Typescript/Modules/Account/Registration.ts", "../../Typescript/Modules/Account/RegisterForm.ts", "../../Typescript/Modules/ProfileSettings/PersonalData.ts", "../../Typescript/Modules/NewsLetterSubscription/Resubscribe.ts", "../../Typescript/Modules/Account/MissingMandatoryData.ts", "../../Typescript/Modules/MaintenanceMode/MaintenanceScriptInfo.ts", "../../Typescript/Modules/Rental/RentalMain.ts", "../../Typescript/Modules/Rental/Helper/RentalFilterResetHelper.ts", "../../Typescript/Modules/Rental/Components/RentalFilterPriceSlider.ts", "../../Typescript/Modules/Rental/RentalFilter.ts", "../../Typescript/Modules/Global/LocalizationModule.ts", "../../Typescript/Modules/Ble/BleQrCodes.ts", "../../Typescript/Modules/ShoppingCart/ShoppingCartDateInputTriple.ts", "../../Typescript/Models/Rental/Details/RentalProdSelectionTimings.ts", "../../Typescript/Modules/Rental/ProductDetails/Components/RentDetailsProdSelectTimings.ts", "../../Typescript/Modules/Rental/Components/RentalDetailLightbox.ts", "../../Typescript/Modules/Rental/ProductDetails/Services/RentDetailsProdSelectionAbstract.ts", "../../Typescript/Models/Rental/Details/RentDetailsSingleItemSelectionSection.ts", "../../Typescript/Modules/Rental/ProductDetails/Services/RentDetailsProdSelectSingleItemHandler.ts", "../../Typescript/Models/Rental/Details/RentalDetailsPackOptionSelectionItem.ts", "../../Typescript/Modules/Rental/ProductDetails/Components/RentDetailsProdOptItemSelectSection.ts", "../../Typescript/Modules/Rental/ProductDetails/Components/RentDetailsPackItemSelectionSection.ts", "../../Typescript/Modules/Rental/ProductDetails/Services/RentDetailsProdSelectPackHandler.ts", "../../Typescript/Modules/Rental/ProductDetails/Services/RentDetailsProdSelectCompManager.ts", "../../Typescript/Modules/Rental/ProductDetails/RentalProductDetails.ts", "../../Typescript/Modules/Global/DateModule.ts", "../../Typescript/Modules/Rental/RentalShopDetails.ts", "../../Typescript/Modules/Rental/RiderDetails/RiderDetailsModule.ts", "../../node_modules/alpinejs/dist/module.esm.js", "../../Typescript/Modules/Rental/Services/ProductAndRiderDetailsService.ts", "../../Typescript/Models/Rental/RentalAllowedStatus.ts", "../../Typescript/Modules/Rental/Services/CheckAllowedRentalIItemsService.ts", "../../Typescript/Modules/Rental/RiderDetails/Components/RiderSelection.ts", "../../Typescript/Modules/Rental/RiderDetails/Components/ProductInfoPortlet.ts", "../../Typescript/Modules/Rental/RiderDetails/Components/LockerData.ts", "../../Typescript/Models/Rental/RiderDetails/RiderData.ts", "../../Typescript/Modules/Rental/RiderDetails/RiderDetailsModelBundle.ts", "../../Typescript/Modules/Rental/RiderDetails/Components/PersonDataForm.ts", "../../Typescript/Components/AxForm/DropDownComponent.ts", "../../Typescript/Dto/Rental/Properties/Request/WtpRentalPropertyRequestData.ts", "../../Typescript/Dto/Rental/Properties/Result/GetRentalPropertiesResultDto.ts", "../../Typescript/Modules/Rental/RiderDetails/Components/RentalPropertiesSelection.ts", "../../Typescript/Modules/Rental/RiderDetails/RiderDetailsCompBundle.ts", "../../Typescript/Modules/LessonPackages/LessonFilter.ts", "../../Typescript/Modules/LessonPackages/LandingPage.ts", "../../Typescript/Utility/AxFilterOverlay.ts", "../../Typescript/Modules/LessonPackages/SelectionAddSlot.ts", "../../Typescript/Modules/LessonPackages/Selection.ts", "../../Typescript/Modules/LessonPackages/Personalization.ts", "../../Typescript/Modules/LessonPackages/Components/PersonDataForm.ts", "../../Typescript/Modules/LessonPackages/LessonPackageStorage.ts", "../../Typescript/Modules/ShoppingCart/ToCheckout.ts", "../../Typescript/Modules/ShoppingCart/PopUpShoppingCart.ts", "../../node_modules/@microsoft/signalr/src/Errors.ts", "../../node_modules/@microsoft/signalr/src/HttpClient.ts", "../../node_modules/@microsoft/signalr/src/ILogger.ts", "../../node_modules/@microsoft/signalr/src/Loggers.ts", "../../node_modules/@microsoft/signalr/src/Utils.ts", "../../node_modules/@microsoft/signalr/src/FetchHttpClient.ts", "../../node_modules/@microsoft/signalr/src/XhrHttpClient.ts", "../../node_modules/@microsoft/signalr/src/DefaultHttpClient.ts", "../../node_modules/@microsoft/signalr/src/TextMessageFormat.ts", "../../node_modules/@microsoft/signalr/src/HandshakeProtocol.ts", "../../node_modules/@microsoft/signalr/src/IHubProtocol.ts", "../../node_modules/@microsoft/signalr/src/Subject.ts", "../../node_modules/@microsoft/signalr/src/MessageBuffer.ts", "../../node_modules/@microsoft/signalr/src/HubConnection.ts", "../../node_modules/@microsoft/signalr/src/DefaultReconnectPolicy.ts", "../../node_modules/@microsoft/signalr/src/HeaderNames.ts", "../../node_modules/@microsoft/signalr/src/AccessTokenHttpClient.ts", "../../node_modules/@microsoft/signalr/src/ITransport.ts", "../../node_modules/@microsoft/signalr/src/AbortController.ts", "../../node_modules/@microsoft/signalr/src/LongPollingTransport.ts", "../../node_modules/@microsoft/signalr/src/ServerSentEventsTransport.ts", "../../node_modules/@microsoft/signalr/src/WebSocketTransport.ts", "../../node_modules/@microsoft/signalr/src/HttpConnection.ts", "../../node_modules/@microsoft/signalr/src/JsonHubProtocol.ts", "../../node_modules/@microsoft/signalr/src/HubConnectionBuilder.ts", "../../Typescript/Modules/ShoppingCart/OneRiskNotification.ts", "../../Typescript/Modules/OneRisk/OneRisk.ts", "../../Typescript/Modules/Lessons/LessonBuyerInfoModule.ts", "../../Typescript/Modules/ConsentDocuments/ConsentDocuments.ts", "../../Typescript/Modules/AxProdSelection/QuickSelection/QuantitySelection.ts", "../../Typescript/Modules/AxProdSelection/LandingQuickSelection.ts", "../../Typescript/App.ts"], "sourcesContent": ["!function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{(\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:this).basicLightbox=e()}}((function(){return function e(n,t,o){function r(c,u){if(!t[c]){if(!n[c]){var s=\"function\"==typeof require&&require;if(!u&&s)return s(c,!0);if(i)return i(c,!0);var a=new Error(\"Cannot find module '\"+c+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var l=t[c]={exports:{}};n[c][0].call(l.exports,(function(e){return r(n[c][1][e]||e)}),l,l.exports,e,n,t,o)}return t[c].exports}for(var i=\"function\"==typeof require&&require,c=0;c<o.length;c++)r(o[c]);return r}({1:[function(e,n,t){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0}),t.create=t.visible=void 0;var o=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=document.createElement(\"div\");return t.innerHTML=e.trim(),!0===n?t.children:t.firstChild},r=function(e,n){var t=e.children;return 1===t.length&&t[0].tagName===n},i=function(e){return null!=(e=e||document.querySelector(\".basicLightbox\"))&&!0===e.ownerDocument.body.contains(e)};t.visible=i;t.create=function(e,n){var t=function(e,n){var t=o('\\n\\t\\t<div class=\"basicLightbox '.concat(n.className,'\">\\n\\t\\t\\t<div class=\"basicLightbox__placeholder\" role=\"dialog\"></div>\\n\\t\\t</div>\\n\\t')),i=t.querySelector(\".basicLightbox__placeholder\");e.forEach((function(e){return i.appendChild(e)}));var c=r(i,\"IMG\"),u=r(i,\"VIDEO\"),s=r(i,\"IFRAME\");return!0===c&&t.classList.add(\"basicLightbox--img\"),!0===u&&t.classList.add(\"basicLightbox--video\"),!0===s&&t.classList.add(\"basicLightbox--iframe\"),t}(e=function(e){var n=\"string\"==typeof e,t=e instanceof HTMLElement==1;if(!1===n&&!1===t)throw new Error(\"Content must be a DOM element/node or string\");return!0===n?Array.from(o(e,!0)):\"TEMPLATE\"===e.tagName?[e.content.cloneNode(!0)]:Array.from(e.children)}(e),n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null==(e=Object.assign({},e)).closable&&(e.closable=!0),null==e.className&&(e.className=\"\"),null==e.onShow&&(e.onShow=function(){}),null==e.onClose&&(e.onClose=function(){}),\"boolean\"!=typeof e.closable)throw new Error(\"Property `closable` must be a boolean\");if(\"string\"!=typeof e.className)throw new Error(\"Property `className` must be a string\");if(\"function\"!=typeof e.onShow)throw new Error(\"Property `onShow` must be a function\");if(\"function\"!=typeof e.onClose)throw new Error(\"Property `onClose` must be a function\");return e}(n)),c=function(e){return!1!==n.onClose(u)&&function(e,n){return e.classList.remove(\"basicLightbox--visible\"),setTimeout((function(){return!1===i(e)||e.parentElement.removeChild(e),n()}),410),!0}(t,(function(){if(\"function\"==typeof e)return e(u)}))};!0===n.closable&&t.addEventListener(\"click\",(function(e){e.target===t&&c()}));var u={element:function(){return t},visible:function(){return i(t)},show:function(e){return!1!==n.onShow(u)&&function(e,n){return document.body.appendChild(e),setTimeout((function(){requestAnimationFrame((function(){return e.classList.add(\"basicLightbox--visible\"),n()}))}),10),!0}(t,(function(){if(\"function\"==typeof e)return e(u)}))},close:c};return u}},{}]},{},[1])(1)}));", "/*!\n* sweetalert2 v11.4.8\n* Released under the MIT License.\n*/\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Sweetalert2 = factory());\n}(this, function () { 'use strict';\n\n const consolePrefix = 'SweetAlert2:';\n /**\n * Filter the unique values into a new array\n * @param arr\n */\n\n const uniqueArray = arr => {\n const result = [];\n\n for (let i = 0; i < arr.length; i++) {\n if (result.indexOf(arr[i]) === -1) {\n result.push(arr[i]);\n }\n }\n\n return result;\n };\n /**\n * Capitalize the first letter of a string\n * @param {string} str\n * @returns {string}\n */\n\n const capitalizeFirstLetter = str => str.charAt(0).toUpperCase() + str.slice(1);\n /**\n * @param {NodeList | HTMLCollection | NamedNodeMap} nodeList\n * @returns {array}\n */\n\n const toArray = nodeList => Array.prototype.slice.call(nodeList);\n /**\n * Standardize console warnings\n * @param {string | array} message\n */\n\n const warn = message => {\n console.warn(\"\".concat(consolePrefix, \" \").concat(typeof message === 'object' ? message.join(' ') : message));\n };\n /**\n * Standardize console errors\n * @param {string} message\n */\n\n const error = message => {\n console.error(\"\".concat(consolePrefix, \" \").concat(message));\n };\n /**\n * Private global state for `warnOnce`\n * @type {Array}\n * @private\n */\n\n const previousWarnOnceMessages = [];\n /**\n * Show a console warning, but only if it hasn't already been shown\n * @param {string} message\n */\n\n const warnOnce = message => {\n if (!previousWarnOnceMessages.includes(message)) {\n previousWarnOnceMessages.push(message);\n warn(message);\n }\n };\n /**\n * Show a one-time console warning about deprecated params/methods\n */\n\n const warnAboutDeprecation = (deprecatedParam, useInstead) => {\n warnOnce(\"\\\"\".concat(deprecatedParam, \"\\\" is deprecated and will be removed in the next major release. Please use \\\"\").concat(useInstead, \"\\\" instead.\"));\n };\n /**\n * If `arg` is a function, call it (with no arguments or context) and return the result.\n * Otherwise, just pass the value through\n * @param arg\n */\n\n const callIfFunction = arg => typeof arg === 'function' ? arg() : arg;\n const hasToPromiseFn = arg => arg && typeof arg.toPromise === 'function';\n const asPromise = arg => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg);\n const isPromise = arg => arg && Promise.resolve(arg) === arg;\n\n const defaultParams = {\n title: '',\n titleText: '',\n text: '',\n html: '',\n footer: '',\n icon: undefined,\n iconColor: undefined,\n iconHtml: undefined,\n template: undefined,\n toast: false,\n showClass: {\n popup: 'swal2-show',\n backdrop: 'swal2-backdrop-show',\n icon: 'swal2-icon-show'\n },\n hideClass: {\n popup: 'swal2-hide',\n backdrop: 'swal2-backdrop-hide',\n icon: 'swal2-icon-hide'\n },\n customClass: {},\n target: 'body',\n color: undefined,\n backdrop: true,\n heightAuto: true,\n allowOutsideClick: true,\n allowEscapeKey: true,\n allowEnterKey: true,\n stopKeydownPropagation: true,\n keydownListenerCapture: false,\n showConfirmButton: true,\n showDenyButton: false,\n showCancelButton: false,\n preConfirm: undefined,\n preDeny: undefined,\n confirmButtonText: 'OK',\n confirmButtonAriaLabel: '',\n confirmButtonColor: undefined,\n denyButtonText: 'No',\n denyButtonAriaLabel: '',\n denyButtonColor: undefined,\n cancelButtonText: 'Cancel',\n cancelButtonAriaLabel: '',\n cancelButtonColor: undefined,\n buttonsStyling: true,\n reverseButtons: false,\n focusConfirm: true,\n focusDeny: false,\n focusCancel: false,\n returnFocus: true,\n showCloseButton: false,\n closeButtonHtml: '×',\n closeButtonAriaLabel: 'Close this dialog',\n loaderHtml: '',\n showLoaderOnConfirm: false,\n showLoaderOnDeny: false,\n imageUrl: undefined,\n imageWidth: undefined,\n imageHeight: undefined,\n imageAlt: '',\n timer: undefined,\n timerProgressBar: false,\n width: undefined,\n padding: undefined,\n background: undefined,\n input: undefined,\n inputPlaceholder: '',\n inputLabel: '',\n inputValue: '',\n inputOptions: {},\n inputAutoTrim: true,\n inputAttributes: {},\n inputValidator: undefined,\n returnInputValueOnDeny: false,\n validationMessage: undefined,\n grow: false,\n position: 'center',\n progressSteps: [],\n currentProgressStep: undefined,\n progressStepsDistance: undefined,\n willOpen: undefined,\n didOpen: undefined,\n didRender: undefined,\n willClose: undefined,\n didClose: undefined,\n didDestroy: undefined,\n scrollbarPadding: true\n };\n const updatableParams = ['allowEscapeKey', 'allowOutsideClick', 'background', 'buttonsStyling', 'cancelButtonAriaLabel', 'cancelButtonColor', 'cancelButtonText', 'closeButtonAriaLabel', 'closeButtonHtml', 'color', 'confirmButtonAriaLabel', 'confirmButtonColor', 'confirmButtonText', 'currentProgressStep', 'customClass', 'denyButtonAriaLabel', 'denyButtonColor', 'denyButtonText', 'didClose', 'didDestroy', 'footer', 'hideClass', 'html', 'icon', 'iconColor', 'iconHtml', 'imageAlt', 'imageHeight', 'imageUrl', 'imageWidth', 'preConfirm', 'preDeny', 'progressSteps', 'returnFocus', 'reverseButtons', 'showCancelButton', 'showCloseButton', 'showConfirmButton', 'showDenyButton', 'text', 'title', 'titleText', 'willClose'];\n const deprecatedParams = {};\n const toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusDeny', 'focusCancel', 'returnFocus', 'heightAuto', 'keydownListenerCapture'];\n /**\n * Is valid parameter\n * @param {string} paramName\n */\n\n const isValidParameter = paramName => {\n return Object.prototype.hasOwnProperty.call(defaultParams, paramName);\n };\n /**\n * Is valid parameter for Swal.update() method\n * @param {string} paramName\n */\n\n const isUpdatableParameter = paramName => {\n return updatableParams.indexOf(paramName) !== -1;\n };\n /**\n * Is deprecated parameter\n * @param {string} paramName\n */\n\n const isDeprecatedParameter = paramName => {\n return deprecatedParams[paramName];\n };\n\n const checkIfParamIsValid = param => {\n if (!isValidParameter(param)) {\n warn(\"Unknown parameter \\\"\".concat(param, \"\\\"\"));\n }\n };\n\n const checkIfToastParamIsValid = param => {\n if (toastIncompatibleParams.includes(param)) {\n warn(\"The parameter \\\"\".concat(param, \"\\\" is incompatible with toasts\"));\n }\n };\n\n const checkIfParamIsDeprecated = param => {\n if (isDeprecatedParameter(param)) {\n warnAboutDeprecation(param, isDeprecatedParameter(param));\n }\n };\n /**\n * Show relevant warnings for given params\n *\n * @param params\n */\n\n\n const showWarningsForParams = params => {\n if (!params.backdrop && params.allowOutsideClick) {\n warn('\"allowOutsideClick\" parameter requires `backdrop` parameter to be set to `true`');\n }\n\n for (const param in params) {\n checkIfParamIsValid(param);\n\n if (params.toast) {\n checkIfToastParamIsValid(param);\n }\n\n checkIfParamIsDeprecated(param);\n }\n };\n\n const swalPrefix = 'swal2-';\n const prefix = items => {\n const result = {};\n\n for (const i in items) {\n result[items[i]] = swalPrefix + items[i];\n }\n\n return result;\n };\n const swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'show', 'hide', 'close', 'title', 'html-container', 'actions', 'confirm', 'deny', 'cancel', 'default-outline', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'input-label', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loader', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'timer-progress-bar-container', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error']);\n const iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);\n\n /**\n * Gets the popup container which contains the backdrop and the popup itself.\n *\n * @returns {HTMLElement | null}\n */\n\n const getContainer = () => document.body.querySelector(\".\".concat(swalClasses.container));\n const elementBySelector = selectorString => {\n const container = getContainer();\n return container ? container.querySelector(selectorString) : null;\n };\n\n const elementByClass = className => {\n return elementBySelector(\".\".concat(className));\n };\n\n const getPopup = () => elementByClass(swalClasses.popup);\n const getIcon = () => elementByClass(swalClasses.icon);\n const getTitle = () => elementByClass(swalClasses.title);\n const getHtmlContainer = () => elementByClass(swalClasses['html-container']);\n const getImage = () => elementByClass(swalClasses.image);\n const getProgressSteps = () => elementByClass(swalClasses['progress-steps']);\n const getValidationMessage = () => elementByClass(swalClasses['validation-message']);\n const getConfirmButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.confirm));\n const getDenyButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.deny));\n const getInputLabel = () => elementByClass(swalClasses['input-label']);\n const getLoader = () => elementBySelector(\".\".concat(swalClasses.loader));\n const getCancelButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.cancel));\n const getActions = () => elementByClass(swalClasses.actions);\n const getFooter = () => elementByClass(swalClasses.footer);\n const getTimerProgressBar = () => elementByClass(swalClasses['timer-progress-bar']);\n const getCloseButton = () => elementByClass(swalClasses.close); // https://github.com/jkup/focusable/blob/master/index.js\n\n const focusable = \"\\n a[href],\\n area[href],\\n input:not([disabled]),\\n select:not([disabled]),\\n textarea:not([disabled]),\\n button:not([disabled]),\\n iframe,\\n object,\\n embed,\\n [tabindex=\\\"0\\\"],\\n [contenteditable],\\n audio[controls],\\n video[controls],\\n summary\\n\";\n const getFocusableElements = () => {\n const focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex=\"-1\"]):not([tabindex=\"0\"])')) // sort according to tabindex\n .sort((a, b) => {\n const tabindexA = parseInt(a.getAttribute('tabindex'));\n const tabindexB = parseInt(b.getAttribute('tabindex'));\n\n if (tabindexA > tabindexB) {\n return 1;\n } else if (tabindexA < tabindexB) {\n return -1;\n }\n\n return 0;\n });\n const otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter(el => el.getAttribute('tabindex') !== '-1');\n return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(el => isVisible(el));\n };\n const isModal = () => {\n return hasClass(document.body, swalClasses.shown) && !hasClass(document.body, swalClasses['toast-shown']) && !hasClass(document.body, swalClasses['no-backdrop']);\n };\n const isToast = () => {\n return getPopup() && hasClass(getPopup(), swalClasses.toast);\n };\n const isLoading = () => {\n return getPopup().hasAttribute('data-loading');\n };\n\n const states = {\n previousBodyPadding: null\n };\n /**\n * Securely set innerHTML of an element\n * https://github.com/sweetalert2/sweetalert2/issues/1926\n *\n * @param {HTMLElement} elem\n * @param {string} html\n */\n\n const setInnerHtml = (elem, html) => {\n elem.textContent = '';\n\n if (html) {\n const parser = new DOMParser();\n const parsed = parser.parseFromString(html, \"text/html\");\n toArray(parsed.querySelector('head').childNodes).forEach(child => {\n elem.appendChild(child);\n });\n toArray(parsed.querySelector('body').childNodes).forEach(child => {\n elem.appendChild(child);\n });\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} className\n * @returns {boolean}\n */\n\n const hasClass = (elem, className) => {\n if (!className) {\n return false;\n }\n\n const classList = className.split(/\\s+/);\n\n for (let i = 0; i < classList.length; i++) {\n if (!elem.classList.contains(classList[i])) {\n return false;\n }\n }\n\n return true;\n };\n\n const removeCustomClasses = (elem, params) => {\n toArray(elem.classList).forEach(className => {\n if (!Object.values(swalClasses).includes(className) && !Object.values(iconTypes).includes(className) && !Object.values(params.showClass).includes(className)) {\n elem.classList.remove(className);\n }\n });\n };\n\n const applyCustomClass = (elem, params, className) => {\n removeCustomClasses(elem, params);\n\n if (params.customClass && params.customClass[className]) {\n if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) {\n return warn(\"Invalid type of customClass.\".concat(className, \"! Expected string or iterable object, got \\\"\").concat(typeof params.customClass[className], \"\\\"\"));\n }\n\n addClass(elem, params.customClass[className]);\n }\n };\n /**\n * @param {HTMLElement} popup\n * @param {string} inputType\n * @returns {HTMLInputElement | null}\n */\n\n const getInput = (popup, inputType) => {\n if (!inputType) {\n return null;\n }\n\n switch (inputType) {\n case 'select':\n case 'textarea':\n case 'file':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses[inputType]));\n\n case 'checkbox':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.checkbox, \" input\"));\n\n case 'radio':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.radio, \" input:checked\")) || popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.radio, \" input:first-child\"));\n\n case 'range':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.range, \" input\"));\n\n default:\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.input));\n }\n };\n /**\n * @param {HTMLInputElement} input\n */\n\n const focusInput = input => {\n input.focus(); // place cursor at end of text in text input\n\n if (input.type !== 'file') {\n // http://stackoverflow.com/a/2345915\n const val = input.value;\n input.value = '';\n input.value = val;\n }\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[]} classList\n * @param {boolean} condition\n */\n\n const toggleClass = (target, classList, condition) => {\n if (!target || !classList) {\n return;\n }\n\n if (typeof classList === 'string') {\n classList = classList.split(/\\s+/).filter(Boolean);\n }\n\n classList.forEach(className => {\n if (Array.isArray(target)) {\n target.forEach(elem => {\n condition ? elem.classList.add(className) : elem.classList.remove(className);\n });\n } else {\n condition ? target.classList.add(className) : target.classList.remove(className);\n }\n });\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[]} classList\n */\n\n const addClass = (target, classList) => {\n toggleClass(target, classList, true);\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[]} classList\n */\n\n const removeClass = (target, classList) => {\n toggleClass(target, classList, false);\n };\n /**\n * Get direct child of an element by class name\n *\n * @param {HTMLElement} elem\n * @param {string} className\n * @returns {HTMLElement | null}\n */\n\n const getDirectChildByClass = (elem, className) => {\n const childNodes = toArray(elem.childNodes);\n\n for (let i = 0; i < childNodes.length; i++) {\n if (hasClass(childNodes[i], className)) {\n return childNodes[i];\n }\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} property\n * @param {*} value\n */\n\n const applyNumericalStyle = (elem, property, value) => {\n if (value === \"\".concat(parseInt(value))) {\n value = parseInt(value);\n }\n\n if (value || parseInt(value) === 0) {\n elem.style[property] = typeof value === 'number' ? \"\".concat(value, \"px\") : value;\n } else {\n elem.style.removeProperty(property);\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} display\n */\n\n const show = function (elem) {\n let display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex';\n elem.style.display = display;\n };\n /**\n * @param {HTMLElement} elem\n */\n\n const hide = elem => {\n elem.style.display = 'none';\n };\n const setStyle = (parent, selector, property, value) => {\n const el = parent.querySelector(selector);\n\n if (el) {\n el.style[property] = value;\n }\n };\n const toggle = (elem, condition, display) => {\n condition ? show(elem, display) : hide(elem);\n }; // borrowed from jquery $(elem).is(':visible') implementation\n\n const isVisible = elem => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length));\n const allButtonsAreHidden = () => !isVisible(getConfirmButton()) && !isVisible(getDenyButton()) && !isVisible(getCancelButton());\n const isScrollable = elem => !!(elem.scrollHeight > elem.clientHeight); // borrowed from https://stackoverflow.com/a/46352119\n\n const hasCssAnimation = elem => {\n const style = window.getComputedStyle(elem);\n const animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0');\n const transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0');\n return animDuration > 0 || transDuration > 0;\n };\n const animateTimerProgressBar = function (timer) {\n let reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n const timerProgressBar = getTimerProgressBar();\n\n if (isVisible(timerProgressBar)) {\n if (reset) {\n timerProgressBar.style.transition = 'none';\n timerProgressBar.style.width = '100%';\n }\n\n setTimeout(() => {\n timerProgressBar.style.transition = \"width \".concat(timer / 1000, \"s linear\");\n timerProgressBar.style.width = '0%';\n }, 10);\n }\n };\n const stopTimerProgressBar = () => {\n const timerProgressBar = getTimerProgressBar();\n const timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width);\n timerProgressBar.style.removeProperty('transition');\n timerProgressBar.style.width = '100%';\n const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width);\n const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100;\n timerProgressBar.style.removeProperty('transition');\n timerProgressBar.style.width = \"\".concat(timerProgressBarPercent, \"%\");\n };\n\n /**\n * Detect Node env\n *\n * @returns {boolean}\n */\n const isNodeEnv = () => typeof window === 'undefined' || typeof document === 'undefined';\n\n const RESTORE_FOCUS_TIMEOUT = 100;\n\n const globalState = {};\n\n const focusPreviousActiveElement = () => {\n if (globalState.previousActiveElement && globalState.previousActiveElement.focus) {\n globalState.previousActiveElement.focus();\n globalState.previousActiveElement = null;\n } else if (document.body) {\n document.body.focus();\n }\n }; // Restore previous active (focused) element\n\n\n const restoreActiveElement = returnFocus => {\n return new Promise(resolve => {\n if (!returnFocus) {\n return resolve();\n }\n\n const x = window.scrollX;\n const y = window.scrollY;\n globalState.restoreFocusTimeout = setTimeout(() => {\n focusPreviousActiveElement();\n resolve();\n }, RESTORE_FOCUS_TIMEOUT); // issues/900\n\n window.scrollTo(x, y);\n });\n };\n\n const sweetHTML = \"\\n <div aria-labelledby=\\\"\".concat(swalClasses.title, \"\\\" aria-describedby=\\\"\").concat(swalClasses['html-container'], \"\\\" class=\\\"\").concat(swalClasses.popup, \"\\\" tabindex=\\\"-1\\\">\\n <button type=\\\"button\\\" class=\\\"\").concat(swalClasses.close, \"\\\"></button>\\n <ul class=\\\"\").concat(swalClasses['progress-steps'], \"\\\"></ul>\\n <div class=\\\"\").concat(swalClasses.icon, \"\\\"></div>\\n <img class=\\\"\").concat(swalClasses.image, \"\\\" />\\n <h2 class=\\\"\").concat(swalClasses.title, \"\\\" id=\\\"\").concat(swalClasses.title, \"\\\"></h2>\\n <div class=\\\"\").concat(swalClasses['html-container'], \"\\\" id=\\\"\").concat(swalClasses['html-container'], \"\\\"></div>\\n <input class=\\\"\").concat(swalClasses.input, \"\\\" />\\n <input type=\\\"file\\\" class=\\\"\").concat(swalClasses.file, \"\\\" />\\n <div class=\\\"\").concat(swalClasses.range, \"\\\">\\n <input type=\\\"range\\\" />\\n <output></output>\\n </div>\\n <select class=\\\"\").concat(swalClasses.select, \"\\\"></select>\\n <div class=\\\"\").concat(swalClasses.radio, \"\\\"></div>\\n <label for=\\\"\").concat(swalClasses.checkbox, \"\\\" class=\\\"\").concat(swalClasses.checkbox, \"\\\">\\n <input type=\\\"checkbox\\\" />\\n <span class=\\\"\").concat(swalClasses.label, \"\\\"></span>\\n </label>\\n <textarea class=\\\"\").concat(swalClasses.textarea, \"\\\"></textarea>\\n <div class=\\\"\").concat(swalClasses['validation-message'], \"\\\" id=\\\"\").concat(swalClasses['validation-message'], \"\\\"></div>\\n <div class=\\\"\").concat(swalClasses.actions, \"\\\">\\n <div class=\\\"\").concat(swalClasses.loader, \"\\\"></div>\\n <button type=\\\"button\\\" class=\\\"\").concat(swalClasses.confirm, \"\\\"></button>\\n <button type=\\\"button\\\" class=\\\"\").concat(swalClasses.deny, \"\\\"></button>\\n <button type=\\\"button\\\" class=\\\"\").concat(swalClasses.cancel, \"\\\"></button>\\n </div>\\n <div class=\\\"\").concat(swalClasses.footer, \"\\\"></div>\\n <div class=\\\"\").concat(swalClasses['timer-progress-bar-container'], \"\\\">\\n <div class=\\\"\").concat(swalClasses['timer-progress-bar'], \"\\\"></div>\\n </div>\\n </div>\\n\").replace(/(^|\\n)\\s*/g, '');\n\n const resetOldContainer = () => {\n const oldContainer = getContainer();\n\n if (!oldContainer) {\n return false;\n }\n\n oldContainer.remove();\n removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]);\n return true;\n };\n\n const resetValidationMessage = () => {\n globalState.currentInstance.resetValidationMessage();\n };\n\n const addInputChangeListeners = () => {\n const popup = getPopup();\n const input = getDirectChildByClass(popup, swalClasses.input);\n const file = getDirectChildByClass(popup, swalClasses.file);\n const range = popup.querySelector(\".\".concat(swalClasses.range, \" input\"));\n const rangeOutput = popup.querySelector(\".\".concat(swalClasses.range, \" output\"));\n const select = getDirectChildByClass(popup, swalClasses.select);\n const checkbox = popup.querySelector(\".\".concat(swalClasses.checkbox, \" input\"));\n const textarea = getDirectChildByClass(popup, swalClasses.textarea);\n input.oninput = resetValidationMessage;\n file.onchange = resetValidationMessage;\n select.onchange = resetValidationMessage;\n checkbox.onchange = resetValidationMessage;\n textarea.oninput = resetValidationMessage;\n\n range.oninput = () => {\n resetValidationMessage();\n rangeOutput.value = range.value;\n };\n\n range.onchange = () => {\n resetValidationMessage();\n range.nextSibling.value = range.value;\n };\n };\n\n const getTarget = target => typeof target === 'string' ? document.querySelector(target) : target;\n\n const setupAccessibility = params => {\n const popup = getPopup();\n popup.setAttribute('role', params.toast ? 'alert' : 'dialog');\n popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive');\n\n if (!params.toast) {\n popup.setAttribute('aria-modal', 'true');\n }\n };\n\n const setupRTL = targetElement => {\n if (window.getComputedStyle(targetElement).direction === 'rtl') {\n addClass(getContainer(), swalClasses.rtl);\n }\n };\n /*\n * Add modal + backdrop to DOM\n */\n\n\n const init = params => {\n // Clean up the old popup container if it exists\n const oldContainerExisted = resetOldContainer();\n /* istanbul ignore if */\n\n if (isNodeEnv()) {\n error('SweetAlert2 requires document to initialize');\n return;\n }\n\n const container = document.createElement('div');\n container.className = swalClasses.container;\n\n if (oldContainerExisted) {\n addClass(container, swalClasses['no-transition']);\n }\n\n setInnerHtml(container, sweetHTML);\n const targetElement = getTarget(params.target);\n targetElement.appendChild(container);\n setupAccessibility(params);\n setupRTL(targetElement);\n addInputChangeListeners();\n };\n\n /**\n * @param {HTMLElement | object | string} param\n * @param {HTMLElement} target\n */\n\n const parseHtmlToContainer = (param, target) => {\n // DOM element\n if (param instanceof HTMLElement) {\n target.appendChild(param);\n } // Object\n else if (typeof param === 'object') {\n handleObject(param, target);\n } // Plain string\n else if (param) {\n setInnerHtml(target, param);\n }\n };\n /**\n * @param {object} param\n * @param {HTMLElement} target\n */\n\n const handleObject = (param, target) => {\n // JQuery element(s)\n if (param.jquery) {\n handleJqueryElem(target, param);\n } // For other objects use their string representation\n else {\n setInnerHtml(target, param.toString());\n }\n };\n\n const handleJqueryElem = (target, elem) => {\n target.textContent = '';\n\n if (0 in elem) {\n for (let i = 0; (i in elem); i++) {\n target.appendChild(elem[i].cloneNode(true));\n }\n } else {\n target.appendChild(elem.cloneNode(true));\n }\n };\n\n const animationEndEvent = (() => {\n // Prevent run in Node env\n\n /* istanbul ignore if */\n if (isNodeEnv()) {\n return false;\n }\n\n const testEl = document.createElement('div');\n const transEndEventNames = {\n WebkitAnimation: 'webkitAnimationEnd',\n // Chrome, Safari and Opera\n animation: 'animationend' // Standard syntax\n\n };\n\n for (const i in transEndEventNames) {\n if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') {\n return transEndEventNames[i];\n }\n }\n\n return false;\n })();\n\n // https://github.com/twbs/bootstrap/blob/master/js/src/modal.js\n\n const measureScrollbar = () => {\n const scrollDiv = document.createElement('div');\n scrollDiv.className = swalClasses['scrollbar-measure'];\n document.body.appendChild(scrollDiv);\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n };\n\n const renderActions = (instance, params) => {\n const actions = getActions();\n const loader = getLoader(); // Actions (buttons) wrapper\n\n if (!params.showConfirmButton && !params.showDenyButton && !params.showCancelButton) {\n hide(actions);\n } else {\n show(actions);\n } // Custom class\n\n\n applyCustomClass(actions, params, 'actions'); // Render all the buttons\n\n renderButtons(actions, loader, params); // Loader\n\n setInnerHtml(loader, params.loaderHtml);\n applyCustomClass(loader, params, 'loader');\n };\n\n function renderButtons(actions, loader, params) {\n const confirmButton = getConfirmButton();\n const denyButton = getDenyButton();\n const cancelButton = getCancelButton(); // Render buttons\n\n renderButton(confirmButton, 'confirm', params);\n renderButton(denyButton, 'deny', params);\n renderButton(cancelButton, 'cancel', params);\n handleButtonsStyling(confirmButton, denyButton, cancelButton, params);\n\n if (params.reverseButtons) {\n if (params.toast) {\n actions.insertBefore(cancelButton, confirmButton);\n actions.insertBefore(denyButton, confirmButton);\n } else {\n actions.insertBefore(cancelButton, loader);\n actions.insertBefore(denyButton, loader);\n actions.insertBefore(confirmButton, loader);\n }\n }\n }\n\n function handleButtonsStyling(confirmButton, denyButton, cancelButton, params) {\n if (!params.buttonsStyling) {\n return removeClass([confirmButton, denyButton, cancelButton], swalClasses.styled);\n }\n\n addClass([confirmButton, denyButton, cancelButton], swalClasses.styled); // Buttons background colors\n\n if (params.confirmButtonColor) {\n confirmButton.style.backgroundColor = params.confirmButtonColor;\n addClass(confirmButton, swalClasses['default-outline']);\n }\n\n if (params.denyButtonColor) {\n denyButton.style.backgroundColor = params.denyButtonColor;\n addClass(denyButton, swalClasses['default-outline']);\n }\n\n if (params.cancelButtonColor) {\n cancelButton.style.backgroundColor = params.cancelButtonColor;\n addClass(cancelButton, swalClasses['default-outline']);\n }\n }\n\n function renderButton(button, buttonType, params) {\n toggle(button, params[\"show\".concat(capitalizeFirstLetter(buttonType), \"Button\")], 'inline-block');\n setInnerHtml(button, params[\"\".concat(buttonType, \"ButtonText\")]); // Set caption text\n\n button.setAttribute('aria-label', params[\"\".concat(buttonType, \"ButtonAriaLabel\")]); // ARIA label\n // Add buttons custom classes\n\n button.className = swalClasses[buttonType];\n applyCustomClass(button, params, \"\".concat(buttonType, \"Button\"));\n addClass(button, params[\"\".concat(buttonType, \"ButtonClass\")]);\n }\n\n function handleBackdropParam(container, backdrop) {\n if (typeof backdrop === 'string') {\n container.style.background = backdrop;\n } else if (!backdrop) {\n addClass([document.documentElement, document.body], swalClasses['no-backdrop']);\n }\n }\n\n function handlePositionParam(container, position) {\n if (position in swalClasses) {\n addClass(container, swalClasses[position]);\n } else {\n warn('The \"position\" parameter is not valid, defaulting to \"center\"');\n addClass(container, swalClasses.center);\n }\n }\n\n function handleGrowParam(container, grow) {\n if (grow && typeof grow === 'string') {\n const growClass = \"grow-\".concat(grow);\n\n if (growClass in swalClasses) {\n addClass(container, swalClasses[growClass]);\n }\n }\n }\n\n const renderContainer = (instance, params) => {\n const container = getContainer();\n\n if (!container) {\n return;\n }\n\n handleBackdropParam(container, params.backdrop);\n handlePositionParam(container, params.position);\n handleGrowParam(container, params.grow); // Custom class\n\n applyCustomClass(container, params, 'container');\n };\n\n /**\n * This module contains `WeakMap`s for each effectively-\"private property\" that a `Swal` has.\n * For example, to set the private property \"foo\" of `this` to \"bar\", you can `privateProps.foo.set(this, 'bar')`\n * This is the approach that Babel will probably take to implement private methods/fields\n * https://github.com/tc39/proposal-private-methods\n * https://github.com/babel/babel/pull/7555\n * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*\n * then we can use that language feature.\n */\n var privateProps = {\n awaitingPromise: new WeakMap(),\n promise: new WeakMap(),\n innerParams: new WeakMap(),\n domCache: new WeakMap()\n };\n\n const inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'];\n const renderInput = (instance, params) => {\n const popup = getPopup();\n const innerParams = privateProps.innerParams.get(instance);\n const rerender = !innerParams || params.input !== innerParams.input;\n inputTypes.forEach(inputType => {\n const inputClass = swalClasses[inputType];\n const inputContainer = getDirectChildByClass(popup, inputClass); // set attributes\n\n setAttributes(inputType, params.inputAttributes); // set class\n\n inputContainer.className = inputClass;\n\n if (rerender) {\n hide(inputContainer);\n }\n });\n\n if (params.input) {\n if (rerender) {\n showInput(params);\n } // set custom class\n\n\n setCustomClass(params);\n }\n };\n\n const showInput = params => {\n if (!renderInputType[params.input]) {\n return error(\"Unexpected type of input! Expected \\\"text\\\", \\\"email\\\", \\\"password\\\", \\\"number\\\", \\\"tel\\\", \\\"select\\\", \\\"radio\\\", \\\"checkbox\\\", \\\"textarea\\\", \\\"file\\\" or \\\"url\\\", got \\\"\".concat(params.input, \"\\\"\"));\n }\n\n const inputContainer = getInputContainer(params.input);\n const input = renderInputType[params.input](inputContainer, params);\n show(input); // input autofocus\n\n setTimeout(() => {\n focusInput(input);\n });\n };\n\n const removeAttributes = input => {\n for (let i = 0; i < input.attributes.length; i++) {\n const attrName = input.attributes[i].name;\n\n if (!['type', 'value', 'style'].includes(attrName)) {\n input.removeAttribute(attrName);\n }\n }\n };\n\n const setAttributes = (inputType, inputAttributes) => {\n const input = getInput(getPopup(), inputType);\n\n if (!input) {\n return;\n }\n\n removeAttributes(input);\n\n for (const attr in inputAttributes) {\n input.setAttribute(attr, inputAttributes[attr]);\n }\n };\n\n const setCustomClass = params => {\n const inputContainer = getInputContainer(params.input);\n\n if (params.customClass) {\n addClass(inputContainer, params.customClass.input);\n }\n };\n\n const setInputPlaceholder = (input, params) => {\n if (!input.placeholder || params.inputPlaceholder) {\n input.placeholder = params.inputPlaceholder;\n }\n };\n\n const setInputLabel = (input, prependTo, params) => {\n if (params.inputLabel) {\n input.id = swalClasses.input;\n const label = document.createElement('label');\n const labelClass = swalClasses['input-label'];\n label.setAttribute('for', input.id);\n label.className = labelClass;\n addClass(label, params.customClass.inputLabel);\n label.innerText = params.inputLabel;\n prependTo.insertAdjacentElement('beforebegin', label);\n }\n };\n\n const getInputContainer = inputType => {\n const inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input;\n return getDirectChildByClass(getPopup(), inputClass);\n };\n\n const renderInputType = {};\n\n renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = (input, params) => {\n if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') {\n input.value = params.inputValue;\n } else if (!isPromise(params.inputValue)) {\n warn(\"Unexpected type of inputValue! Expected \\\"string\\\", \\\"number\\\" or \\\"Promise\\\", got \\\"\".concat(typeof params.inputValue, \"\\\"\"));\n }\n\n setInputLabel(input, input, params);\n setInputPlaceholder(input, params);\n input.type = params.input;\n return input;\n };\n\n renderInputType.file = (input, params) => {\n setInputLabel(input, input, params);\n setInputPlaceholder(input, params);\n return input;\n };\n\n renderInputType.range = (range, params) => {\n const rangeInput = range.querySelector('input');\n const rangeOutput = range.querySelector('output');\n rangeInput.value = params.inputValue;\n rangeInput.type = params.input;\n rangeOutput.value = params.inputValue;\n setInputLabel(rangeInput, range, params);\n return range;\n };\n\n renderInputType.select = (select, params) => {\n select.textContent = '';\n\n if (params.inputPlaceholder) {\n const placeholder = document.createElement('option');\n setInnerHtml(placeholder, params.inputPlaceholder);\n placeholder.value = '';\n placeholder.disabled = true;\n placeholder.selected = true;\n select.appendChild(placeholder);\n }\n\n setInputLabel(select, select, params);\n return select;\n };\n\n renderInputType.radio = radio => {\n radio.textContent = '';\n return radio;\n };\n\n renderInputType.checkbox = (checkboxContainer, params) => {\n /** @type {HTMLInputElement} */\n const checkbox = getInput(getPopup(), 'checkbox');\n checkbox.value = '1';\n checkbox.id = swalClasses.checkbox;\n checkbox.checked = Boolean(params.inputValue);\n const label = checkboxContainer.querySelector('span');\n setInnerHtml(label, params.inputPlaceholder);\n return checkboxContainer;\n };\n\n renderInputType.textarea = (textarea, params) => {\n textarea.value = params.inputValue;\n setInputPlaceholder(textarea, params);\n setInputLabel(textarea, textarea, params);\n\n const getMargin = el => parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight); // https://github.com/sweetalert2/sweetalert2/issues/2291\n\n\n setTimeout(() => {\n // https://github.com/sweetalert2/sweetalert2/issues/1699\n if ('MutationObserver' in window) {\n const initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width);\n\n const textareaResizeHandler = () => {\n const textareaWidth = textarea.offsetWidth + getMargin(textarea);\n\n if (textareaWidth > initialPopupWidth) {\n getPopup().style.width = \"\".concat(textareaWidth, \"px\");\n } else {\n getPopup().style.width = null;\n }\n };\n\n new MutationObserver(textareaResizeHandler).observe(textarea, {\n attributes: true,\n attributeFilter: ['style']\n });\n }\n });\n return textarea;\n };\n\n const renderContent = (instance, params) => {\n const htmlContainer = getHtmlContainer();\n applyCustomClass(htmlContainer, params, 'htmlContainer'); // Content as HTML\n\n if (params.html) {\n parseHtmlToContainer(params.html, htmlContainer);\n show(htmlContainer, 'block');\n } // Content as plain text\n else if (params.text) {\n htmlContainer.textContent = params.text;\n show(htmlContainer, 'block');\n } // No content\n else {\n hide(htmlContainer);\n }\n\n renderInput(instance, params);\n };\n\n const renderFooter = (instance, params) => {\n const footer = getFooter();\n toggle(footer, params.footer);\n\n if (params.footer) {\n parseHtmlToContainer(params.footer, footer);\n } // Custom class\n\n\n applyCustomClass(footer, params, 'footer');\n };\n\n const renderCloseButton = (instance, params) => {\n const closeButton = getCloseButton();\n setInnerHtml(closeButton, params.closeButtonHtml); // Custom class\n\n applyCustomClass(closeButton, params, 'closeButton');\n toggle(closeButton, params.showCloseButton);\n closeButton.setAttribute('aria-label', params.closeButtonAriaLabel);\n };\n\n const renderIcon = (instance, params) => {\n const innerParams = privateProps.innerParams.get(instance);\n const icon = getIcon(); // if the given icon already rendered, apply the styling without re-rendering the icon\n\n if (innerParams && params.icon === innerParams.icon) {\n // Custom or default content\n setContent(icon, params);\n applyStyles(icon, params);\n return;\n }\n\n if (!params.icon && !params.iconHtml) {\n return hide(icon);\n }\n\n if (params.icon && Object.keys(iconTypes).indexOf(params.icon) === -1) {\n error(\"Unknown icon! Expected \\\"success\\\", \\\"error\\\", \\\"warning\\\", \\\"info\\\" or \\\"question\\\", got \\\"\".concat(params.icon, \"\\\"\"));\n return hide(icon);\n }\n\n show(icon); // Custom or default content\n\n setContent(icon, params);\n applyStyles(icon, params); // Animate icon\n\n addClass(icon, params.showClass.icon);\n };\n\n const applyStyles = (icon, params) => {\n for (const iconType in iconTypes) {\n if (params.icon !== iconType) {\n removeClass(icon, iconTypes[iconType]);\n }\n }\n\n addClass(icon, iconTypes[params.icon]); // Icon color\n\n setColor(icon, params); // Success icon background color\n\n adjustSuccessIconBackgroundColor(); // Custom class\n\n applyCustomClass(icon, params, 'icon');\n }; // Adjust success icon background color to match the popup background color\n\n\n const adjustSuccessIconBackgroundColor = () => {\n const popup = getPopup();\n const popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color');\n const successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix');\n\n for (let i = 0; i < successIconParts.length; i++) {\n successIconParts[i].style.backgroundColor = popupBackgroundColor;\n }\n };\n\n const successIconHtml = \"\\n <div class=\\\"swal2-success-circular-line-left\\\"></div>\\n <span class=\\\"swal2-success-line-tip\\\"></span> <span class=\\\"swal2-success-line-long\\\"></span>\\n <div class=\\\"swal2-success-ring\\\"></div> <div class=\\\"swal2-success-fix\\\"></div>\\n <div class=\\\"swal2-success-circular-line-right\\\"></div>\\n\";\n const errorIconHtml = \"\\n <span class=\\\"swal2-x-mark\\\">\\n <span class=\\\"swal2-x-mark-line-left\\\"></span>\\n <span class=\\\"swal2-x-mark-line-right\\\"></span>\\n </span>\\n\";\n\n const setContent = (icon, params) => {\n icon.textContent = '';\n\n if (params.iconHtml) {\n setInnerHtml(icon, iconContent(params.iconHtml));\n } else if (params.icon === 'success') {\n setInnerHtml(icon, successIconHtml);\n } else if (params.icon === 'error') {\n setInnerHtml(icon, errorIconHtml);\n } else {\n const defaultIconHtml = {\n question: '?',\n warning: '!',\n info: 'i'\n };\n setInnerHtml(icon, iconContent(defaultIconHtml[params.icon]));\n }\n };\n\n const setColor = (icon, params) => {\n if (!params.iconColor) {\n return;\n }\n\n icon.style.color = params.iconColor;\n icon.style.borderColor = params.iconColor;\n\n for (const sel of ['.swal2-success-line-tip', '.swal2-success-line-long', '.swal2-x-mark-line-left', '.swal2-x-mark-line-right']) {\n setStyle(icon, sel, 'backgroundColor', params.iconColor);\n }\n\n setStyle(icon, '.swal2-success-ring', 'borderColor', params.iconColor);\n };\n\n const iconContent = content => \"<div class=\\\"\".concat(swalClasses['icon-content'], \"\\\">\").concat(content, \"</div>\");\n\n const renderImage = (instance, params) => {\n const image = getImage();\n\n if (!params.imageUrl) {\n return hide(image);\n }\n\n show(image, ''); // Src, alt\n\n image.setAttribute('src', params.imageUrl);\n image.setAttribute('alt', params.imageAlt); // Width, height\n\n applyNumericalStyle(image, 'width', params.imageWidth);\n applyNumericalStyle(image, 'height', params.imageHeight); // Class\n\n image.className = swalClasses.image;\n applyCustomClass(image, params, 'image');\n };\n\n const createStepElement = step => {\n const stepEl = document.createElement('li');\n addClass(stepEl, swalClasses['progress-step']);\n setInnerHtml(stepEl, step);\n return stepEl;\n };\n\n const createLineElement = params => {\n const lineEl = document.createElement('li');\n addClass(lineEl, swalClasses['progress-step-line']);\n\n if (params.progressStepsDistance) {\n lineEl.style.width = params.progressStepsDistance;\n }\n\n return lineEl;\n };\n\n const renderProgressSteps = (instance, params) => {\n const progressStepsContainer = getProgressSteps();\n\n if (!params.progressSteps || params.progressSteps.length === 0) {\n return hide(progressStepsContainer);\n }\n\n show(progressStepsContainer);\n progressStepsContainer.textContent = '';\n\n if (params.currentProgressStep >= params.progressSteps.length) {\n warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)');\n }\n\n params.progressSteps.forEach((step, index) => {\n const stepEl = createStepElement(step);\n progressStepsContainer.appendChild(stepEl);\n\n if (index === params.currentProgressStep) {\n addClass(stepEl, swalClasses['active-progress-step']);\n }\n\n if (index !== params.progressSteps.length - 1) {\n const lineEl = createLineElement(params);\n progressStepsContainer.appendChild(lineEl);\n }\n });\n };\n\n const renderTitle = (instance, params) => {\n const title = getTitle();\n toggle(title, params.title || params.titleText, 'block');\n\n if (params.title) {\n parseHtmlToContainer(params.title, title);\n }\n\n if (params.titleText) {\n title.innerText = params.titleText;\n } // Custom class\n\n\n applyCustomClass(title, params, 'title');\n };\n\n const renderPopup = (instance, params) => {\n const container = getContainer();\n const popup = getPopup(); // Width\n // https://github.com/sweetalert2/sweetalert2/issues/2170\n\n if (params.toast) {\n applyNumericalStyle(container, 'width', params.width);\n popup.style.width = '100%';\n popup.insertBefore(getLoader(), getIcon());\n } else {\n applyNumericalStyle(popup, 'width', params.width);\n } // Padding\n\n\n applyNumericalStyle(popup, 'padding', params.padding); // Color\n\n if (params.color) {\n popup.style.color = params.color;\n } // Background\n\n\n if (params.background) {\n popup.style.background = params.background;\n }\n\n hide(getValidationMessage()); // Classes\n\n addClasses(popup, params);\n };\n\n const addClasses = (popup, params) => {\n // Default Class + showClass when updating Swal.update({})\n popup.className = \"\".concat(swalClasses.popup, \" \").concat(isVisible(popup) ? params.showClass.popup : '');\n\n if (params.toast) {\n addClass([document.documentElement, document.body], swalClasses['toast-shown']);\n addClass(popup, swalClasses.toast);\n } else {\n addClass(popup, swalClasses.modal);\n } // Custom class\n\n\n applyCustomClass(popup, params, 'popup');\n\n if (typeof params.customClass === 'string') {\n addClass(popup, params.customClass);\n } // Icon class (#1842)\n\n\n if (params.icon) {\n addClass(popup, swalClasses[\"icon-\".concat(params.icon)]);\n }\n };\n\n const render = (instance, params) => {\n renderPopup(instance, params);\n renderContainer(instance, params);\n renderProgressSteps(instance, params);\n renderIcon(instance, params);\n renderImage(instance, params);\n renderTitle(instance, params);\n renderCloseButton(instance, params);\n renderContent(instance, params);\n renderActions(instance, params);\n renderFooter(instance, params);\n\n if (typeof params.didRender === 'function') {\n params.didRender(getPopup());\n }\n };\n\n const DismissReason = Object.freeze({\n cancel: 'cancel',\n backdrop: 'backdrop',\n close: 'close',\n esc: 'esc',\n timer: 'timer'\n });\n\n // Adding aria-hidden=\"true\" to elements outside of the active modal dialog ensures that\n // elements not within the active modal dialog will not be surfaced if a user opens a screen\n // reader\u2019s list of elements (headings, form controls, landmarks, etc.) in the document.\n\n const setAriaHidden = () => {\n const bodyChildren = toArray(document.body.children);\n bodyChildren.forEach(el => {\n if (el === getContainer() || el.contains(getContainer())) {\n return;\n }\n\n if (el.hasAttribute('aria-hidden')) {\n el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden'));\n }\n\n el.setAttribute('aria-hidden', 'true');\n });\n };\n const unsetAriaHidden = () => {\n const bodyChildren = toArray(document.body.children);\n bodyChildren.forEach(el => {\n if (el.hasAttribute('data-previous-aria-hidden')) {\n el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden'));\n el.removeAttribute('data-previous-aria-hidden');\n } else {\n el.removeAttribute('aria-hidden');\n }\n });\n };\n\n const swalStringParams = ['swal-title', 'swal-html', 'swal-footer'];\n const getTemplateParams = params => {\n const template = typeof params.template === 'string' ? document.querySelector(params.template) : params.template;\n\n if (!template) {\n return {};\n }\n /** @type {DocumentFragment} */\n\n\n const templateContent = template.content;\n showWarningsForElements(templateContent);\n const result = Object.assign(getSwalParams(templateContent), getSwalButtons(templateContent), getSwalImage(templateContent), getSwalIcon(templateContent), getSwalInput(templateContent), getSwalStringParams(templateContent, swalStringParams));\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n const getSwalParams = templateContent => {\n const result = {};\n toArray(templateContent.querySelectorAll('swal-param')).forEach(param => {\n showWarningsForAttributes(param, ['name', 'value']);\n const paramName = param.getAttribute('name');\n const value = param.getAttribute('value');\n\n if (typeof defaultParams[paramName] === 'boolean' && value === 'false') {\n result[paramName] = false;\n }\n\n if (typeof defaultParams[paramName] === 'object') {\n result[paramName] = JSON.parse(value);\n }\n });\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const getSwalButtons = templateContent => {\n const result = {};\n toArray(templateContent.querySelectorAll('swal-button')).forEach(button => {\n showWarningsForAttributes(button, ['type', 'color', 'aria-label']);\n const type = button.getAttribute('type');\n result[\"\".concat(type, \"ButtonText\")] = button.innerHTML;\n result[\"show\".concat(capitalizeFirstLetter(type), \"Button\")] = true;\n\n if (button.hasAttribute('color')) {\n result[\"\".concat(type, \"ButtonColor\")] = button.getAttribute('color');\n }\n\n if (button.hasAttribute('aria-label')) {\n result[\"\".concat(type, \"ButtonAriaLabel\")] = button.getAttribute('aria-label');\n }\n });\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const getSwalImage = templateContent => {\n const result = {};\n /** @type {HTMLElement} */\n\n const image = templateContent.querySelector('swal-image');\n\n if (image) {\n showWarningsForAttributes(image, ['src', 'width', 'height', 'alt']);\n\n if (image.hasAttribute('src')) {\n result.imageUrl = image.getAttribute('src');\n }\n\n if (image.hasAttribute('width')) {\n result.imageWidth = image.getAttribute('width');\n }\n\n if (image.hasAttribute('height')) {\n result.imageHeight = image.getAttribute('height');\n }\n\n if (image.hasAttribute('alt')) {\n result.imageAlt = image.getAttribute('alt');\n }\n }\n\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const getSwalIcon = templateContent => {\n const result = {};\n /** @type {HTMLElement} */\n\n const icon = templateContent.querySelector('swal-icon');\n\n if (icon) {\n showWarningsForAttributes(icon, ['type', 'color']);\n\n if (icon.hasAttribute('type')) {\n result.icon = icon.getAttribute('type');\n }\n\n if (icon.hasAttribute('color')) {\n result.iconColor = icon.getAttribute('color');\n }\n\n result.iconHtml = icon.innerHTML;\n }\n\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const getSwalInput = templateContent => {\n const result = {};\n /** @type {HTMLElement} */\n\n const input = templateContent.querySelector('swal-input');\n\n if (input) {\n showWarningsForAttributes(input, ['type', 'label', 'placeholder', 'value']);\n result.input = input.getAttribute('type') || 'text';\n\n if (input.hasAttribute('label')) {\n result.inputLabel = input.getAttribute('label');\n }\n\n if (input.hasAttribute('placeholder')) {\n result.inputPlaceholder = input.getAttribute('placeholder');\n }\n\n if (input.hasAttribute('value')) {\n result.inputValue = input.getAttribute('value');\n }\n }\n\n const inputOptions = templateContent.querySelectorAll('swal-input-option');\n\n if (inputOptions.length) {\n result.inputOptions = {};\n toArray(inputOptions).forEach(option => {\n showWarningsForAttributes(option, ['value']);\n const optionValue = option.getAttribute('value');\n const optionName = option.innerHTML;\n result.inputOptions[optionValue] = optionName;\n });\n }\n\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n * @param {string[]} paramNames\n */\n\n\n const getSwalStringParams = (templateContent, paramNames) => {\n const result = {};\n\n for (const i in paramNames) {\n const paramName = paramNames[i];\n /** @type {HTMLElement} */\n\n const tag = templateContent.querySelector(paramName);\n\n if (tag) {\n showWarningsForAttributes(tag, []);\n result[paramName.replace(/^swal-/, '')] = tag.innerHTML.trim();\n }\n }\n\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const showWarningsForElements = templateContent => {\n const allowedElements = swalStringParams.concat(['swal-param', 'swal-button', 'swal-image', 'swal-icon', 'swal-input', 'swal-input-option']);\n toArray(templateContent.children).forEach(el => {\n const tagName = el.tagName.toLowerCase();\n\n if (allowedElements.indexOf(tagName) === -1) {\n warn(\"Unrecognized element <\".concat(tagName, \">\"));\n }\n });\n };\n /**\n * @param {HTMLElement} el\n * @param {string[]} allowedAttributes\n */\n\n\n const showWarningsForAttributes = (el, allowedAttributes) => {\n toArray(el.attributes).forEach(attribute => {\n if (allowedAttributes.indexOf(attribute.name) === -1) {\n warn([\"Unrecognized attribute \\\"\".concat(attribute.name, \"\\\" on <\").concat(el.tagName.toLowerCase(), \">.\"), \"\".concat(allowedAttributes.length ? \"Allowed attributes are: \".concat(allowedAttributes.join(', ')) : 'To set the value, use HTML within the element.')]);\n }\n });\n };\n\n var defaultInputValidators = {\n email: (string, validationMessage) => {\n return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address');\n },\n url: (string, validationMessage) => {\n // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 and #2013\n return /^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-z]{2,63}\\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL');\n }\n };\n\n function setDefaultInputValidators(params) {\n // Use default `inputValidator` for supported input types if not provided\n if (!params.inputValidator) {\n Object.keys(defaultInputValidators).forEach(key => {\n if (params.input === key) {\n params.inputValidator = defaultInputValidators[key];\n }\n });\n }\n }\n\n function validateCustomTargetElement(params) {\n // Determine if the custom target element is valid\n if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) {\n warn('Target parameter is not valid, defaulting to \"body\"');\n params.target = 'body';\n }\n }\n /**\n * Set type, text and actions on popup\n *\n * @param params\n */\n\n\n function setParameters(params) {\n setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm\n\n if (params.showLoaderOnConfirm && !params.preConfirm) {\n warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\\n' + 'https://sweetalert2.github.io/#ajax-request');\n }\n\n validateCustomTargetElement(params); // Replace newlines with <br> in title\n\n if (typeof params.title === 'string') {\n params.title = params.title.split('\\n').join('<br />');\n }\n\n init(params);\n }\n\n class Timer {\n constructor(callback, delay) {\n this.callback = callback;\n this.remaining = delay;\n this.running = false;\n this.start();\n }\n\n start() {\n if (!this.running) {\n this.running = true;\n this.started = new Date();\n this.id = setTimeout(this.callback, this.remaining);\n }\n\n return this.remaining;\n }\n\n stop() {\n if (this.running) {\n this.running = false;\n clearTimeout(this.id);\n this.remaining -= new Date().getTime() - this.started.getTime();\n }\n\n return this.remaining;\n }\n\n increase(n) {\n const running = this.running;\n\n if (running) {\n this.stop();\n }\n\n this.remaining += n;\n\n if (running) {\n this.start();\n }\n\n return this.remaining;\n }\n\n getTimerLeft() {\n if (this.running) {\n this.stop();\n this.start();\n }\n\n return this.remaining;\n }\n\n isRunning() {\n return this.running;\n }\n\n }\n\n const fixScrollbar = () => {\n // for queues, do not do this more than once\n if (states.previousBodyPadding !== null) {\n return;\n } // if the body has overflow\n\n\n if (document.body.scrollHeight > window.innerHeight) {\n // add padding so the content doesn't shift after removal of scrollbar\n states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right'));\n document.body.style.paddingRight = \"\".concat(states.previousBodyPadding + measureScrollbar(), \"px\");\n }\n };\n const undoScrollbar = () => {\n if (states.previousBodyPadding !== null) {\n document.body.style.paddingRight = \"\".concat(states.previousBodyPadding, \"px\");\n states.previousBodyPadding = null;\n }\n };\n\n /* istanbul ignore file */\n\n const iOSfix = () => {\n const iOS = // @ts-ignore\n /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;\n\n if (iOS && !hasClass(document.body, swalClasses.iosfix)) {\n const offset = document.body.scrollTop;\n document.body.style.top = \"\".concat(offset * -1, \"px\");\n addClass(document.body, swalClasses.iosfix);\n lockBodyScroll();\n addBottomPaddingForTallPopups();\n }\n };\n /**\n * https://github.com/sweetalert2/sweetalert2/issues/1948\n */\n\n const addBottomPaddingForTallPopups = () => {\n const ua = navigator.userAgent;\n const iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i);\n const webkit = !!ua.match(/WebKit/i);\n const iOSSafari = iOS && webkit && !ua.match(/CriOS/i);\n\n if (iOSSafari) {\n const bottomPanelHeight = 44;\n\n if (getPopup().scrollHeight > window.innerHeight - bottomPanelHeight) {\n getContainer().style.paddingBottom = \"\".concat(bottomPanelHeight, \"px\");\n }\n }\n };\n /**\n * https://github.com/sweetalert2/sweetalert2/issues/1246\n */\n\n\n const lockBodyScroll = () => {\n const container = getContainer();\n let preventTouchMove;\n\n container.ontouchstart = e => {\n preventTouchMove = shouldPreventTouchMove(e);\n };\n\n container.ontouchmove = e => {\n if (preventTouchMove) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n };\n\n const shouldPreventTouchMove = event => {\n const target = event.target;\n const container = getContainer();\n\n if (isStylus(event) || isZoom(event)) {\n return false;\n }\n\n if (target === container) {\n return true;\n }\n\n if (!isScrollable(container) && target.tagName !== 'INPUT' && // #1603\n target.tagName !== 'TEXTAREA' && // #2266\n !(isScrollable(getHtmlContainer()) && // #1944\n getHtmlContainer().contains(target))) {\n return true;\n }\n\n return false;\n };\n /**\n * https://github.com/sweetalert2/sweetalert2/issues/1786\n *\n * @param {*} event\n * @returns {boolean}\n */\n\n\n const isStylus = event => {\n return event.touches && event.touches.length && event.touches[0].touchType === 'stylus';\n };\n /**\n * https://github.com/sweetalert2/sweetalert2/issues/1891\n *\n * @param {TouchEvent} event\n * @returns {boolean}\n */\n\n\n const isZoom = event => {\n return event.touches && event.touches.length > 1;\n };\n\n const undoIOSfix = () => {\n if (hasClass(document.body, swalClasses.iosfix)) {\n const offset = parseInt(document.body.style.top, 10);\n removeClass(document.body, swalClasses.iosfix);\n document.body.style.top = '';\n document.body.scrollTop = offset * -1;\n }\n };\n\n const SHOW_CLASS_TIMEOUT = 10;\n /**\n * Open popup, add necessary classes and styles, fix scrollbar\n *\n * @param params\n */\n\n const openPopup = params => {\n const container = getContainer();\n const popup = getPopup();\n\n if (typeof params.willOpen === 'function') {\n params.willOpen(popup);\n }\n\n const bodyStyles = window.getComputedStyle(document.body);\n const initialBodyOverflow = bodyStyles.overflowY;\n addClasses$1(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto'\n\n setTimeout(() => {\n setScrollingVisibility(container, popup);\n }, SHOW_CLASS_TIMEOUT);\n\n if (isModal()) {\n fixScrollContainer(container, params.scrollbarPadding, initialBodyOverflow);\n setAriaHidden();\n }\n\n if (!isToast() && !globalState.previousActiveElement) {\n globalState.previousActiveElement = document.activeElement;\n }\n\n if (typeof params.didOpen === 'function') {\n setTimeout(() => params.didOpen(popup));\n }\n\n removeClass(container, swalClasses['no-transition']);\n };\n\n const swalOpenAnimationFinished = event => {\n const popup = getPopup();\n\n if (event.target !== popup) {\n return;\n }\n\n const container = getContainer();\n popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished);\n container.style.overflowY = 'auto';\n };\n\n const setScrollingVisibility = (container, popup) => {\n if (animationEndEvent && hasCssAnimation(popup)) {\n container.style.overflowY = 'hidden';\n popup.addEventListener(animationEndEvent, swalOpenAnimationFinished);\n } else {\n container.style.overflowY = 'auto';\n }\n };\n\n const fixScrollContainer = (container, scrollbarPadding, initialBodyOverflow) => {\n iOSfix();\n\n if (scrollbarPadding && initialBodyOverflow !== 'hidden') {\n fixScrollbar();\n } // sweetalert2/issues/1247\n\n\n setTimeout(() => {\n container.scrollTop = 0;\n });\n };\n\n const addClasses$1 = (container, popup, params) => {\n addClass(container, params.showClass.backdrop); // this workaround with opacity is needed for https://github.com/sweetalert2/sweetalert2/issues/2059\n\n popup.style.setProperty('opacity', '0', 'important');\n show(popup, 'grid');\n setTimeout(() => {\n // Animate popup right after showing it\n addClass(popup, params.showClass.popup); // and remove the opacity workaround\n\n popup.style.removeProperty('opacity');\n }, SHOW_CLASS_TIMEOUT); // 10ms in order to fix #2062\n\n addClass([document.documentElement, document.body], swalClasses.shown);\n\n if (params.heightAuto && params.backdrop && !params.toast) {\n addClass([document.documentElement, document.body], swalClasses['height-auto']);\n }\n };\n\n /**\n * Shows loader (spinner), this is useful with AJAX requests.\n * By default the loader be shown instead of the \"Confirm\" button.\n */\n\n const showLoading = buttonToReplace => {\n let popup = getPopup();\n\n if (!popup) {\n new Swal(); // eslint-disable-line no-new\n }\n\n popup = getPopup();\n const loader = getLoader();\n\n if (isToast()) {\n hide(getIcon());\n } else {\n replaceButton(popup, buttonToReplace);\n }\n\n show(loader);\n popup.setAttribute('data-loading', true);\n popup.setAttribute('aria-busy', true);\n popup.focus();\n };\n\n const replaceButton = (popup, buttonToReplace) => {\n const actions = getActions();\n const loader = getLoader();\n\n if (!buttonToReplace && isVisible(getConfirmButton())) {\n buttonToReplace = getConfirmButton();\n }\n\n show(actions);\n\n if (buttonToReplace) {\n hide(buttonToReplace);\n loader.setAttribute('data-button-to-replace', buttonToReplace.className);\n }\n\n loader.parentNode.insertBefore(loader, buttonToReplace);\n addClass([popup, actions], swalClasses.loading);\n };\n\n const handleInputOptionsAndValue = (instance, params) => {\n if (params.input === 'select' || params.input === 'radio') {\n handleInputOptions(instance, params);\n } else if (['text', 'email', 'number', 'tel', 'textarea'].includes(params.input) && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) {\n showLoading(getConfirmButton());\n handleInputValue(instance, params);\n }\n };\n const getInputValue = (instance, innerParams) => {\n const input = instance.getInput();\n\n if (!input) {\n return null;\n }\n\n switch (innerParams.input) {\n case 'checkbox':\n return getCheckboxValue(input);\n\n case 'radio':\n return getRadioValue(input);\n\n case 'file':\n return getFileValue(input);\n\n default:\n return innerParams.inputAutoTrim ? input.value.trim() : input.value;\n }\n };\n\n const getCheckboxValue = input => input.checked ? 1 : 0;\n\n const getRadioValue = input => input.checked ? input.value : null;\n\n const getFileValue = input => input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null;\n\n const handleInputOptions = (instance, params) => {\n const popup = getPopup();\n\n const processInputOptions = inputOptions => populateInputOptions[params.input](popup, formatInputOptions(inputOptions), params);\n\n if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) {\n showLoading(getConfirmButton());\n asPromise(params.inputOptions).then(inputOptions => {\n instance.hideLoading();\n processInputOptions(inputOptions);\n });\n } else if (typeof params.inputOptions === 'object') {\n processInputOptions(params.inputOptions);\n } else {\n error(\"Unexpected type of inputOptions! Expected object, Map or Promise, got \".concat(typeof params.inputOptions));\n }\n };\n\n const handleInputValue = (instance, params) => {\n const input = instance.getInput();\n hide(input);\n asPromise(params.inputValue).then(inputValue => {\n input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : \"\".concat(inputValue);\n show(input);\n input.focus();\n instance.hideLoading();\n }).catch(err => {\n error(\"Error in inputValue promise: \".concat(err));\n input.value = '';\n show(input);\n input.focus();\n instance.hideLoading();\n });\n };\n\n const populateInputOptions = {\n select: (popup, inputOptions, params) => {\n const select = getDirectChildByClass(popup, swalClasses.select);\n\n const renderOption = (parent, optionLabel, optionValue) => {\n const option = document.createElement('option');\n option.value = optionValue;\n setInnerHtml(option, optionLabel);\n option.selected = isSelected(optionValue, params.inputValue);\n parent.appendChild(option);\n };\n\n inputOptions.forEach(inputOption => {\n const optionValue = inputOption[0];\n const optionLabel = inputOption[1]; // <optgroup> spec:\n // https://www.w3.org/TR/html401/interact/forms.html#h-17.6\n // \"...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)...\"\n // check whether this is a <optgroup>\n\n if (Array.isArray(optionLabel)) {\n // if it is an array, then it is an <optgroup>\n const optgroup = document.createElement('optgroup');\n optgroup.label = optionValue;\n optgroup.disabled = false; // not configurable for now\n\n select.appendChild(optgroup);\n optionLabel.forEach(o => renderOption(optgroup, o[1], o[0]));\n } else {\n // case of <option>\n renderOption(select, optionLabel, optionValue);\n }\n });\n select.focus();\n },\n radio: (popup, inputOptions, params) => {\n const radio = getDirectChildByClass(popup, swalClasses.radio);\n inputOptions.forEach(inputOption => {\n const radioValue = inputOption[0];\n const radioLabel = inputOption[1];\n const radioInput = document.createElement('input');\n const radioLabelElement = document.createElement('label');\n radioInput.type = 'radio';\n radioInput.name = swalClasses.radio;\n radioInput.value = radioValue;\n\n if (isSelected(radioValue, params.inputValue)) {\n radioInput.checked = true;\n }\n\n const label = document.createElement('span');\n setInnerHtml(label, radioLabel);\n label.className = swalClasses.label;\n radioLabelElement.appendChild(radioInput);\n radioLabelElement.appendChild(label);\n radio.appendChild(radioLabelElement);\n });\n const radios = radio.querySelectorAll('input');\n\n if (radios.length) {\n radios[0].focus();\n }\n }\n };\n /**\n * Converts `inputOptions` into an array of `[value, label]`s\n * @param inputOptions\n */\n\n const formatInputOptions = inputOptions => {\n const result = [];\n\n if (typeof Map !== 'undefined' && inputOptions instanceof Map) {\n inputOptions.forEach((value, key) => {\n let valueFormatted = value;\n\n if (typeof valueFormatted === 'object') {\n // case of <optgroup>\n valueFormatted = formatInputOptions(valueFormatted);\n }\n\n result.push([key, valueFormatted]);\n });\n } else {\n Object.keys(inputOptions).forEach(key => {\n let valueFormatted = inputOptions[key];\n\n if (typeof valueFormatted === 'object') {\n // case of <optgroup>\n valueFormatted = formatInputOptions(valueFormatted);\n }\n\n result.push([key, valueFormatted]);\n });\n }\n\n return result;\n };\n\n const isSelected = (optionValue, inputValue) => {\n return inputValue && inputValue.toString() === optionValue.toString();\n };\n\n /**\n * Hides loader and shows back the button which was hidden by .showLoading()\n */\n\n function hideLoading() {\n // do nothing if popup is closed\n const innerParams = privateProps.innerParams.get(this);\n\n if (!innerParams) {\n return;\n }\n\n const domCache = privateProps.domCache.get(this);\n hide(domCache.loader);\n\n if (isToast()) {\n if (innerParams.icon) {\n show(getIcon());\n }\n } else {\n showRelatedButton(domCache);\n }\n\n removeClass([domCache.popup, domCache.actions], swalClasses.loading);\n domCache.popup.removeAttribute('aria-busy');\n domCache.popup.removeAttribute('data-loading');\n domCache.confirmButton.disabled = false;\n domCache.denyButton.disabled = false;\n domCache.cancelButton.disabled = false;\n }\n\n const showRelatedButton = domCache => {\n const buttonToReplace = domCache.popup.getElementsByClassName(domCache.loader.getAttribute('data-button-to-replace'));\n\n if (buttonToReplace.length) {\n show(buttonToReplace[0], 'inline-block');\n } else if (allButtonsAreHidden()) {\n hide(domCache.actions);\n }\n };\n\n /**\n * Gets the input DOM node, this method works with input parameter.\n * @returns {HTMLElement | null}\n */\n\n function getInput$1(instance) {\n const innerParams = privateProps.innerParams.get(instance || this);\n const domCache = privateProps.domCache.get(instance || this);\n\n if (!domCache) {\n return null;\n }\n\n return getInput(domCache.popup, innerParams.input);\n }\n\n /**\n * This module contains `WeakMap`s for each effectively-\"private property\" that a `Swal` has.\n * For example, to set the private property \"foo\" of `this` to \"bar\", you can `privateProps.foo.set(this, 'bar')`\n * This is the approach that Babel will probably take to implement private methods/fields\n * https://github.com/tc39/proposal-private-methods\n * https://github.com/babel/babel/pull/7555\n * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*\n * then we can use that language feature.\n */\n var privateMethods = {\n swalPromiseResolve: new WeakMap(),\n swalPromiseReject: new WeakMap()\n };\n\n /*\n * Global function to determine if SweetAlert2 popup is shown\n */\n\n const isVisible$1 = () => {\n return isVisible(getPopup());\n };\n /*\n * Global function to click 'Confirm' button\n */\n\n const clickConfirm = () => getConfirmButton() && getConfirmButton().click();\n /*\n * Global function to click 'Deny' button\n */\n\n const clickDeny = () => getDenyButton() && getDenyButton().click();\n /*\n * Global function to click 'Cancel' button\n */\n\n const clickCancel = () => getCancelButton() && getCancelButton().click();\n\n const removeKeydownHandler = globalState => {\n if (globalState.keydownTarget && globalState.keydownHandlerAdded) {\n globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, {\n capture: globalState.keydownListenerCapture\n });\n globalState.keydownHandlerAdded = false;\n }\n };\n const addKeydownHandler = (instance, globalState, innerParams, dismissWith) => {\n removeKeydownHandler(globalState);\n\n if (!innerParams.toast) {\n globalState.keydownHandler = e => keydownHandler(instance, e, dismissWith);\n\n globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup();\n globalState.keydownListenerCapture = innerParams.keydownListenerCapture;\n globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, {\n capture: globalState.keydownListenerCapture\n });\n globalState.keydownHandlerAdded = true;\n }\n }; // Focus handling\n\n const setFocus = (innerParams, index, increment) => {\n const focusableElements = getFocusableElements(); // search for visible elements and select the next possible match\n\n if (focusableElements.length) {\n index = index + increment; // rollover to first item\n\n if (index === focusableElements.length) {\n index = 0; // go to last item\n } else if (index === -1) {\n index = focusableElements.length - 1;\n }\n\n return focusableElements[index].focus();\n } // no visible focusable elements, focus the popup\n\n\n getPopup().focus();\n };\n const arrowKeysNextButton = ['ArrowRight', 'ArrowDown'];\n const arrowKeysPreviousButton = ['ArrowLeft', 'ArrowUp'];\n\n const keydownHandler = (instance, e, dismissWith) => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (!innerParams) {\n return; // This instance has already been destroyed\n } // Ignore keydown during IME composition\n // https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event#ignoring_keydown_during_ime_composition\n // https://github.com/sweetalert2/sweetalert2/issues/720\n // https://github.com/sweetalert2/sweetalert2/issues/2406\n\n\n if (e.isComposing || e.keyCode === 229) {\n return;\n }\n\n if (innerParams.stopKeydownPropagation) {\n e.stopPropagation();\n } // ENTER\n\n\n if (e.key === 'Enter') {\n handleEnter(instance, e, innerParams);\n } // TAB\n else if (e.key === 'Tab') {\n handleTab(e, innerParams);\n } // ARROWS - switch focus between buttons\n else if ([...arrowKeysNextButton, ...arrowKeysPreviousButton].includes(e.key)) {\n handleArrows(e.key);\n } // ESC\n else if (e.key === 'Escape') {\n handleEsc(e, innerParams, dismissWith);\n }\n };\n\n const handleEnter = (instance, e, innerParams) => {\n // https://github.com/sweetalert2/sweetalert2/issues/2386\n if (!callIfFunction(innerParams.allowEnterKey)) {\n return;\n }\n\n if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) {\n if (['textarea', 'file'].includes(innerParams.input)) {\n return; // do not submit\n }\n\n clickConfirm();\n e.preventDefault();\n }\n };\n\n const handleTab = (e, innerParams) => {\n const targetElement = e.target;\n const focusableElements = getFocusableElements();\n let btnIndex = -1;\n\n for (let i = 0; i < focusableElements.length; i++) {\n if (targetElement === focusableElements[i]) {\n btnIndex = i;\n break;\n }\n } // Cycle to the next button\n\n\n if (!e.shiftKey) {\n setFocus(innerParams, btnIndex, 1);\n } // Cycle to the prev button\n else {\n setFocus(innerParams, btnIndex, -1);\n }\n\n e.stopPropagation();\n e.preventDefault();\n };\n\n const handleArrows = key => {\n const confirmButton = getConfirmButton();\n const denyButton = getDenyButton();\n const cancelButton = getCancelButton();\n\n if (![confirmButton, denyButton, cancelButton].includes(document.activeElement)) {\n return;\n }\n\n const sibling = arrowKeysNextButton.includes(key) ? 'nextElementSibling' : 'previousElementSibling';\n let buttonToFocus = document.activeElement;\n\n for (let i = 0; i < getActions().children.length; i++) {\n buttonToFocus = buttonToFocus[sibling];\n\n if (!buttonToFocus) {\n return;\n }\n\n if (isVisible(buttonToFocus) && buttonToFocus instanceof HTMLButtonElement) {\n break;\n }\n }\n\n if (buttonToFocus instanceof HTMLButtonElement) {\n buttonToFocus.focus();\n }\n };\n\n const handleEsc = (e, innerParams, dismissWith) => {\n if (callIfFunction(innerParams.allowEscapeKey)) {\n e.preventDefault();\n dismissWith(DismissReason.esc);\n }\n };\n\n /*\n * Instance method to close sweetAlert\n */\n\n function removePopupAndResetState(instance, container, returnFocus, didClose) {\n if (isToast()) {\n triggerDidCloseAndDispose(instance, didClose);\n } else {\n restoreActiveElement(returnFocus).then(() => triggerDidCloseAndDispose(instance, didClose));\n removeKeydownHandler(globalState);\n }\n\n const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // workaround for #2088\n // for some reason removing the container in Safari will scroll the document to bottom\n\n if (isSafari) {\n container.setAttribute('style', 'display:none !important');\n container.removeAttribute('class');\n container.innerHTML = '';\n } else {\n container.remove();\n }\n\n if (isModal()) {\n undoScrollbar();\n undoIOSfix();\n unsetAriaHidden();\n }\n\n removeBodyClasses();\n }\n\n function removeBodyClasses() {\n removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown']]);\n }\n\n function close(resolveValue) {\n resolveValue = prepareResolveValue(resolveValue);\n const swalPromiseResolve = privateMethods.swalPromiseResolve.get(this);\n const didClose = triggerClosePopup(this);\n\n if (this.isAwaitingPromise()) {\n // A swal awaiting for a promise (after a click on Confirm or Deny) cannot be dismissed anymore #2335\n if (!resolveValue.isDismissed) {\n handleAwaitingPromise(this);\n swalPromiseResolve(resolveValue);\n }\n } else if (didClose) {\n // Resolve Swal promise\n swalPromiseResolve(resolveValue);\n }\n }\n function isAwaitingPromise() {\n return !!privateProps.awaitingPromise.get(this);\n }\n\n const triggerClosePopup = instance => {\n const popup = getPopup();\n\n if (!popup) {\n return false;\n }\n\n const innerParams = privateProps.innerParams.get(instance);\n\n if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) {\n return false;\n }\n\n removeClass(popup, innerParams.showClass.popup);\n addClass(popup, innerParams.hideClass.popup);\n const backdrop = getContainer();\n removeClass(backdrop, innerParams.showClass.backdrop);\n addClass(backdrop, innerParams.hideClass.backdrop);\n handlePopupAnimation(instance, popup, innerParams);\n return true;\n };\n\n function rejectPromise(error) {\n const rejectPromise = privateMethods.swalPromiseReject.get(this);\n handleAwaitingPromise(this);\n\n if (rejectPromise) {\n // Reject Swal promise\n rejectPromise(error);\n }\n }\n const handleAwaitingPromise = instance => {\n if (instance.isAwaitingPromise()) {\n privateProps.awaitingPromise.delete(instance); // The instance might have been previously partly destroyed, we must resume the destroy process in this case #2335\n\n if (!privateProps.innerParams.get(instance)) {\n instance._destroy();\n }\n }\n };\n\n const prepareResolveValue = resolveValue => {\n // When user calls Swal.close()\n if (typeof resolveValue === 'undefined') {\n return {\n isConfirmed: false,\n isDenied: false,\n isDismissed: true\n };\n }\n\n return Object.assign({\n isConfirmed: false,\n isDenied: false,\n isDismissed: false\n }, resolveValue);\n };\n\n const handlePopupAnimation = (instance, popup, innerParams) => {\n const container = getContainer(); // If animation is supported, animate\n\n const animationIsSupported = animationEndEvent && hasCssAnimation(popup);\n\n if (typeof innerParams.willClose === 'function') {\n innerParams.willClose(popup);\n }\n\n if (animationIsSupported) {\n animatePopup(instance, popup, container, innerParams.returnFocus, innerParams.didClose);\n } else {\n // Otherwise, remove immediately\n removePopupAndResetState(instance, container, innerParams.returnFocus, innerParams.didClose);\n }\n };\n\n const animatePopup = (instance, popup, container, returnFocus, didClose) => {\n globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, returnFocus, didClose);\n popup.addEventListener(animationEndEvent, function (e) {\n if (e.target === popup) {\n globalState.swalCloseEventFinishedCallback();\n delete globalState.swalCloseEventFinishedCallback;\n }\n });\n };\n\n const triggerDidCloseAndDispose = (instance, didClose) => {\n setTimeout(() => {\n if (typeof didClose === 'function') {\n didClose.bind(instance.params)();\n }\n\n instance._destroy();\n });\n };\n\n function setButtonsDisabled(instance, buttons, disabled) {\n const domCache = privateProps.domCache.get(instance);\n buttons.forEach(button => {\n domCache[button].disabled = disabled;\n });\n }\n\n function setInputDisabled(input, disabled) {\n if (!input) {\n return false;\n }\n\n if (input.type === 'radio') {\n const radiosContainer = input.parentNode.parentNode;\n const radios = radiosContainer.querySelectorAll('input');\n\n for (let i = 0; i < radios.length; i++) {\n radios[i].disabled = disabled;\n }\n } else {\n input.disabled = disabled;\n }\n }\n\n function enableButtons() {\n setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], false);\n }\n function disableButtons() {\n setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], true);\n }\n function enableInput() {\n return setInputDisabled(this.getInput(), false);\n }\n function disableInput() {\n return setInputDisabled(this.getInput(), true);\n }\n\n function showValidationMessage(error) {\n const domCache = privateProps.domCache.get(this);\n const params = privateProps.innerParams.get(this);\n setInnerHtml(domCache.validationMessage, error);\n domCache.validationMessage.className = swalClasses['validation-message'];\n\n if (params.customClass && params.customClass.validationMessage) {\n addClass(domCache.validationMessage, params.customClass.validationMessage);\n }\n\n show(domCache.validationMessage);\n const input = this.getInput();\n\n if (input) {\n input.setAttribute('aria-invalid', true);\n input.setAttribute('aria-describedby', swalClasses['validation-message']);\n focusInput(input);\n addClass(input, swalClasses.inputerror);\n }\n } // Hide block with validation message\n\n function resetValidationMessage$1() {\n const domCache = privateProps.domCache.get(this);\n\n if (domCache.validationMessage) {\n hide(domCache.validationMessage);\n }\n\n const input = this.getInput();\n\n if (input) {\n input.removeAttribute('aria-invalid');\n input.removeAttribute('aria-describedby');\n removeClass(input, swalClasses.inputerror);\n }\n }\n\n function getProgressSteps$1() {\n const domCache = privateProps.domCache.get(this);\n return domCache.progressSteps;\n }\n\n /**\n * Updates popup parameters.\n */\n\n function update(params) {\n const popup = getPopup();\n const innerParams = privateProps.innerParams.get(this);\n\n if (!popup || hasClass(popup, innerParams.hideClass.popup)) {\n return warn(\"You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.\");\n }\n\n const validUpdatableParams = filterValidParams(params);\n const updatedParams = Object.assign({}, innerParams, validUpdatableParams);\n render(this, updatedParams);\n privateProps.innerParams.set(this, updatedParams);\n Object.defineProperties(this, {\n params: {\n value: Object.assign({}, this.params, params),\n writable: false,\n enumerable: true\n }\n });\n }\n\n const filterValidParams = params => {\n const validUpdatableParams = {};\n Object.keys(params).forEach(param => {\n if (isUpdatableParameter(param)) {\n validUpdatableParams[param] = params[param];\n } else {\n warn(\"Invalid parameter to update: \\\"\".concat(param, \"\\\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\\n\\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md\"));\n }\n });\n return validUpdatableParams;\n };\n\n function _destroy() {\n const domCache = privateProps.domCache.get(this);\n const innerParams = privateProps.innerParams.get(this);\n\n if (!innerParams) {\n disposeWeakMaps(this); // The WeakMaps might have been partly destroyed, we must recall it to dispose any remaining WeakMaps #2335\n\n return; // This instance has already been destroyed\n } // Check if there is another Swal closing\n\n\n if (domCache.popup && globalState.swalCloseEventFinishedCallback) {\n globalState.swalCloseEventFinishedCallback();\n delete globalState.swalCloseEventFinishedCallback;\n } // Check if there is a swal disposal defer timer\n\n\n if (globalState.deferDisposalTimer) {\n clearTimeout(globalState.deferDisposalTimer);\n delete globalState.deferDisposalTimer;\n }\n\n if (typeof innerParams.didDestroy === 'function') {\n innerParams.didDestroy();\n }\n\n disposeSwal(this);\n }\n\n const disposeSwal = instance => {\n disposeWeakMaps(instance); // Unset this.params so GC will dispose it (#1569)\n\n delete instance.params; // Unset globalState props so GC will dispose globalState (#1569)\n\n delete globalState.keydownHandler;\n delete globalState.keydownTarget; // Unset currentInstance\n\n delete globalState.currentInstance;\n };\n\n const disposeWeakMaps = instance => {\n // If the current instance is awaiting a promise result, we keep the privateMethods to call them once the promise result is retrieved #2335\n if (instance.isAwaitingPromise()) {\n unsetWeakMaps(privateProps, instance);\n privateProps.awaitingPromise.set(instance, true);\n } else {\n unsetWeakMaps(privateMethods, instance);\n unsetWeakMaps(privateProps, instance);\n }\n };\n\n const unsetWeakMaps = (obj, instance) => {\n for (const i in obj) {\n obj[i].delete(instance);\n }\n };\n\n\n\n var instanceMethods = /*#__PURE__*/Object.freeze({\n hideLoading: hideLoading,\n disableLoading: hideLoading,\n getInput: getInput$1,\n close: close,\n isAwaitingPromise: isAwaitingPromise,\n rejectPromise: rejectPromise,\n handleAwaitingPromise: handleAwaitingPromise,\n closePopup: close,\n closeModal: close,\n closeToast: close,\n enableButtons: enableButtons,\n disableButtons: disableButtons,\n enableInput: enableInput,\n disableInput: disableInput,\n showValidationMessage: showValidationMessage,\n resetValidationMessage: resetValidationMessage$1,\n getProgressSteps: getProgressSteps$1,\n update: update,\n _destroy: _destroy\n });\n\n const handleConfirmButtonClick = instance => {\n const innerParams = privateProps.innerParams.get(instance);\n instance.disableButtons();\n\n if (innerParams.input) {\n handleConfirmOrDenyWithInput(instance, 'confirm');\n } else {\n confirm(instance, true);\n }\n };\n const handleDenyButtonClick = instance => {\n const innerParams = privateProps.innerParams.get(instance);\n instance.disableButtons();\n\n if (innerParams.returnInputValueOnDeny) {\n handleConfirmOrDenyWithInput(instance, 'deny');\n } else {\n deny(instance, false);\n }\n };\n const handleCancelButtonClick = (instance, dismissWith) => {\n instance.disableButtons();\n dismissWith(DismissReason.cancel);\n };\n\n const handleConfirmOrDenyWithInput = (instance, type\n /* 'confirm' | 'deny' */\n ) => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (!innerParams.input) {\n return error(\"The \\\"input\\\" parameter is needed to be set when using returnInputValueOn\".concat(capitalizeFirstLetter(type)));\n }\n\n const inputValue = getInputValue(instance, innerParams);\n\n if (innerParams.inputValidator) {\n handleInputValidator(instance, inputValue, type);\n } else if (!instance.getInput().checkValidity()) {\n instance.enableButtons();\n instance.showValidationMessage(innerParams.validationMessage);\n } else if (type === 'deny') {\n deny(instance, inputValue);\n } else {\n confirm(instance, inputValue);\n }\n };\n\n const handleInputValidator = (instance, inputValue, type\n /* 'confirm' | 'deny' */\n ) => {\n const innerParams = privateProps.innerParams.get(instance);\n instance.disableInput();\n const validationPromise = Promise.resolve().then(() => asPromise(innerParams.inputValidator(inputValue, innerParams.validationMessage)));\n validationPromise.then(validationMessage => {\n instance.enableButtons();\n instance.enableInput();\n\n if (validationMessage) {\n instance.showValidationMessage(validationMessage);\n } else if (type === 'deny') {\n deny(instance, inputValue);\n } else {\n confirm(instance, inputValue);\n }\n });\n };\n\n const deny = (instance, value) => {\n const innerParams = privateProps.innerParams.get(instance || undefined);\n\n if (innerParams.showLoaderOnDeny) {\n showLoading(getDenyButton());\n }\n\n if (innerParams.preDeny) {\n privateProps.awaitingPromise.set(instance || undefined, true); // Flagging the instance as awaiting a promise so it's own promise's reject/resolve methods doesn't get destroyed until the result from this preDeny's promise is received\n\n const preDenyPromise = Promise.resolve().then(() => asPromise(innerParams.preDeny(value, innerParams.validationMessage)));\n preDenyPromise.then(preDenyValue => {\n if (preDenyValue === false) {\n instance.hideLoading();\n handleAwaitingPromise(instance);\n } else {\n instance.closePopup({\n isDenied: true,\n value: typeof preDenyValue === 'undefined' ? value : preDenyValue\n });\n }\n }).catch(error$$1 => rejectWith(instance || undefined, error$$1));\n } else {\n instance.closePopup({\n isDenied: true,\n value\n });\n }\n };\n\n const succeedWith = (instance, value) => {\n instance.closePopup({\n isConfirmed: true,\n value\n });\n };\n\n const rejectWith = (instance, error$$1) => {\n instance.rejectPromise(error$$1);\n };\n\n const confirm = (instance, value) => {\n const innerParams = privateProps.innerParams.get(instance || undefined);\n\n if (innerParams.showLoaderOnConfirm) {\n showLoading();\n }\n\n if (innerParams.preConfirm) {\n instance.resetValidationMessage();\n privateProps.awaitingPromise.set(instance || undefined, true); // Flagging the instance as awaiting a promise so it's own promise's reject/resolve methods doesn't get destroyed until the result from this preConfirm's promise is received\n\n const preConfirmPromise = Promise.resolve().then(() => asPromise(innerParams.preConfirm(value, innerParams.validationMessage)));\n preConfirmPromise.then(preConfirmValue => {\n if (isVisible(getValidationMessage()) || preConfirmValue === false) {\n instance.hideLoading();\n handleAwaitingPromise(instance);\n } else {\n succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue);\n }\n }).catch(error$$1 => rejectWith(instance || undefined, error$$1));\n } else {\n succeedWith(instance, value);\n }\n };\n\n const handlePopupClick = (instance, domCache, dismissWith) => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (innerParams.toast) {\n handleToastClick(instance, domCache, dismissWith);\n } else {\n // Ignore click events that had mousedown on the popup but mouseup on the container\n // This can happen when the user drags a slider\n handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup\n\n handleContainerMousedown(domCache);\n handleModalClick(instance, domCache, dismissWith);\n }\n };\n\n const handleToastClick = (instance, domCache, dismissWith) => {\n // Closing toast by internal click\n domCache.popup.onclick = () => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (innerParams && (isAnyButtonShown(innerParams) || innerParams.timer || innerParams.input)) {\n return;\n }\n\n dismissWith(DismissReason.close);\n };\n };\n /**\n * @param {*} innerParams\n * @returns {boolean}\n */\n\n\n const isAnyButtonShown = innerParams => {\n return innerParams.showConfirmButton || innerParams.showDenyButton || innerParams.showCancelButton || innerParams.showCloseButton;\n };\n\n let ignoreOutsideClick = false;\n\n const handleModalMousedown = domCache => {\n domCache.popup.onmousedown = () => {\n domCache.container.onmouseup = function (e) {\n domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't\n // have any other direct children aside of the popup\n\n if (e.target === domCache.container) {\n ignoreOutsideClick = true;\n }\n };\n };\n };\n\n const handleContainerMousedown = domCache => {\n domCache.container.onmousedown = () => {\n domCache.popup.onmouseup = function (e) {\n domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup\n\n if (e.target === domCache.popup || domCache.popup.contains(e.target)) {\n ignoreOutsideClick = true;\n }\n };\n };\n };\n\n const handleModalClick = (instance, domCache, dismissWith) => {\n domCache.container.onclick = e => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (ignoreOutsideClick) {\n ignoreOutsideClick = false;\n return;\n }\n\n if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) {\n dismissWith(DismissReason.backdrop);\n }\n };\n };\n\n const isJqueryElement = elem => typeof elem === 'object' && elem.jquery;\n\n const isElement = elem => elem instanceof Element || isJqueryElement(elem);\n\n const argsToParams = args => {\n const params = {};\n\n if (typeof args[0] === 'object' && !isElement(args[0])) {\n Object.assign(params, args[0]);\n } else {\n ['title', 'html', 'icon'].forEach((name, index) => {\n const arg = args[index];\n\n if (typeof arg === 'string' || isElement(arg)) {\n params[name] = arg;\n } else if (arg !== undefined) {\n error(\"Unexpected type of \".concat(name, \"! Expected \\\"string\\\" or \\\"Element\\\", got \").concat(typeof arg));\n }\n });\n }\n\n return params;\n };\n\n function fire() {\n const Swal = this; // eslint-disable-line @typescript-eslint/no-this-alias\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return new Swal(...args);\n }\n\n /**\n * Returns an extended version of `Swal` containing `params` as defaults.\n * Useful for reusing Swal configuration.\n *\n * For example:\n *\n * Before:\n * const textPromptOptions = { input: 'text', showCancelButton: true }\n * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' })\n * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' })\n *\n * After:\n * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true })\n * const {value: firstName} = await TextPrompt('What is your first name?')\n * const {value: lastName} = await TextPrompt('What is your last name?')\n *\n * @param mixinParams\n */\n function mixin(mixinParams) {\n class MixinSwal extends this {\n _main(params, priorityMixinParams) {\n return super._main(params, Object.assign({}, mixinParams, priorityMixinParams));\n }\n\n }\n\n return MixinSwal;\n }\n\n /**\n * If `timer` parameter is set, returns number of milliseconds of timer remained.\n * Otherwise, returns undefined.\n */\n\n const getTimerLeft = () => {\n return globalState.timeout && globalState.timeout.getTimerLeft();\n };\n /**\n * Stop timer. Returns number of milliseconds of timer remained.\n * If `timer` parameter isn't set, returns undefined.\n */\n\n const stopTimer = () => {\n if (globalState.timeout) {\n stopTimerProgressBar();\n return globalState.timeout.stop();\n }\n };\n /**\n * Resume timer. Returns number of milliseconds of timer remained.\n * If `timer` parameter isn't set, returns undefined.\n */\n\n const resumeTimer = () => {\n if (globalState.timeout) {\n const remaining = globalState.timeout.start();\n animateTimerProgressBar(remaining);\n return remaining;\n }\n };\n /**\n * Resume timer. Returns number of milliseconds of timer remained.\n * If `timer` parameter isn't set, returns undefined.\n */\n\n const toggleTimer = () => {\n const timer = globalState.timeout;\n return timer && (timer.running ? stopTimer() : resumeTimer());\n };\n /**\n * Increase timer. Returns number of milliseconds of an updated timer.\n * If `timer` parameter isn't set, returns undefined.\n */\n\n const increaseTimer = n => {\n if (globalState.timeout) {\n const remaining = globalState.timeout.increase(n);\n animateTimerProgressBar(remaining, true);\n return remaining;\n }\n };\n /**\n * Check if timer is running. Returns true if timer is running\n * or false if timer is paused or stopped.\n * If `timer` parameter isn't set, returns undefined\n */\n\n const isTimerRunning = () => {\n return globalState.timeout && globalState.timeout.isRunning();\n };\n\n let bodyClickListenerAdded = false;\n const clickHandlers = {};\n function bindClickHandler() {\n let attr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'data-swal-template';\n clickHandlers[attr] = this;\n\n if (!bodyClickListenerAdded) {\n document.body.addEventListener('click', bodyClickListener);\n bodyClickListenerAdded = true;\n }\n }\n\n const bodyClickListener = event => {\n for (let el = event.target; el && el !== document; el = el.parentNode) {\n for (const attr in clickHandlers) {\n const template = el.getAttribute(attr);\n\n if (template) {\n clickHandlers[attr].fire({\n template\n });\n return;\n }\n }\n }\n };\n\n\n\n var staticMethods = /*#__PURE__*/Object.freeze({\n isValidParameter: isValidParameter,\n isUpdatableParameter: isUpdatableParameter,\n isDeprecatedParameter: isDeprecatedParameter,\n argsToParams: argsToParams,\n isVisible: isVisible$1,\n clickConfirm: clickConfirm,\n clickDeny: clickDeny,\n clickCancel: clickCancel,\n getContainer: getContainer,\n getPopup: getPopup,\n getTitle: getTitle,\n getHtmlContainer: getHtmlContainer,\n getImage: getImage,\n getIcon: getIcon,\n getInputLabel: getInputLabel,\n getCloseButton: getCloseButton,\n getActions: getActions,\n getConfirmButton: getConfirmButton,\n getDenyButton: getDenyButton,\n getCancelButton: getCancelButton,\n getLoader: getLoader,\n getFooter: getFooter,\n getTimerProgressBar: getTimerProgressBar,\n getFocusableElements: getFocusableElements,\n getValidationMessage: getValidationMessage,\n isLoading: isLoading,\n fire: fire,\n mixin: mixin,\n showLoading: showLoading,\n enableLoading: showLoading,\n getTimerLeft: getTimerLeft,\n stopTimer: stopTimer,\n resumeTimer: resumeTimer,\n toggleTimer: toggleTimer,\n increaseTimer: increaseTimer,\n isTimerRunning: isTimerRunning,\n bindClickHandler: bindClickHandler\n });\n\n let currentInstance;\n\n class SweetAlert {\n constructor() {\n // Prevent run in Node env\n if (typeof window === 'undefined') {\n return;\n }\n\n currentInstance = this; // @ts-ignore\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n const outerParams = Object.freeze(this.constructor.argsToParams(args));\n Object.defineProperties(this, {\n params: {\n value: outerParams,\n writable: false,\n enumerable: true,\n configurable: true\n }\n }); // @ts-ignore\n\n const promise = this._main(this.params);\n\n privateProps.promise.set(this, promise);\n }\n\n _main(userParams) {\n let mixinParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n showWarningsForParams(Object.assign({}, mixinParams, userParams));\n\n if (globalState.currentInstance) {\n globalState.currentInstance._destroy();\n\n if (isModal()) {\n unsetAriaHidden();\n }\n }\n\n globalState.currentInstance = this;\n const innerParams = prepareParams(userParams, mixinParams);\n setParameters(innerParams);\n Object.freeze(innerParams); // clear the previous timer\n\n if (globalState.timeout) {\n globalState.timeout.stop();\n delete globalState.timeout;\n } // clear the restore focus timeout\n\n\n clearTimeout(globalState.restoreFocusTimeout);\n const domCache = populateDomCache(this);\n render(this, innerParams);\n privateProps.innerParams.set(this, innerParams);\n return swalPromise(this, domCache, innerParams);\n } // `catch` cannot be the name of a module export, so we define our thenable methods here instead\n\n\n then(onFulfilled) {\n const promise = privateProps.promise.get(this);\n return promise.then(onFulfilled);\n }\n\n finally(onFinally) {\n const promise = privateProps.promise.get(this);\n return promise.finally(onFinally);\n }\n\n }\n\n const swalPromise = (instance, domCache, innerParams) => {\n return new Promise((resolve, reject) => {\n // functions to handle all closings/dismissals\n const dismissWith = dismiss => {\n instance.closePopup({\n isDismissed: true,\n dismiss\n });\n };\n\n privateMethods.swalPromiseResolve.set(instance, resolve);\n privateMethods.swalPromiseReject.set(instance, reject);\n\n domCache.confirmButton.onclick = () => handleConfirmButtonClick(instance);\n\n domCache.denyButton.onclick = () => handleDenyButtonClick(instance);\n\n domCache.cancelButton.onclick = () => handleCancelButtonClick(instance, dismissWith);\n\n domCache.closeButton.onclick = () => dismissWith(DismissReason.close);\n\n handlePopupClick(instance, domCache, dismissWith);\n addKeydownHandler(instance, globalState, innerParams, dismissWith);\n handleInputOptionsAndValue(instance, innerParams);\n openPopup(innerParams);\n setupTimer(globalState, innerParams, dismissWith);\n initFocus(domCache, innerParams); // Scroll container to top on open (#1247, #1946)\n\n setTimeout(() => {\n domCache.container.scrollTop = 0;\n });\n });\n };\n\n const prepareParams = (userParams, mixinParams) => {\n const templateParams = getTemplateParams(userParams);\n const params = Object.assign({}, defaultParams, mixinParams, templateParams, userParams); // precedence is described in #2131\n\n params.showClass = Object.assign({}, defaultParams.showClass, params.showClass);\n params.hideClass = Object.assign({}, defaultParams.hideClass, params.hideClass);\n return params;\n };\n\n const populateDomCache = instance => {\n const domCache = {\n popup: getPopup(),\n container: getContainer(),\n actions: getActions(),\n confirmButton: getConfirmButton(),\n denyButton: getDenyButton(),\n cancelButton: getCancelButton(),\n loader: getLoader(),\n closeButton: getCloseButton(),\n validationMessage: getValidationMessage(),\n progressSteps: getProgressSteps()\n };\n privateProps.domCache.set(instance, domCache);\n return domCache;\n };\n\n const setupTimer = (globalState$$1, innerParams, dismissWith) => {\n const timerProgressBar = getTimerProgressBar();\n hide(timerProgressBar);\n\n if (innerParams.timer) {\n globalState$$1.timeout = new Timer(() => {\n dismissWith('timer');\n delete globalState$$1.timeout;\n }, innerParams.timer);\n\n if (innerParams.timerProgressBar) {\n show(timerProgressBar);\n applyCustomClass(timerProgressBar, innerParams, 'timerProgressBar');\n setTimeout(() => {\n if (globalState$$1.timeout && globalState$$1.timeout.running) {\n // timer can be already stopped or unset at this point\n animateTimerProgressBar(innerParams.timer);\n }\n });\n }\n }\n };\n\n const initFocus = (domCache, innerParams) => {\n if (innerParams.toast) {\n return;\n }\n\n if (!callIfFunction(innerParams.allowEnterKey)) {\n return blurActiveElement();\n }\n\n if (!focusButton(domCache, innerParams)) {\n setFocus(innerParams, -1, 1);\n }\n };\n\n const focusButton = (domCache, innerParams) => {\n if (innerParams.focusDeny && isVisible(domCache.denyButton)) {\n domCache.denyButton.focus();\n return true;\n }\n\n if (innerParams.focusCancel && isVisible(domCache.cancelButton)) {\n domCache.cancelButton.focus();\n return true;\n }\n\n if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) {\n domCache.confirmButton.focus();\n return true;\n }\n\n return false;\n };\n\n const blurActiveElement = () => {\n if (document.activeElement instanceof HTMLElement && typeof document.activeElement.blur === 'function') {\n document.activeElement.blur();\n }\n }; // Assign instance methods from src/instanceMethods/*.js to prototype\n\n\n Object.assign(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor\n\n Object.assign(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility\n\n Object.keys(instanceMethods).forEach(key => {\n SweetAlert[key] = function () {\n if (currentInstance) {\n return currentInstance[key](...arguments);\n }\n };\n });\n SweetAlert.DismissReason = DismissReason;\n SweetAlert.version = '11.4.8';\n\n const Swal = SweetAlert; // @ts-ignore\n\n Swal.default = Swal;\n\n return Swal;\n\n}));\nif (typeof this !== 'undefined' && this.Sweetalert2){ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2}\n\n\"undefined\"!=typeof document&&function(e,t){var n=e.createElement(\"style\");if(e.getElementsByTagName(\"head\")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,\".swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:\\\"top-start top top-end\\\" \\\"center-start center center-end\\\" \\\"bottom-start bottom-center bottom-end\\\";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:\\\"!\\\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}\");", "/*! PhotoSwipe - v4.1.3 - 2019-01-08\n* http://photoswipe.com\n* Copyright (c) 2019 Dmitry Semenov; */\n(function (root, factory) { \n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t} else if (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\troot.PhotoSwipe = factory();\n\t}\n})(this, function () {\n\n\t'use strict';\n\tvar PhotoSwipe = function(template, UiClass, items, options){\n\n/*>>framework-bridge*/\n/**\n *\n * Set of generic functions used by gallery.\n * \n * You're free to modify anything here as long as functionality is kept.\n * \n */\nvar framework = {\n\tfeatures: null,\n\tbind: function(target, type, listener, unbind) {\n\t\tvar methodName = (unbind ? 'remove' : 'add') + 'EventListener';\n\t\ttype = type.split(' ');\n\t\tfor(var i = 0; i < type.length; i++) {\n\t\t\tif(type[i]) {\n\t\t\t\ttarget[methodName]( type[i], listener, false);\n\t\t\t}\n\t\t}\n\t},\n\tisArray: function(obj) {\n\t\treturn (obj instanceof Array);\n\t},\n\tcreateEl: function(classes, tag) {\n\t\tvar el = document.createElement(tag || 'div');\n\t\tif(classes) {\n\t\t\tel.className = classes;\n\t\t}\n\t\treturn el;\n\t},\n\tgetScrollY: function() {\n\t\tvar yOffset = window.pageYOffset;\n\t\treturn yOffset !== undefined ? yOffset : document.documentElement.scrollTop;\n\t},\n\tunbind: function(target, type, listener) {\n\t\tframework.bind(target,type,listener,true);\n\t},\n\tremoveClass: function(el, className) {\n\t\tvar reg = new RegExp('(\\\\s|^)' + className + '(\\\\s|$)');\n\t\tel.className = el.className.replace(reg, ' ').replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, ''); \n\t},\n\taddClass: function(el, className) {\n\t\tif( !framework.hasClass(el,className) ) {\n\t\t\tel.className += (el.className ? ' ' : '') + className;\n\t\t}\n\t},\n\thasClass: function(el, className) {\n\t\treturn el.className && new RegExp('(^|\\\\s)' + className + '(\\\\s|$)').test(el.className);\n\t},\n\tgetChildByClass: function(parentEl, childClassName) {\n\t\tvar node = parentEl.firstChild;\n\t\twhile(node) {\n\t\t\tif( framework.hasClass(node, childClassName) ) {\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\tnode = node.nextSibling;\n\t\t}\n\t},\n\tarraySearch: function(array, value, key) {\n\t\tvar i = array.length;\n\t\twhile(i--) {\n\t\t\tif(array[i][key] === value) {\n\t\t\t\treturn i;\n\t\t\t} \n\t\t}\n\t\treturn -1;\n\t},\n\textend: function(o1, o2, preventOverwrite) {\n\t\tfor (var prop in o2) {\n\t\t\tif (o2.hasOwnProperty(prop)) {\n\t\t\t\tif(preventOverwrite && o1.hasOwnProperty(prop)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\to1[prop] = o2[prop];\n\t\t\t}\n\t\t}\n\t},\n\teasing: {\n\t\tsine: {\n\t\t\tout: function(k) {\n\t\t\t\treturn Math.sin(k * (Math.PI / 2));\n\t\t\t},\n\t\t\tinOut: function(k) {\n\t\t\t\treturn - (Math.cos(Math.PI * k) - 1) / 2;\n\t\t\t}\n\t\t},\n\t\tcubic: {\n\t\t\tout: function(k) {\n\t\t\t\treturn --k * k * k + 1;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t\telastic: {\n\t\t\t\tout: function ( k ) {\n\n\t\t\t\t\tvar s, a = 0.1, p = 0.4;\n\t\t\t\t\tif ( k === 0 ) return 0;\n\t\t\t\t\tif ( k === 1 ) return 1;\n\t\t\t\t\tif ( !a || a < 1 ) { a = 1; s = p / 4; }\n\t\t\t\t\telse s = p * Math.asin( 1 / a ) / ( 2 * Math.PI );\n\t\t\t\t\treturn ( a * Math.pow( 2, - 10 * k) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) + 1 );\n\n\t\t\t\t},\n\t\t\t},\n\t\t\tback: {\n\t\t\t\tout: function ( k ) {\n\t\t\t\t\tvar s = 1.70158;\n\t\t\t\t\treturn --k * k * ( ( s + 1 ) * k + s ) + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t*/\n\t},\n\n\t/**\n\t * \n\t * @return {object}\n\t * \n\t * {\n\t * raf : request animation frame function\n\t * caf : cancel animation frame function\n\t * transfrom : transform property key (with vendor), or null if not supported\n\t * oldIE : IE8 or below\n\t * }\n\t * \n\t */\n\tdetectFeatures: function() {\n\t\tif(framework.features) {\n\t\t\treturn framework.features;\n\t\t}\n\t\tvar helperEl = framework.createEl(),\n\t\t\thelperStyle = helperEl.style,\n\t\t\tvendor = '',\n\t\t\tfeatures = {};\n\n\t\t// IE8 and below\n\t\tfeatures.oldIE = document.all && !document.addEventListener;\n\n\t\tfeatures.touch = 'ontouchstart' in window;\n\n\t\tif(window.requestAnimationFrame) {\n\t\t\tfeatures.raf = window.requestAnimationFrame;\n\t\t\tfeatures.caf = window.cancelAnimationFrame;\n\t\t}\n\n\t\tfeatures.pointerEvent = !!(window.PointerEvent) || navigator.msPointerEnabled;\n\n\t\t// fix false-positive detection of old Android in new IE\n\t\t// (IE11 ua string contains \"Android 4.0\")\n\t\t\n\t\tif(!features.pointerEvent) { \n\n\t\t\tvar ua = navigator.userAgent;\n\n\t\t\t// Detect if device is iPhone or iPod and if it's older than iOS 8\n\t\t\t// http://stackoverflow.com/a/14223920\n\t\t\t// \n\t\t\t// This detection is made because of buggy top/bottom toolbars\n\t\t\t// that don't trigger window.resize event.\n\t\t\t// For more info refer to _isFixedPosition variable in core.js\n\n\t\t\tif (/iP(hone|od)/.test(navigator.platform)) {\n\t\t\t\tvar v = (navigator.appVersion).match(/OS (\\d+)_(\\d+)_?(\\d+)?/);\n\t\t\t\tif(v && v.length > 0) {\n\t\t\t\t\tv = parseInt(v[1], 10);\n\t\t\t\t\tif(v >= 1 && v < 8 ) {\n\t\t\t\t\t\tfeatures.isOldIOSPhone = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Detect old Android (before KitKat)\n\t\t\t// due to bugs related to position:fixed\n\t\t\t// http://stackoverflow.com/questions/7184573/pick-up-the-android-version-in-the-browser-by-javascript\n\t\t\t\n\t\t\tvar match = ua.match(/Android\\s([0-9\\.]*)/);\n\t\t\tvar androidversion = match ? match[1] : 0;\n\t\t\tandroidversion = parseFloat(androidversion);\n\t\t\tif(androidversion >= 1 ) {\n\t\t\t\tif(androidversion < 4.4) {\n\t\t\t\t\tfeatures.isOldAndroid = true; // for fixed position bug & performance\n\t\t\t\t}\n\t\t\t\tfeatures.androidVersion = androidversion; // for touchend bug\n\t\t\t}\t\n\t\t\tfeatures.isMobileOpera = /opera mini|opera mobi/i.test(ua);\n\n\t\t\t// p.s. yes, yes, UA sniffing is bad, propose your solution for above bugs.\n\t\t}\n\t\t\n\t\tvar styleChecks = ['transform', 'perspective', 'animationName'],\n\t\t\tvendors = ['', 'webkit','Moz','ms','O'],\n\t\t\tstyleCheckItem,\n\t\t\tstyleName;\n\n\t\tfor(var i = 0; i < 4; i++) {\n\t\t\tvendor = vendors[i];\n\n\t\t\tfor(var a = 0; a < 3; a++) {\n\t\t\t\tstyleCheckItem = styleChecks[a];\n\n\t\t\t\t// uppercase first letter of property name, if vendor is present\n\t\t\t\tstyleName = vendor + (vendor ? \n\t\t\t\t\t\t\t\t\t\tstyleCheckItem.charAt(0).toUpperCase() + styleCheckItem.slice(1) : \n\t\t\t\t\t\t\t\t\t\tstyleCheckItem);\n\t\t\t\n\t\t\t\tif(!features[styleCheckItem] && styleName in helperStyle ) {\n\t\t\t\t\tfeatures[styleCheckItem] = styleName;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(vendor && !features.raf) {\n\t\t\t\tvendor = vendor.toLowerCase();\n\t\t\t\tfeatures.raf = window[vendor+'RequestAnimationFrame'];\n\t\t\t\tif(features.raf) {\n\t\t\t\t\tfeatures.caf = window[vendor+'CancelAnimationFrame'] || \n\t\t\t\t\t\t\t\t\twindow[vendor+'CancelRequestAnimationFrame'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif(!features.raf) {\n\t\t\tvar lastTime = 0;\n\t\t\tfeatures.raf = function(fn) {\n\t\t\t\tvar currTime = new Date().getTime();\n\t\t\t\tvar timeToCall = Math.max(0, 16 - (currTime - lastTime));\n\t\t\t\tvar id = window.setTimeout(function() { fn(currTime + timeToCall); }, timeToCall);\n\t\t\t\tlastTime = currTime + timeToCall;\n\t\t\t\treturn id;\n\t\t\t};\n\t\t\tfeatures.caf = function(id) { clearTimeout(id); };\n\t\t}\n\n\t\t// Detect SVG support\n\t\tfeatures.svg = !!document.createElementNS && \n\t\t\t\t\t\t!!document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect;\n\n\t\tframework.features = features;\n\n\t\treturn features;\n\t}\n};\n\nframework.detectFeatures();\n\n// Override addEventListener for old versions of IE\nif(framework.features.oldIE) {\n\n\tframework.bind = function(target, type, listener, unbind) {\n\t\t\n\t\ttype = type.split(' ');\n\n\t\tvar methodName = (unbind ? 'detach' : 'attach') + 'Event',\n\t\t\tevName,\n\t\t\t_handleEv = function() {\n\t\t\t\tlistener.handleEvent.call(listener);\n\t\t\t};\n\n\t\tfor(var i = 0; i < type.length; i++) {\n\t\t\tevName = type[i];\n\t\t\tif(evName) {\n\n\t\t\t\tif(typeof listener === 'object' && listener.handleEvent) {\n\t\t\t\t\tif(!unbind) {\n\t\t\t\t\t\tlistener['oldIE' + evName] = _handleEv;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(!listener['oldIE' + evName]) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttarget[methodName]( 'on' + evName, listener['oldIE' + evName]);\n\t\t\t\t} else {\n\t\t\t\t\ttarget[methodName]( 'on' + evName, listener);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t};\n\t\n}\n\n/*>>framework-bridge*/\n\n/*>>core*/\n//function(template, UiClass, items, options)\n\nvar self = this;\n\n/**\n * Static vars, don't change unless you know what you're doing.\n */\nvar DOUBLE_TAP_RADIUS = 25, \n\tNUM_HOLDERS = 3;\n\n/**\n * Options\n */\nvar _options = {\n\tallowPanToNext:true,\n\tspacing: 0.12,\n\tbgOpacity: 1,\n\tmouseUsed: false,\n\tloop: true,\n\tpinchToClose: true,\n\tcloseOnScroll: true,\n\tcloseOnVerticalDrag: true,\n\tverticalDragRange: 0.75,\n\thideAnimationDuration: 333,\n\tshowAnimationDuration: 333,\n\tshowHideOpacity: false,\n\tfocus: true,\n\tescKey: true,\n\tarrowKeys: true,\n\tmainScrollEndFriction: 0.35,\n\tpanEndFriction: 0.35,\n\tisClickableElement: function(el) {\n return el.tagName === 'A';\n },\n getDoubleTapZoom: function(isMouseClick, item) {\n \tif(isMouseClick) {\n \t\treturn 1;\n \t} else {\n \t\treturn item.initialZoomLevel < 0.7 ? 1 : 1.33;\n \t}\n },\n maxSpreadZoom: 1.33,\n\tmodal: true,\n\n\t// not fully implemented yet\n\tscaleMode: 'fit' // TODO\n};\nframework.extend(_options, options);\n\n\n/**\n * Private helper variables & functions\n */\n\nvar _getEmptyPoint = function() { \n\t\treturn {x:0,y:0}; \n\t};\n\nvar _isOpen,\n\t_isDestroying,\n\t_closedByScroll,\n\t_currentItemIndex,\n\t_containerStyle,\n\t_containerShiftIndex,\n\t_currPanDist = _getEmptyPoint(),\n\t_startPanOffset = _getEmptyPoint(),\n\t_panOffset = _getEmptyPoint(),\n\t_upMoveEvents, // drag move, drag end & drag cancel events array\n\t_downEvents, // drag start events array\n\t_globalEventHandlers,\n\t_viewportSize = {},\n\t_currZoomLevel,\n\t_startZoomLevel,\n\t_translatePrefix,\n\t_translateSufix,\n\t_updateSizeInterval,\n\t_itemsNeedUpdate,\n\t_currPositionIndex = 0,\n\t_offset = {},\n\t_slideSize = _getEmptyPoint(), // size of slide area, including spacing\n\t_itemHolders,\n\t_prevItemIndex,\n\t_indexDiff = 0, // difference of indexes since last content update\n\t_dragStartEvent,\n\t_dragMoveEvent,\n\t_dragEndEvent,\n\t_dragCancelEvent,\n\t_transformKey,\n\t_pointerEventEnabled,\n\t_isFixedPosition = true,\n\t_likelyTouchDevice,\n\t_modules = [],\n\t_requestAF,\n\t_cancelAF,\n\t_initalClassName,\n\t_initalWindowScrollY,\n\t_oldIE,\n\t_currentWindowScrollY,\n\t_features,\n\t_windowVisibleSize = {},\n\t_renderMaxResolution = false,\n\t_orientationChangeTimeout,\n\n\n\t// Registers PhotoSWipe module (History, Controller ...)\n\t_registerModule = function(name, module) {\n\t\tframework.extend(self, module.publicMethods);\n\t\t_modules.push(name);\n\t},\n\n\t_getLoopedId = function(index) {\n\t\tvar numSlides = _getNumItems();\n\t\tif(index > numSlides - 1) {\n\t\t\treturn index - numSlides;\n\t\t} else if(index < 0) {\n\t\t\treturn numSlides + index;\n\t\t}\n\t\treturn index;\n\t},\n\t\n\t// Micro bind/trigger\n\t_listeners = {},\n\t_listen = function(name, fn) {\n\t\tif(!_listeners[name]) {\n\t\t\t_listeners[name] = [];\n\t\t}\n\t\treturn _listeners[name].push(fn);\n\t},\n\t_shout = function(name) {\n\t\tvar listeners = _listeners[name];\n\n\t\tif(listeners) {\n\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\targs.shift();\n\n\t\t\tfor(var i = 0; i < listeners.length; i++) {\n\t\t\t\tlisteners[i].apply(self, args);\n\t\t\t}\n\t\t}\n\t},\n\n\t_getCurrentTime = function() {\n\t\treturn new Date().getTime();\n\t},\n\t_applyBgOpacity = function(opacity) {\n\t\t_bgOpacity = opacity;\n\t\tself.bg.style.opacity = opacity * _options.bgOpacity;\n\t},\n\n\t_applyZoomTransform = function(styleObj,x,y,zoom,item) {\n\t\tif(!_renderMaxResolution || (item && item !== self.currItem) ) {\n\t\t\tzoom = zoom / (item ? item.fitRatio : self.currItem.fitRatio);\t\n\t\t}\n\t\t\t\n\t\tstyleObj[_transformKey] = _translatePrefix + x + 'px, ' + y + 'px' + _translateSufix + ' scale(' + zoom + ')';\n\t},\n\t_applyCurrentZoomPan = function( allowRenderResolution ) {\n\t\tif(_currZoomElementStyle) {\n\n\t\t\tif(allowRenderResolution) {\n\t\t\t\tif(_currZoomLevel > self.currItem.fitRatio) {\n\t\t\t\t\tif(!_renderMaxResolution) {\n\t\t\t\t\t\t_setImageSize(self.currItem, false, true);\n\t\t\t\t\t\t_renderMaxResolution = true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif(_renderMaxResolution) {\n\t\t\t\t\t\t_setImageSize(self.currItem);\n\t\t\t\t\t\t_renderMaxResolution = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\t\t\t_applyZoomTransform(_currZoomElementStyle, _panOffset.x, _panOffset.y, _currZoomLevel);\n\t\t}\n\t},\n\t_applyZoomPanToItem = function(item) {\n\t\tif(item.container) {\n\n\t\t\t_applyZoomTransform(item.container.style, \n\t\t\t\t\t\t\t\titem.initialPosition.x, \n\t\t\t\t\t\t\t\titem.initialPosition.y, \n\t\t\t\t\t\t\t\titem.initialZoomLevel,\n\t\t\t\t\t\t\t\titem);\n\t\t}\n\t},\n\t_setTranslateX = function(x, elStyle) {\n\t\telStyle[_transformKey] = _translatePrefix + x + 'px, 0px' + _translateSufix;\n\t},\n\t_moveMainScroll = function(x, dragging) {\n\n\t\tif(!_options.loop && dragging) {\n\t\t\tvar newSlideIndexOffset = _currentItemIndex + (_slideSize.x * _currPositionIndex - x) / _slideSize.x,\n\t\t\t\tdelta = Math.round(x - _mainScrollPos.x);\n\n\t\t\tif( (newSlideIndexOffset < 0 && delta > 0) || \n\t\t\t\t(newSlideIndexOffset >= _getNumItems() - 1 && delta < 0) ) {\n\t\t\t\tx = _mainScrollPos.x + delta * _options.mainScrollEndFriction;\n\t\t\t} \n\t\t}\n\t\t\n\t\t_mainScrollPos.x = x;\n\t\t_setTranslateX(x, _containerStyle);\n\t},\n\t_calculatePanOffset = function(axis, zoomLevel) {\n\t\tvar m = _midZoomPoint[axis] - _offset[axis];\n\t\treturn _startPanOffset[axis] + _currPanDist[axis] + m - m * ( zoomLevel / _startZoomLevel );\n\t},\n\t\n\t_equalizePoints = function(p1, p2) {\n\t\tp1.x = p2.x;\n\t\tp1.y = p2.y;\n\t\tif(p2.id) {\n\t\t\tp1.id = p2.id;\n\t\t}\n\t},\n\t_roundPoint = function(p) {\n\t\tp.x = Math.round(p.x);\n\t\tp.y = Math.round(p.y);\n\t},\n\n\t_mouseMoveTimeout = null,\n\t_onFirstMouseMove = function() {\n\t\t// Wait until mouse move event is fired at least twice during 100ms\n\t\t// We do this, because some mobile browsers trigger it on touchstart\n\t\tif(_mouseMoveTimeout ) { \n\t\t\tframework.unbind(document, 'mousemove', _onFirstMouseMove);\n\t\t\tframework.addClass(template, 'pswp--has_mouse');\n\t\t\t_options.mouseUsed = true;\n\t\t\t_shout('mouseUsed');\n\t\t}\n\t\t_mouseMoveTimeout = setTimeout(function() {\n\t\t\t_mouseMoveTimeout = null;\n\t\t}, 100);\n\t},\n\n\t_bindEvents = function() {\n\t\tframework.bind(document, 'keydown', self);\n\n\t\tif(_features.transform) {\n\t\t\t// don't bind click event in browsers that don't support transform (mostly IE8)\n\t\t\tframework.bind(self.scrollWrap, 'click', self);\n\t\t}\n\t\t\n\n\t\tif(!_options.mouseUsed) {\n\t\t\tframework.bind(document, 'mousemove', _onFirstMouseMove);\n\t\t}\n\n\t\tframework.bind(window, 'resize scroll orientationchange', self);\n\n\t\t_shout('bindEvents');\n\t},\n\n\t_unbindEvents = function() {\n\t\tframework.unbind(window, 'resize scroll orientationchange', self);\n\t\tframework.unbind(window, 'scroll', _globalEventHandlers.scroll);\n\t\tframework.unbind(document, 'keydown', self);\n\t\tframework.unbind(document, 'mousemove', _onFirstMouseMove);\n\n\t\tif(_features.transform) {\n\t\t\tframework.unbind(self.scrollWrap, 'click', self);\n\t\t}\n\n\t\tif(_isDragging) {\n\t\t\tframework.unbind(window, _upMoveEvents, self);\n\t\t}\n\n\t\tclearTimeout(_orientationChangeTimeout);\n\n\t\t_shout('unbindEvents');\n\t},\n\t\n\t_calculatePanBounds = function(zoomLevel, update) {\n\t\tvar bounds = _calculateItemSize( self.currItem, _viewportSize, zoomLevel );\n\t\tif(update) {\n\t\t\t_currPanBounds = bounds;\n\t\t}\n\t\treturn bounds;\n\t},\n\t\n\t_getMinZoomLevel = function(item) {\n\t\tif(!item) {\n\t\t\titem = self.currItem;\n\t\t}\n\t\treturn item.initialZoomLevel;\n\t},\n\t_getMaxZoomLevel = function(item) {\n\t\tif(!item) {\n\t\t\titem = self.currItem;\n\t\t}\n\t\treturn item.w > 0 ? _options.maxSpreadZoom : 1;\n\t},\n\n\t// Return true if offset is out of the bounds\n\t_modifyDestPanOffset = function(axis, destPanBounds, destPanOffset, destZoomLevel) {\n\t\tif(destZoomLevel === self.currItem.initialZoomLevel) {\n\t\t\tdestPanOffset[axis] = self.currItem.initialPosition[axis];\n\t\t\treturn true;\n\t\t} else {\n\t\t\tdestPanOffset[axis] = _calculatePanOffset(axis, destZoomLevel); \n\n\t\t\tif(destPanOffset[axis] > destPanBounds.min[axis]) {\n\t\t\t\tdestPanOffset[axis] = destPanBounds.min[axis];\n\t\t\t\treturn true;\n\t\t\t} else if(destPanOffset[axis] < destPanBounds.max[axis] ) {\n\t\t\t\tdestPanOffset[axis] = destPanBounds.max[axis];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t},\n\n\t_setupTransforms = function() {\n\n\t\tif(_transformKey) {\n\t\t\t// setup 3d transforms\n\t\t\tvar allow3dTransform = _features.perspective && !_likelyTouchDevice;\n\t\t\t_translatePrefix = 'translate' + (allow3dTransform ? '3d(' : '(');\n\t\t\t_translateSufix = _features.perspective ? ', 0px)' : ')';\t\n\t\t\treturn;\n\t\t}\n\n\t\t// Override zoom/pan/move functions in case old browser is used (most likely IE)\n\t\t// (so they use left/top/width/height, instead of CSS transform)\n\t\n\t\t_transformKey = 'left';\n\t\tframework.addClass(template, 'pswp--ie');\n\n\t\t_setTranslateX = function(x, elStyle) {\n\t\t\telStyle.left = x + 'px';\n\t\t};\n\t\t_applyZoomPanToItem = function(item) {\n\n\t\t\tvar zoomRatio = item.fitRatio > 1 ? 1 : item.fitRatio,\n\t\t\t\ts = item.container.style,\n\t\t\t\tw = zoomRatio * item.w,\n\t\t\t\th = zoomRatio * item.h;\n\n\t\t\ts.width = w + 'px';\n\t\t\ts.height = h + 'px';\n\t\t\ts.left = item.initialPosition.x + 'px';\n\t\t\ts.top = item.initialPosition.y + 'px';\n\n\t\t};\n\t\t_applyCurrentZoomPan = function() {\n\t\t\tif(_currZoomElementStyle) {\n\n\t\t\t\tvar s = _currZoomElementStyle,\n\t\t\t\t\titem = self.currItem,\n\t\t\t\t\tzoomRatio = item.fitRatio > 1 ? 1 : item.fitRatio,\n\t\t\t\t\tw = zoomRatio * item.w,\n\t\t\t\t\th = zoomRatio * item.h;\n\n\t\t\t\ts.width = w + 'px';\n\t\t\t\ts.height = h + 'px';\n\n\n\t\t\t\ts.left = _panOffset.x + 'px';\n\t\t\t\ts.top = _panOffset.y + 'px';\n\t\t\t}\n\t\t\t\n\t\t};\n\t},\n\n\t_onKeyDown = function(e) {\n\t\tvar keydownAction = '';\n\t\tif(_options.escKey && e.keyCode === 27) { \n\t\t\tkeydownAction = 'close';\n\t\t} else if(_options.arrowKeys) {\n\t\t\tif(e.keyCode === 37) {\n\t\t\t\tkeydownAction = 'prev';\n\t\t\t} else if(e.keyCode === 39) { \n\t\t\t\tkeydownAction = 'next';\n\t\t\t}\n\t\t}\n\n\t\tif(keydownAction) {\n\t\t\t// don't do anything if special key pressed to prevent from overriding default browser actions\n\t\t\t// e.g. in Chrome on Mac cmd+arrow-left returns to previous page\n\t\t\tif( !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey ) {\n\t\t\t\tif(e.preventDefault) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t} else {\n\t\t\t\t\te.returnValue = false;\n\t\t\t\t} \n\t\t\t\tself[keydownAction]();\n\t\t\t}\n\t\t}\n\t},\n\n\t_onGlobalClick = function(e) {\n\t\tif(!e) {\n\t\t\treturn;\n\t\t}\n\n\t\t// don't allow click event to pass through when triggering after drag or some other gesture\n\t\tif(_moved || _zoomStarted || _mainScrollAnimating || _verticalDragInitiated) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\n\t_updatePageScrollOffset = function() {\n\t\tself.setScrollOffset(0, framework.getScrollY());\t\t\n\t};\n\t\n\n\n\t\n\n\n\n// Micro animation engine\nvar _animations = {},\n\t_numAnimations = 0,\n\t_stopAnimation = function(name) {\n\t\tif(_animations[name]) {\n\t\t\tif(_animations[name].raf) {\n\t\t\t\t_cancelAF( _animations[name].raf );\n\t\t\t}\n\t\t\t_numAnimations--;\n\t\t\tdelete _animations[name];\n\t\t}\n\t},\n\t_registerStartAnimation = function(name) {\n\t\tif(_animations[name]) {\n\t\t\t_stopAnimation(name);\n\t\t}\n\t\tif(!_animations[name]) {\n\t\t\t_numAnimations++;\n\t\t\t_animations[name] = {};\n\t\t}\n\t},\n\t_stopAllAnimations = function() {\n\t\tfor (var prop in _animations) {\n\n\t\t\tif( _animations.hasOwnProperty( prop ) ) {\n\t\t\t\t_stopAnimation(prop);\n\t\t\t} \n\t\t\t\n\t\t}\n\t},\n\t_animateProp = function(name, b, endProp, d, easingFn, onUpdate, onComplete) {\n\t\tvar startAnimTime = _getCurrentTime(), t;\n\t\t_registerStartAnimation(name);\n\n\t\tvar animloop = function(){\n\t\t\tif ( _animations[name] ) {\n\t\t\t\t\n\t\t\t\tt = _getCurrentTime() - startAnimTime; // time diff\n\t\t\t\t//b - beginning (start prop)\n\t\t\t\t//d - anim duration\n\n\t\t\t\tif ( t >= d ) {\n\t\t\t\t\t_stopAnimation(name);\n\t\t\t\t\tonUpdate(endProp);\n\t\t\t\t\tif(onComplete) {\n\t\t\t\t\t\tonComplete();\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonUpdate( (endProp - b) * easingFn(t/d) + b );\n\n\t\t\t\t_animations[name].raf = _requestAF(animloop);\n\t\t\t}\n\t\t};\n\t\tanimloop();\n\t};\n\t\n\n\nvar publicMethods = {\n\n\t// make a few local variables and functions public\n\tshout: _shout,\n\tlisten: _listen,\n\tviewportSize: _viewportSize,\n\toptions: _options,\n\n\tisMainScrollAnimating: function() {\n\t\treturn _mainScrollAnimating;\n\t},\n\tgetZoomLevel: function() {\n\t\treturn _currZoomLevel;\n\t},\n\tgetCurrentIndex: function() {\n\t\treturn _currentItemIndex;\n\t},\n\tisDragging: function() {\n\t\treturn _isDragging;\n\t},\t\n\tisZooming: function() {\n\t\treturn _isZooming;\n\t},\n\tsetScrollOffset: function(x,y) {\n\t\t_offset.x = x;\n\t\t_currentWindowScrollY = _offset.y = y;\n\t\t_shout('updateScrollOffset', _offset);\n\t},\n\tapplyZoomPan: function(zoomLevel,panX,panY,allowRenderResolution) {\n\t\t_panOffset.x = panX;\n\t\t_panOffset.y = panY;\n\t\t_currZoomLevel = zoomLevel;\n\t\t_applyCurrentZoomPan( allowRenderResolution );\n\t},\n\n\tinit: function() {\n\n\t\tif(_isOpen || _isDestroying) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i;\n\n\t\tself.framework = framework; // basic functionality\n\t\tself.template = template; // root DOM element of PhotoSwipe\n\t\tself.bg = framework.getChildByClass(template, 'pswp__bg');\n\n\t\t_initalClassName = template.className;\n\t\t_isOpen = true;\n\t\t\t\t\n\t\t_features = framework.detectFeatures();\n\t\t_requestAF = _features.raf;\n\t\t_cancelAF = _features.caf;\n\t\t_transformKey = _features.transform;\n\t\t_oldIE = _features.oldIE;\n\t\t\n\t\tself.scrollWrap = framework.getChildByClass(template, 'pswp__scroll-wrap');\n\t\tself.container = framework.getChildByClass(self.scrollWrap, 'pswp__container');\n\n\t\t_containerStyle = self.container.style; // for fast access\n\n\t\t// Objects that hold slides (there are only 3 in DOM)\n\t\tself.itemHolders = _itemHolders = [\n\t\t\t{el:self.container.children[0] , wrap:0, index: -1},\n\t\t\t{el:self.container.children[1] , wrap:0, index: -1},\n\t\t\t{el:self.container.children[2] , wrap:0, index: -1}\n\t\t];\n\n\t\t// hide nearby item holders until initial zoom animation finishes (to avoid extra Paints)\n\t\t_itemHolders[0].el.style.display = _itemHolders[2].el.style.display = 'none';\n\n\t\t_setupTransforms();\n\n\t\t// Setup global events\n\t\t_globalEventHandlers = {\n\t\t\tresize: self.updateSize,\n\n\t\t\t// Fixes: iOS 10.3 resize event\n\t\t\t// does not update scrollWrap.clientWidth instantly after resize\n\t\t\t// https://github.com/dimsemenov/PhotoSwipe/issues/1315\n\t\t\torientationchange: function() {\n\t\t\t\tclearTimeout(_orientationChangeTimeout);\n\t\t\t\t_orientationChangeTimeout = setTimeout(function() {\n\t\t\t\t\tif(_viewportSize.x !== self.scrollWrap.clientWidth) {\n\t\t\t\t\t\tself.updateSize();\n\t\t\t\t\t}\n\t\t\t\t}, 500);\n\t\t\t},\n\t\t\tscroll: _updatePageScrollOffset,\n\t\t\tkeydown: _onKeyDown,\n\t\t\tclick: _onGlobalClick\n\t\t};\n\n\t\t// disable show/hide effects on old browsers that don't support CSS animations or transforms, \n\t\t// old IOS, Android and Opera mobile. Blackberry seems to work fine, even older models.\n\t\tvar oldPhone = _features.isOldIOSPhone || _features.isOldAndroid || _features.isMobileOpera;\n\t\tif(!_features.animationName || !_features.transform || oldPhone) {\n\t\t\t_options.showAnimationDuration = _options.hideAnimationDuration = 0;\n\t\t}\n\n\t\t// init modules\n\t\tfor(i = 0; i < _modules.length; i++) {\n\t\t\tself['init' + _modules[i]]();\n\t\t}\n\t\t\n\t\t// init\n\t\tif(UiClass) {\n\t\t\tvar ui = self.ui = new UiClass(self, framework);\n\t\t\tui.init();\n\t\t}\n\n\t\t_shout('firstUpdate');\n\t\t_currentItemIndex = _currentItemIndex || _options.index || 0;\n\t\t// validate index\n\t\tif( isNaN(_currentItemIndex) || _currentItemIndex < 0 || _currentItemIndex >= _getNumItems() ) {\n\t\t\t_currentItemIndex = 0;\n\t\t}\n\t\tself.currItem = _getItemAt( _currentItemIndex );\n\n\t\t\n\t\tif(_features.isOldIOSPhone || _features.isOldAndroid) {\n\t\t\t_isFixedPosition = false;\n\t\t}\n\t\t\n\t\ttemplate.setAttribute('aria-hidden', 'false');\n\t\tif(_options.modal) {\n\t\t\tif(!_isFixedPosition) {\n\t\t\t\ttemplate.style.position = 'absolute';\n\t\t\t\ttemplate.style.top = framework.getScrollY() + 'px';\n\t\t\t} else {\n\t\t\t\ttemplate.style.position = 'fixed';\n\t\t\t}\n\t\t}\n\n\t\tif(_currentWindowScrollY === undefined) {\n\t\t\t_shout('initialLayout');\n\t\t\t_currentWindowScrollY = _initalWindowScrollY = framework.getScrollY();\n\t\t}\n\t\t\n\t\t// add classes to root element of PhotoSwipe\n\t\tvar rootClasses = 'pswp--open ';\n\t\tif(_options.mainClass) {\n\t\t\trootClasses += _options.mainClass + ' ';\n\t\t}\n\t\tif(_options.showHideOpacity) {\n\t\t\trootClasses += 'pswp--animate_opacity ';\n\t\t}\n\t\trootClasses += _likelyTouchDevice ? 'pswp--touch' : 'pswp--notouch';\n\t\trootClasses += _features.animationName ? ' pswp--css_animation' : '';\n\t\trootClasses += _features.svg ? ' pswp--svg' : '';\n\t\tframework.addClass(template, rootClasses);\n\n\t\tself.updateSize();\n\n\t\t// initial update\n\t\t_containerShiftIndex = -1;\n\t\t_indexDiff = null;\n\t\tfor(i = 0; i < NUM_HOLDERS; i++) {\n\t\t\t_setTranslateX( (i+_containerShiftIndex) * _slideSize.x, _itemHolders[i].el.style);\n\t\t}\n\n\t\tif(!_oldIE) {\n\t\t\tframework.bind(self.scrollWrap, _downEvents, self); // no dragging for old IE\n\t\t}\t\n\n\t\t_listen('initialZoomInEnd', function() {\n\t\t\tself.setContent(_itemHolders[0], _currentItemIndex-1);\n\t\t\tself.setContent(_itemHolders[2], _currentItemIndex+1);\n\n\t\t\t_itemHolders[0].el.style.display = _itemHolders[2].el.style.display = 'block';\n\n\t\t\tif(_options.focus) {\n\t\t\t\t// focus causes layout, \n\t\t\t\t// which causes lag during the animation, \n\t\t\t\t// that's why we delay it untill the initial zoom transition ends\n\t\t\t\ttemplate.focus();\n\t\t\t}\n\t\t\t \n\n\t\t\t_bindEvents();\n\t\t});\n\n\t\t// set content for center slide (first time)\n\t\tself.setContent(_itemHolders[1], _currentItemIndex);\n\t\t\n\t\tself.updateCurrItem();\n\n\t\t_shout('afterInit');\n\n\t\tif(!_isFixedPosition) {\n\n\t\t\t// On all versions of iOS lower than 8.0, we check size of viewport every second.\n\t\t\t// \n\t\t\t// This is done to detect when Safari top & bottom bars appear, \n\t\t\t// as this action doesn't trigger any events (like resize). \n\t\t\t// \n\t\t\t// On iOS8 they fixed this.\n\t\t\t// \n\t\t\t// 10 Nov 2014: iOS 7 usage ~40%. iOS 8 usage 56%.\n\t\t\t\n\t\t\t_updateSizeInterval = setInterval(function() {\n\t\t\t\tif(!_numAnimations && !_isDragging && !_isZooming && (_currZoomLevel === self.currItem.initialZoomLevel) ) {\n\t\t\t\t\tself.updateSize();\n\t\t\t\t}\n\t\t\t}, 1000);\n\t\t}\n\n\t\tframework.addClass(template, 'pswp--visible');\n\t},\n\n\t// Close the gallery, then destroy it\n\tclose: function() {\n\t\tif(!_isOpen) {\n\t\t\treturn;\n\t\t}\n\n\t\t_isOpen = false;\n\t\t_isDestroying = true;\n\t\t_shout('close');\n\t\t_unbindEvents();\n\n\t\t_showOrHide(self.currItem, null, true, self.destroy);\n\t},\n\n\t// destroys the gallery (unbinds events, cleans up intervals and timeouts to avoid memory leaks)\n\tdestroy: function() {\n\t\t_shout('destroy');\n\n\t\tif(_showOrHideTimeout) {\n\t\t\tclearTimeout(_showOrHideTimeout);\n\t\t}\n\t\t\n\t\ttemplate.setAttribute('aria-hidden', 'true');\n\t\ttemplate.className = _initalClassName;\n\n\t\tif(_updateSizeInterval) {\n\t\t\tclearInterval(_updateSizeInterval);\n\t\t}\n\n\t\tframework.unbind(self.scrollWrap, _downEvents, self);\n\n\t\t// we unbind scroll event at the end, as closing animation may depend on it\n\t\tframework.unbind(window, 'scroll', self);\n\n\t\t_stopDragUpdateLoop();\n\n\t\t_stopAllAnimations();\n\n\t\t_listeners = null;\n\t},\n\n\t/**\n\t * Pan image to position\n\t * @param {Number} x \n\t * @param {Number} y \n\t * @param {Boolean} force Will ignore bounds if set to true.\n\t */\n\tpanTo: function(x,y,force) {\n\t\tif(!force) {\n\t\t\tif(x > _currPanBounds.min.x) {\n\t\t\t\tx = _currPanBounds.min.x;\n\t\t\t} else if(x < _currPanBounds.max.x) {\n\t\t\t\tx = _currPanBounds.max.x;\n\t\t\t}\n\n\t\t\tif(y > _currPanBounds.min.y) {\n\t\t\t\ty = _currPanBounds.min.y;\n\t\t\t} else if(y < _currPanBounds.max.y) {\n\t\t\t\ty = _currPanBounds.max.y;\n\t\t\t}\n\t\t}\n\t\t\n\t\t_panOffset.x = x;\n\t\t_panOffset.y = y;\n\t\t_applyCurrentZoomPan();\n\t},\n\t\n\thandleEvent: function (e) {\n\t\te = e || window.event;\n\t\tif(_globalEventHandlers[e.type]) {\n\t\t\t_globalEventHandlers[e.type](e);\n\t\t}\n\t},\n\n\n\tgoTo: function(index) {\n\n\t\tindex = _getLoopedId(index);\n\n\t\tvar diff = index - _currentItemIndex;\n\t\t_indexDiff = diff;\n\n\t\t_currentItemIndex = index;\n\t\tself.currItem = _getItemAt( _currentItemIndex );\n\t\t_currPositionIndex -= diff;\n\t\t\n\t\t_moveMainScroll(_slideSize.x * _currPositionIndex);\n\t\t\n\n\t\t_stopAllAnimations();\n\t\t_mainScrollAnimating = false;\n\n\t\tself.updateCurrItem();\n\t},\n\tnext: function() {\n\t\tself.goTo( _currentItemIndex + 1);\n\t},\n\tprev: function() {\n\t\tself.goTo( _currentItemIndex - 1);\n\t},\n\n\t// update current zoom/pan objects\n\tupdateCurrZoomItem: function(emulateSetContent) {\n\t\tif(emulateSetContent) {\n\t\t\t_shout('beforeChange', 0);\n\t\t}\n\n\t\t// itemHolder[1] is middle (current) item\n\t\tif(_itemHolders[1].el.children.length) {\n\t\t\tvar zoomElement = _itemHolders[1].el.children[0];\n\t\t\tif( framework.hasClass(zoomElement, 'pswp__zoom-wrap') ) {\n\t\t\t\t_currZoomElementStyle = zoomElement.style;\n\t\t\t} else {\n\t\t\t\t_currZoomElementStyle = null;\n\t\t\t}\n\t\t} else {\n\t\t\t_currZoomElementStyle = null;\n\t\t}\n\t\t\n\t\t_currPanBounds = self.currItem.bounds;\t\n\t\t_startZoomLevel = _currZoomLevel = self.currItem.initialZoomLevel;\n\n\t\t_panOffset.x = _currPanBounds.center.x;\n\t\t_panOffset.y = _currPanBounds.center.y;\n\n\t\tif(emulateSetContent) {\n\t\t\t_shout('afterChange');\n\t\t}\n\t},\n\n\n\tinvalidateCurrItems: function() {\n\t\t_itemsNeedUpdate = true;\n\t\tfor(var i = 0; i < NUM_HOLDERS; i++) {\n\t\t\tif( _itemHolders[i].item ) {\n\t\t\t\t_itemHolders[i].item.needsUpdate = true;\n\t\t\t}\n\t\t}\n\t},\n\n\tupdateCurrItem: function(beforeAnimation) {\n\n\t\tif(_indexDiff === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar diffAbs = Math.abs(_indexDiff),\n\t\t\ttempHolder;\n\n\t\tif(beforeAnimation && diffAbs < 2) {\n\t\t\treturn;\n\t\t}\n\n\n\t\tself.currItem = _getItemAt( _currentItemIndex );\n\t\t_renderMaxResolution = false;\n\t\t\n\t\t_shout('beforeChange', _indexDiff);\n\n\t\tif(diffAbs >= NUM_HOLDERS) {\n\t\t\t_containerShiftIndex += _indexDiff + (_indexDiff > 0 ? -NUM_HOLDERS : NUM_HOLDERS);\n\t\t\tdiffAbs = NUM_HOLDERS;\n\t\t}\n\t\tfor(var i = 0; i < diffAbs; i++) {\n\t\t\tif(_indexDiff > 0) {\n\t\t\t\ttempHolder = _itemHolders.shift();\n\t\t\t\t_itemHolders[NUM_HOLDERS-1] = tempHolder; // move first to last\n\n\t\t\t\t_containerShiftIndex++;\n\t\t\t\t_setTranslateX( (_containerShiftIndex+2) * _slideSize.x, tempHolder.el.style);\n\t\t\t\tself.setContent(tempHolder, _currentItemIndex - diffAbs + i + 1 + 1);\n\t\t\t} else {\n\t\t\t\ttempHolder = _itemHolders.pop();\n\t\t\t\t_itemHolders.unshift( tempHolder ); // move last to first\n\n\t\t\t\t_containerShiftIndex--;\n\t\t\t\t_setTranslateX( _containerShiftIndex * _slideSize.x, tempHolder.el.style);\n\t\t\t\tself.setContent(tempHolder, _currentItemIndex + diffAbs - i - 1 - 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t// reset zoom/pan on previous item\n\t\tif(_currZoomElementStyle && Math.abs(_indexDiff) === 1) {\n\n\t\t\tvar prevItem = _getItemAt(_prevItemIndex);\n\t\t\tif(prevItem.initialZoomLevel !== _currZoomLevel) {\n\t\t\t\t_calculateItemSize(prevItem , _viewportSize );\n\t\t\t\t_setImageSize(prevItem);\n\t\t\t\t_applyZoomPanToItem( prevItem ); \t\t\t\t\n\t\t\t}\n\n\t\t}\n\n\t\t// reset diff after update\n\t\t_indexDiff = 0;\n\n\t\tself.updateCurrZoomItem();\n\n\t\t_prevItemIndex = _currentItemIndex;\n\n\t\t_shout('afterChange');\n\t\t\n\t},\n\n\n\n\tupdateSize: function(force) {\n\t\t\n\t\tif(!_isFixedPosition && _options.modal) {\n\t\t\tvar windowScrollY = framework.getScrollY();\n\t\t\tif(_currentWindowScrollY !== windowScrollY) {\n\t\t\t\ttemplate.style.top = windowScrollY + 'px';\n\t\t\t\t_currentWindowScrollY = windowScrollY;\n\t\t\t}\n\t\t\tif(!force && _windowVisibleSize.x === window.innerWidth && _windowVisibleSize.y === window.innerHeight) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t_windowVisibleSize.x = window.innerWidth;\n\t\t\t_windowVisibleSize.y = window.innerHeight;\n\n\t\t\t//template.style.width = _windowVisibleSize.x + 'px';\n\t\t\ttemplate.style.height = _windowVisibleSize.y + 'px';\n\t\t}\n\n\n\n\t\t_viewportSize.x = self.scrollWrap.clientWidth;\n\t\t_viewportSize.y = self.scrollWrap.clientHeight;\n\n\t\t_updatePageScrollOffset();\n\n\t\t_slideSize.x = _viewportSize.x + Math.round(_viewportSize.x * _options.spacing);\n\t\t_slideSize.y = _viewportSize.y;\n\n\t\t_moveMainScroll(_slideSize.x * _currPositionIndex);\n\n\t\t_shout('beforeResize'); // even may be used for example to switch image sources\n\n\n\t\t// don't re-calculate size on inital size update\n\t\tif(_containerShiftIndex !== undefined) {\n\n\t\t\tvar holder,\n\t\t\t\titem,\n\t\t\t\thIndex;\n\n\t\t\tfor(var i = 0; i < NUM_HOLDERS; i++) {\n\t\t\t\tholder = _itemHolders[i];\n\t\t\t\t_setTranslateX( (i+_containerShiftIndex) * _slideSize.x, holder.el.style);\n\n\t\t\t\thIndex = _currentItemIndex+i-1;\n\n\t\t\t\tif(_options.loop && _getNumItems() > 2) {\n\t\t\t\t\thIndex = _getLoopedId(hIndex);\n\t\t\t\t}\n\n\t\t\t\t// update zoom level on items and refresh source (if needsUpdate)\n\t\t\t\titem = _getItemAt( hIndex );\n\n\t\t\t\t// re-render gallery item if `needsUpdate`,\n\t\t\t\t// or doesn't have `bounds` (entirely new slide object)\n\t\t\t\tif( item && (_itemsNeedUpdate || item.needsUpdate || !item.bounds) ) {\n\n\t\t\t\t\tself.cleanSlide( item );\n\t\t\t\t\t\n\t\t\t\t\tself.setContent( holder, hIndex );\n\n\t\t\t\t\t// if \"center\" slide\n\t\t\t\t\tif(i === 1) {\n\t\t\t\t\t\tself.currItem = item;\n\t\t\t\t\t\tself.updateCurrZoomItem(true);\n\t\t\t\t\t}\n\n\t\t\t\t\titem.needsUpdate = false;\n\n\t\t\t\t} else if(holder.index === -1 && hIndex >= 0) {\n\t\t\t\t\t// add content first time\n\t\t\t\t\tself.setContent( holder, hIndex );\n\t\t\t\t}\n\t\t\t\tif(item && item.container) {\n\t\t\t\t\t_calculateItemSize(item, _viewportSize);\n\t\t\t\t\t_setImageSize(item);\n\t\t\t\t\t_applyZoomPanToItem( item );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t_itemsNeedUpdate = false;\n\t\t}\t\n\n\t\t_startZoomLevel = _currZoomLevel = self.currItem.initialZoomLevel;\n\t\t_currPanBounds = self.currItem.bounds;\n\n\t\tif(_currPanBounds) {\n\t\t\t_panOffset.x = _currPanBounds.center.x;\n\t\t\t_panOffset.y = _currPanBounds.center.y;\n\t\t\t_applyCurrentZoomPan( true );\n\t\t}\n\t\t\n\t\t_shout('resize');\n\t},\n\t\n\t// Zoom current item to\n\tzoomTo: function(destZoomLevel, centerPoint, speed, easingFn, updateFn) {\n\t\t/*\n\t\t\tif(destZoomLevel === 'fit') {\n\t\t\t\tdestZoomLevel = self.currItem.fitRatio;\n\t\t\t} else if(destZoomLevel === 'fill') {\n\t\t\t\tdestZoomLevel = self.currItem.fillRatio;\n\t\t\t}\n\t\t*/\n\n\t\tif(centerPoint) {\n\t\t\t_startZoomLevel = _currZoomLevel;\n\t\t\t_midZoomPoint.x = Math.abs(centerPoint.x) - _panOffset.x ;\n\t\t\t_midZoomPoint.y = Math.abs(centerPoint.y) - _panOffset.y ;\n\t\t\t_equalizePoints(_startPanOffset, _panOffset);\n\t\t}\n\n\t\tvar destPanBounds = _calculatePanBounds(destZoomLevel, false),\n\t\t\tdestPanOffset = {};\n\n\t\t_modifyDestPanOffset('x', destPanBounds, destPanOffset, destZoomLevel);\n\t\t_modifyDestPanOffset('y', destPanBounds, destPanOffset, destZoomLevel);\n\n\t\tvar initialZoomLevel = _currZoomLevel;\n\t\tvar initialPanOffset = {\n\t\t\tx: _panOffset.x,\n\t\t\ty: _panOffset.y\n\t\t};\n\n\t\t_roundPoint(destPanOffset);\n\n\t\tvar onUpdate = function(now) {\n\t\t\tif(now === 1) {\n\t\t\t\t_currZoomLevel = destZoomLevel;\n\t\t\t\t_panOffset.x = destPanOffset.x;\n\t\t\t\t_panOffset.y = destPanOffset.y;\n\t\t\t} else {\n\t\t\t\t_currZoomLevel = (destZoomLevel - initialZoomLevel) * now + initialZoomLevel;\n\t\t\t\t_panOffset.x = (destPanOffset.x - initialPanOffset.x) * now + initialPanOffset.x;\n\t\t\t\t_panOffset.y = (destPanOffset.y - initialPanOffset.y) * now + initialPanOffset.y;\n\t\t\t}\n\n\t\t\tif(updateFn) {\n\t\t\t\tupdateFn(now);\n\t\t\t}\n\n\t\t\t_applyCurrentZoomPan( now === 1 );\n\t\t};\n\n\t\tif(speed) {\n\t\t\t_animateProp('customZoomTo', 0, 1, speed, easingFn || framework.easing.sine.inOut, onUpdate);\n\t\t} else {\n\t\t\tonUpdate(1);\n\t\t}\n\t}\n\n\n};\n\n\n/*>>core*/\n\n/*>>gestures*/\n/**\n * Mouse/touch/pointer event handlers.\n * \n * separated from @core.js for readability\n */\n\nvar MIN_SWIPE_DISTANCE = 30,\n\tDIRECTION_CHECK_OFFSET = 10; // amount of pixels to drag to determine direction of swipe\n\nvar _gestureStartTime,\n\t_gestureCheckSpeedTime,\n\n\t// pool of objects that are used during dragging of zooming\n\tp = {}, // first point\n\tp2 = {}, // second point (for zoom gesture)\n\tdelta = {},\n\t_currPoint = {},\n\t_startPoint = {},\n\t_currPointers = [],\n\t_startMainScrollPos = {},\n\t_releaseAnimData,\n\t_posPoints = [], // array of points during dragging, used to determine type of gesture\n\t_tempPoint = {},\n\n\t_isZoomingIn,\n\t_verticalDragInitiated,\n\t_oldAndroidTouchEndTimeout,\n\t_currZoomedItemIndex = 0,\n\t_centerPoint = _getEmptyPoint(),\n\t_lastReleaseTime = 0,\n\t_isDragging, // at least one pointer is down\n\t_isMultitouch, // at least two _pointers are down\n\t_zoomStarted, // zoom level changed during zoom gesture\n\t_moved,\n\t_dragAnimFrame,\n\t_mainScrollShifted,\n\t_currentPoints, // array of current touch points\n\t_isZooming,\n\t_currPointsDistance,\n\t_startPointsDistance,\n\t_currPanBounds,\n\t_mainScrollPos = _getEmptyPoint(),\n\t_currZoomElementStyle,\n\t_mainScrollAnimating, // true, if animation after swipe gesture is running\n\t_midZoomPoint = _getEmptyPoint(),\n\t_currCenterPoint = _getEmptyPoint(),\n\t_direction,\n\t_isFirstMove,\n\t_opacityChanged,\n\t_bgOpacity,\n\t_wasOverInitialZoom,\n\n\t_isEqualPoints = function(p1, p2) {\n\t\treturn p1.x === p2.x && p1.y === p2.y;\n\t},\n\t_isNearbyPoints = function(touch0, touch1) {\n\t\treturn Math.abs(touch0.x - touch1.x) < DOUBLE_TAP_RADIUS && Math.abs(touch0.y - touch1.y) < DOUBLE_TAP_RADIUS;\n\t},\n\t_calculatePointsDistance = function(p1, p2) {\n\t\t_tempPoint.x = Math.abs( p1.x - p2.x );\n\t\t_tempPoint.y = Math.abs( p1.y - p2.y );\n\t\treturn Math.sqrt(_tempPoint.x * _tempPoint.x + _tempPoint.y * _tempPoint.y);\n\t},\n\t_stopDragUpdateLoop = function() {\n\t\tif(_dragAnimFrame) {\n\t\t\t_cancelAF(_dragAnimFrame);\n\t\t\t_dragAnimFrame = null;\n\t\t}\n\t},\n\t_dragUpdateLoop = function() {\n\t\tif(_isDragging) {\n\t\t\t_dragAnimFrame = _requestAF(_dragUpdateLoop);\n\t\t\t_renderMovement();\n\t\t}\n\t},\n\t_canPan = function() {\n\t\treturn !(_options.scaleMode === 'fit' && _currZoomLevel === self.currItem.initialZoomLevel);\n\t},\n\t\n\t// find the closest parent DOM element\n\t_closestElement = function(el, fn) {\n\t \tif(!el || el === document) {\n\t \t\treturn false;\n\t \t}\n\n\t \t// don't search elements above pswp__scroll-wrap\n\t \tif(el.getAttribute('class') && el.getAttribute('class').indexOf('pswp__scroll-wrap') > -1 ) {\n\t \t\treturn false;\n\t \t}\n\n\t \tif( fn(el) ) {\n\t \t\treturn el;\n\t \t}\n\n\t \treturn _closestElement(el.parentNode, fn);\n\t},\n\n\t_preventObj = {},\n\t_preventDefaultEventBehaviour = function(e, isDown) {\n\t _preventObj.prevent = !_closestElement(e.target, _options.isClickableElement);\n\n\t\t_shout('preventDragEvent', e, isDown, _preventObj);\n\t\treturn _preventObj.prevent;\n\n\t},\n\t_convertTouchToPoint = function(touch, p) {\n\t\tp.x = touch.pageX;\n\t\tp.y = touch.pageY;\n\t\tp.id = touch.identifier;\n\t\treturn p;\n\t},\n\t_findCenterOfPoints = function(p1, p2, pCenter) {\n\t\tpCenter.x = (p1.x + p2.x) * 0.5;\n\t\tpCenter.y = (p1.y + p2.y) * 0.5;\n\t},\n\t_pushPosPoint = function(time, x, y) {\n\t\tif(time - _gestureCheckSpeedTime > 50) {\n\t\t\tvar o = _posPoints.length > 2 ? _posPoints.shift() : {};\n\t\t\to.x = x;\n\t\t\to.y = y; \n\t\t\t_posPoints.push(o);\n\t\t\t_gestureCheckSpeedTime = time;\n\t\t}\n\t},\n\n\t_calculateVerticalDragOpacityRatio = function() {\n\t\tvar yOffset = _panOffset.y - self.currItem.initialPosition.y; // difference between initial and current position\n\t\treturn 1 - Math.abs( yOffset / (_viewportSize.y / 2) );\n\t},\n\n\t\n\t// points pool, reused during touch events\n\t_ePoint1 = {},\n\t_ePoint2 = {},\n\t_tempPointsArr = [],\n\t_tempCounter,\n\t_getTouchPoints = function(e) {\n\t\t// clean up previous points, without recreating array\n\t\twhile(_tempPointsArr.length > 0) {\n\t\t\t_tempPointsArr.pop();\n\t\t}\n\n\t\tif(!_pointerEventEnabled) {\n\t\t\tif(e.type.indexOf('touch') > -1) {\n\n\t\t\t\tif(e.touches && e.touches.length > 0) {\n\t\t\t\t\t_tempPointsArr[0] = _convertTouchToPoint(e.touches[0], _ePoint1);\n\t\t\t\t\tif(e.touches.length > 1) {\n\t\t\t\t\t\t_tempPointsArr[1] = _convertTouchToPoint(e.touches[1], _ePoint2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t_ePoint1.x = e.pageX;\n\t\t\t\t_ePoint1.y = e.pageY;\n\t\t\t\t_ePoint1.id = '';\n\t\t\t\t_tempPointsArr[0] = _ePoint1;//_ePoint1;\n\t\t\t}\n\t\t} else {\n\t\t\t_tempCounter = 0;\n\t\t\t// we can use forEach, as pointer events are supported only in modern browsers\n\t\t\t_currPointers.forEach(function(p) {\n\t\t\t\tif(_tempCounter === 0) {\n\t\t\t\t\t_tempPointsArr[0] = p;\n\t\t\t\t} else if(_tempCounter === 1) {\n\t\t\t\t\t_tempPointsArr[1] = p;\n\t\t\t\t}\n\t\t\t\t_tempCounter++;\n\n\t\t\t});\n\t\t}\n\t\treturn _tempPointsArr;\n\t},\n\n\t_panOrMoveMainScroll = function(axis, delta) {\n\n\t\tvar panFriction,\n\t\t\toverDiff = 0,\n\t\t\tnewOffset = _panOffset[axis] + delta[axis],\n\t\t\tstartOverDiff,\n\t\t\tdir = delta[axis] > 0,\n\t\t\tnewMainScrollPosition = _mainScrollPos.x + delta.x,\n\t\t\tmainScrollDiff = _mainScrollPos.x - _startMainScrollPos.x,\n\t\t\tnewPanPos,\n\t\t\tnewMainScrollPos;\n\n\t\t// calculate fdistance over the bounds and friction\n\t\tif(newOffset > _currPanBounds.min[axis] || newOffset < _currPanBounds.max[axis]) {\n\t\t\tpanFriction = _options.panEndFriction;\n\t\t\t// Linear increasing of friction, so at 1/4 of viewport it's at max value. \n\t\t\t// Looks not as nice as was expected. Left for history.\n\t\t\t// panFriction = (1 - (_panOffset[axis] + delta[axis] + panBounds.min[axis]) / (_viewportSize[axis] / 4) );\n\t\t} else {\n\t\t\tpanFriction = 1;\n\t\t}\n\t\t\n\t\tnewOffset = _panOffset[axis] + delta[axis] * panFriction;\n\n\t\t// move main scroll or start panning\n\t\tif(_options.allowPanToNext || _currZoomLevel === self.currItem.initialZoomLevel) {\n\n\n\t\t\tif(!_currZoomElementStyle) {\n\t\t\t\t\n\t\t\t\tnewMainScrollPos = newMainScrollPosition;\n\n\t\t\t} else if(_direction === 'h' && axis === 'x' && !_zoomStarted ) {\n\t\t\t\t\n\t\t\t\tif(dir) {\n\t\t\t\t\tif(newOffset > _currPanBounds.min[axis]) {\n\t\t\t\t\t\tpanFriction = _options.panEndFriction;\n\t\t\t\t\t\toverDiff = _currPanBounds.min[axis] - newOffset;\n\t\t\t\t\t\tstartOverDiff = _currPanBounds.min[axis] - _startPanOffset[axis];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// drag right\n\t\t\t\t\tif( (startOverDiff <= 0 || mainScrollDiff < 0) && _getNumItems() > 1 ) {\n\t\t\t\t\t\tnewMainScrollPos = newMainScrollPosition;\n\t\t\t\t\t\tif(mainScrollDiff < 0 && newMainScrollPosition > _startMainScrollPos.x) {\n\t\t\t\t\t\t\tnewMainScrollPos = _startMainScrollPos.x;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(_currPanBounds.min.x !== _currPanBounds.max.x) {\n\t\t\t\t\t\t\tnewPanPos = newOffset;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif(newOffset < _currPanBounds.max[axis] ) {\n\t\t\t\t\t\tpanFriction =_options.panEndFriction;\n\t\t\t\t\t\toverDiff = newOffset - _currPanBounds.max[axis];\n\t\t\t\t\t\tstartOverDiff = _startPanOffset[axis] - _currPanBounds.max[axis];\n\t\t\t\t\t}\n\n\t\t\t\t\tif( (startOverDiff <= 0 || mainScrollDiff > 0) && _getNumItems() > 1 ) {\n\t\t\t\t\t\tnewMainScrollPos = newMainScrollPosition;\n\n\t\t\t\t\t\tif(mainScrollDiff > 0 && newMainScrollPosition < _startMainScrollPos.x) {\n\t\t\t\t\t\t\tnewMainScrollPos = _startMainScrollPos.x;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(_currPanBounds.min.x !== _currPanBounds.max.x) {\n\t\t\t\t\t\t\tnewPanPos = newOffset;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\t//\n\t\t\t}\n\n\t\t\tif(axis === 'x') {\n\n\t\t\t\tif(newMainScrollPos !== undefined) {\n\t\t\t\t\t_moveMainScroll(newMainScrollPos, true);\n\t\t\t\t\tif(newMainScrollPos === _startMainScrollPos.x) {\n\t\t\t\t\t\t_mainScrollShifted = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_mainScrollShifted = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(_currPanBounds.min.x !== _currPanBounds.max.x) {\n\t\t\t\t\tif(newPanPos !== undefined) {\n\t\t\t\t\t\t_panOffset.x = newPanPos;\n\t\t\t\t\t} else if(!_mainScrollShifted) {\n\t\t\t\t\t\t_panOffset.x += delta.x * panFriction;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn newMainScrollPos !== undefined;\n\t\t\t}\n\n\t\t}\n\n\t\tif(!_mainScrollAnimating) {\n\t\t\t\n\t\t\tif(!_mainScrollShifted) {\n\t\t\t\tif(_currZoomLevel > self.currItem.fitRatio) {\n\t\t\t\t\t_panOffset[axis] += delta[axis] * panFriction;\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t\n\t},\n\n\t// Pointerdown/touchstart/mousedown handler\n\t_onDragStart = function(e) {\n\n\t\t// Allow dragging only via left mouse button.\n\t\t// As this handler is not added in IE8 - we ignore e.which\n\t\t// \n\t\t// http://www.quirksmode.org/js/events_properties.html\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/event.button\n\t\tif(e.type === 'mousedown' && e.button > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(_initialZoomRunning) {\n\t\t\te.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tif(_oldAndroidTouchEndTimeout && e.type === 'mousedown') {\n\t\t\treturn;\n\t\t}\n\n\t\tif(_preventDefaultEventBehaviour(e, true)) {\n\t\t\te.preventDefault();\n\t\t}\n\n\n\n\t\t_shout('pointerDown');\n\n\t\tif(_pointerEventEnabled) {\n\t\t\tvar pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id');\n\t\t\tif(pointerIndex < 0) {\n\t\t\t\tpointerIndex = _currPointers.length;\n\t\t\t}\n\t\t\t_currPointers[pointerIndex] = {x:e.pageX, y:e.pageY, id: e.pointerId};\n\t\t}\n\t\t\n\n\n\t\tvar startPointsList = _getTouchPoints(e),\n\t\t\tnumPoints = startPointsList.length;\n\n\t\t_currentPoints = null;\n\n\t\t_stopAllAnimations();\n\n\t\t// init drag\n\t\tif(!_isDragging || numPoints === 1) {\n\n\t\t\t\n\n\t\t\t_isDragging = _isFirstMove = true;\n\t\t\tframework.bind(window, _upMoveEvents, self);\n\n\t\t\t_isZoomingIn = \n\t\t\t\t_wasOverInitialZoom = \n\t\t\t\t_opacityChanged = \n\t\t\t\t_verticalDragInitiated = \n\t\t\t\t_mainScrollShifted = \n\t\t\t\t_moved = \n\t\t\t\t_isMultitouch = \n\t\t\t\t_zoomStarted = false;\n\n\t\t\t_direction = null;\n\n\t\t\t_shout('firstTouchStart', startPointsList);\n\n\t\t\t_equalizePoints(_startPanOffset, _panOffset);\n\n\t\t\t_currPanDist.x = _currPanDist.y = 0;\n\t\t\t_equalizePoints(_currPoint, startPointsList[0]);\n\t\t\t_equalizePoints(_startPoint, _currPoint);\n\n\t\t\t//_equalizePoints(_startMainScrollPos, _mainScrollPos);\n\t\t\t_startMainScrollPos.x = _slideSize.x * _currPositionIndex;\n\n\t\t\t_posPoints = [{\n\t\t\t\tx: _currPoint.x,\n\t\t\t\ty: _currPoint.y\n\t\t\t}];\n\n\t\t\t_gestureCheckSpeedTime = _gestureStartTime = _getCurrentTime();\n\n\t\t\t//_mainScrollAnimationEnd(true);\n\t\t\t_calculatePanBounds( _currZoomLevel, true );\n\t\t\t\n\t\t\t// Start rendering\n\t\t\t_stopDragUpdateLoop();\n\t\t\t_dragUpdateLoop();\n\t\t\t\n\t\t}\n\n\t\t// init zoom\n\t\tif(!_isZooming && numPoints > 1 && !_mainScrollAnimating && !_mainScrollShifted) {\n\t\t\t_startZoomLevel = _currZoomLevel;\n\t\t\t_zoomStarted = false; // true if zoom changed at least once\n\n\t\t\t_isZooming = _isMultitouch = true;\n\t\t\t_currPanDist.y = _currPanDist.x = 0;\n\n\t\t\t_equalizePoints(_startPanOffset, _panOffset);\n\n\t\t\t_equalizePoints(p, startPointsList[0]);\n\t\t\t_equalizePoints(p2, startPointsList[1]);\n\n\t\t\t_findCenterOfPoints(p, p2, _currCenterPoint);\n\n\t\t\t_midZoomPoint.x = Math.abs(_currCenterPoint.x) - _panOffset.x;\n\t\t\t_midZoomPoint.y = Math.abs(_currCenterPoint.y) - _panOffset.y;\n\t\t\t_currPointsDistance = _startPointsDistance = _calculatePointsDistance(p, p2);\n\t\t}\n\n\n\t},\n\n\t// Pointermove/touchmove/mousemove handler\n\t_onDragMove = function(e) {\n\n\t\te.preventDefault();\n\n\t\tif(_pointerEventEnabled) {\n\t\t\tvar pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id');\n\t\t\tif(pointerIndex > -1) {\n\t\t\t\tvar p = _currPointers[pointerIndex];\n\t\t\t\tp.x = e.pageX;\n\t\t\t\tp.y = e.pageY; \n\t\t\t}\n\t\t}\n\n\t\tif(_isDragging) {\n\t\t\tvar touchesList = _getTouchPoints(e);\n\t\t\tif(!_direction && !_moved && !_isZooming) {\n\n\t\t\t\tif(_mainScrollPos.x !== _slideSize.x * _currPositionIndex) {\n\t\t\t\t\t// if main scroll position is shifted \u2013 direction is always horizontal\n\t\t\t\t\t_direction = 'h';\n\t\t\t\t} else {\n\t\t\t\t\tvar diff = Math.abs(touchesList[0].x - _currPoint.x) - Math.abs(touchesList[0].y - _currPoint.y);\n\t\t\t\t\t// check the direction of movement\n\t\t\t\t\tif(Math.abs(diff) >= DIRECTION_CHECK_OFFSET) {\n\t\t\t\t\t\t_direction = diff > 0 ? 'h' : 'v';\n\t\t\t\t\t\t_currentPoints = touchesList;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t_currentPoints = touchesList;\n\t\t\t}\n\t\t}\t\n\t},\n\t// \n\t_renderMovement = function() {\n\n\t\tif(!_currentPoints) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar numPoints = _currentPoints.length;\n\n\t\tif(numPoints === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t_equalizePoints(p, _currentPoints[0]);\n\n\t\tdelta.x = p.x - _currPoint.x;\n\t\tdelta.y = p.y - _currPoint.y;\n\n\t\tif(_isZooming && numPoints > 1) {\n\t\t\t// Handle behaviour for more than 1 point\n\n\t\t\t_currPoint.x = p.x;\n\t\t\t_currPoint.y = p.y;\n\t\t\n\t\t\t// check if one of two points changed\n\t\t\tif( !delta.x && !delta.y && _isEqualPoints(_currentPoints[1], p2) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_equalizePoints(p2, _currentPoints[1]);\n\n\n\t\t\tif(!_zoomStarted) {\n\t\t\t\t_zoomStarted = true;\n\t\t\t\t_shout('zoomGestureStarted');\n\t\t\t}\n\t\t\t\n\t\t\t// Distance between two points\n\t\t\tvar pointsDistance = _calculatePointsDistance(p,p2);\n\n\t\t\tvar zoomLevel = _calculateZoomLevel(pointsDistance);\n\n\t\t\t// slightly over the of initial zoom level\n\t\t\tif(zoomLevel > self.currItem.initialZoomLevel + self.currItem.initialZoomLevel / 15) {\n\t\t\t\t_wasOverInitialZoom = true;\n\t\t\t}\n\n\t\t\t// Apply the friction if zoom level is out of the bounds\n\t\t\tvar zoomFriction = 1,\n\t\t\t\tminZoomLevel = _getMinZoomLevel(),\n\t\t\t\tmaxZoomLevel = _getMaxZoomLevel();\n\n\t\t\tif ( zoomLevel < minZoomLevel ) {\n\t\t\t\t\n\t\t\t\tif(_options.pinchToClose && !_wasOverInitialZoom && _startZoomLevel <= self.currItem.initialZoomLevel) {\n\t\t\t\t\t// fade out background if zooming out\n\t\t\t\t\tvar minusDiff = minZoomLevel - zoomLevel;\n\t\t\t\t\tvar percent = 1 - minusDiff / (minZoomLevel / 1.2);\n\n\t\t\t\t\t_applyBgOpacity(percent);\n\t\t\t\t\t_shout('onPinchClose', percent);\n\t\t\t\t\t_opacityChanged = true;\n\t\t\t\t} else {\n\t\t\t\t\tzoomFriction = (minZoomLevel - zoomLevel) / minZoomLevel;\n\t\t\t\t\tif(zoomFriction > 1) {\n\t\t\t\t\t\tzoomFriction = 1;\n\t\t\t\t\t}\n\t\t\t\t\tzoomLevel = minZoomLevel - zoomFriction * (minZoomLevel / 3);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if ( zoomLevel > maxZoomLevel ) {\n\t\t\t\t// 1.5 - extra zoom level above the max. E.g. if max is x6, real max 6 + 1.5 = 7.5\n\t\t\t\tzoomFriction = (zoomLevel - maxZoomLevel) / ( minZoomLevel * 6 );\n\t\t\t\tif(zoomFriction > 1) {\n\t\t\t\t\tzoomFriction = 1;\n\t\t\t\t}\n\t\t\t\tzoomLevel = maxZoomLevel + zoomFriction * minZoomLevel;\n\t\t\t}\n\n\t\t\tif(zoomFriction < 0) {\n\t\t\t\tzoomFriction = 0;\n\t\t\t}\n\n\t\t\t// distance between touch points after friction is applied\n\t\t\t_currPointsDistance = pointsDistance;\n\n\t\t\t// _centerPoint - The point in the middle of two pointers\n\t\t\t_findCenterOfPoints(p, p2, _centerPoint);\n\t\t\n\t\t\t// paning with two pointers pressed\n\t\t\t_currPanDist.x += _centerPoint.x - _currCenterPoint.x;\n\t\t\t_currPanDist.y += _centerPoint.y - _currCenterPoint.y;\n\t\t\t_equalizePoints(_currCenterPoint, _centerPoint);\n\n\t\t\t_panOffset.x = _calculatePanOffset('x', zoomLevel);\n\t\t\t_panOffset.y = _calculatePanOffset('y', zoomLevel);\n\n\t\t\t_isZoomingIn = zoomLevel > _currZoomLevel;\n\t\t\t_currZoomLevel = zoomLevel;\n\t\t\t_applyCurrentZoomPan();\n\n\t\t} else {\n\n\t\t\t// handle behaviour for one point (dragging or panning)\n\n\t\t\tif(!_direction) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(_isFirstMove) {\n\t\t\t\t_isFirstMove = false;\n\n\t\t\t\t// subtract drag distance that was used during the detection direction \n\n\t\t\t\tif( Math.abs(delta.x) >= DIRECTION_CHECK_OFFSET) {\n\t\t\t\t\tdelta.x -= _currentPoints[0].x - _startPoint.x;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( Math.abs(delta.y) >= DIRECTION_CHECK_OFFSET) {\n\t\t\t\t\tdelta.y -= _currentPoints[0].y - _startPoint.y;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_currPoint.x = p.x;\n\t\t\t_currPoint.y = p.y;\n\n\t\t\t// do nothing if pointers position hasn't changed\n\t\t\tif(delta.x === 0 && delta.y === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(_direction === 'v' && _options.closeOnVerticalDrag) {\n\t\t\t\tif(!_canPan()) {\n\t\t\t\t\t_currPanDist.y += delta.y;\n\t\t\t\t\t_panOffset.y += delta.y;\n\n\t\t\t\t\tvar opacityRatio = _calculateVerticalDragOpacityRatio();\n\n\t\t\t\t\t_verticalDragInitiated = true;\n\t\t\t\t\t_shout('onVerticalDrag', opacityRatio);\n\n\t\t\t\t\t_applyBgOpacity(opacityRatio);\n\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_pushPosPoint(_getCurrentTime(), p.x, p.y);\n\n\t\t\t_moved = true;\n\t\t\t_currPanBounds = self.currItem.bounds;\n\t\t\t\n\t\t\tvar mainScrollChanged = _panOrMoveMainScroll('x', delta);\n\t\t\tif(!mainScrollChanged) {\n\t\t\t\t_panOrMoveMainScroll('y', delta);\n\n\t\t\t\t_roundPoint(_panOffset);\n\t\t\t\t_applyCurrentZoomPan();\n\t\t\t}\n\n\t\t}\n\n\t},\n\t\n\t// Pointerup/pointercancel/touchend/touchcancel/mouseup event handler\n\t_onDragRelease = function(e) {\n\n\t\tif(_features.isOldAndroid ) {\n\n\t\t\tif(_oldAndroidTouchEndTimeout && e.type === 'mouseup') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// on Android (v4.1, 4.2, 4.3 & possibly older) \n\t\t\t// ghost mousedown/up event isn't preventable via e.preventDefault,\n\t\t\t// which causes fake mousedown event\n\t\t\t// so we block mousedown/up for 600ms\n\t\t\tif( e.type.indexOf('touch') > -1 ) {\n\t\t\t\tclearTimeout(_oldAndroidTouchEndTimeout);\n\t\t\t\t_oldAndroidTouchEndTimeout = setTimeout(function() {\n\t\t\t\t\t_oldAndroidTouchEndTimeout = 0;\n\t\t\t\t}, 600);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t_shout('pointerUp');\n\n\t\tif(_preventDefaultEventBehaviour(e, false)) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar releasePoint;\n\n\t\tif(_pointerEventEnabled) {\n\t\t\tvar pointerIndex = framework.arraySearch(_currPointers, e.pointerId, 'id');\n\t\t\t\n\t\t\tif(pointerIndex > -1) {\n\t\t\t\treleasePoint = _currPointers.splice(pointerIndex, 1)[0];\n\n\t\t\t\tif(navigator.msPointerEnabled) {\n\t\t\t\t\tvar MSPOINTER_TYPES = {\n\t\t\t\t\t\t4: 'mouse', // event.MSPOINTER_TYPE_MOUSE\n\t\t\t\t\t\t2: 'touch', // event.MSPOINTER_TYPE_TOUCH \n\t\t\t\t\t\t3: 'pen' // event.MSPOINTER_TYPE_PEN\n\t\t\t\t\t};\n\t\t\t\t\treleasePoint.type = MSPOINTER_TYPES[e.pointerType];\n\n\t\t\t\t\tif(!releasePoint.type) {\n\t\t\t\t\t\treleasePoint.type = e.pointerType || 'mouse';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treleasePoint.type = e.pointerType || 'mouse';\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tvar touchList = _getTouchPoints(e),\n\t\t\tgestureType,\n\t\t\tnumPoints = touchList.length;\n\n\t\tif(e.type === 'mouseup') {\n\t\t\tnumPoints = 0;\n\t\t}\n\n\t\t// Do nothing if there were 3 touch points or more\n\t\tif(numPoints === 2) {\n\t\t\t_currentPoints = null;\n\t\t\treturn true;\n\t\t}\n\n\t\t// if second pointer released\n\t\tif(numPoints === 1) {\n\t\t\t_equalizePoints(_startPoint, touchList[0]);\n\t\t}\t\t\t\t\n\n\n\t\t// pointer hasn't moved, send \"tap release\" point\n\t\tif(numPoints === 0 && !_direction && !_mainScrollAnimating) {\n\t\t\tif(!releasePoint) {\n\t\t\t\tif(e.type === 'mouseup') {\n\t\t\t\t\treleasePoint = {x: e.pageX, y: e.pageY, type:'mouse'};\n\t\t\t\t} else if(e.changedTouches && e.changedTouches[0]) {\n\t\t\t\t\treleasePoint = {x: e.changedTouches[0].pageX, y: e.changedTouches[0].pageY, type:'touch'};\n\t\t\t\t}\t\t\n\t\t\t}\n\n\t\t\t_shout('touchRelease', e, releasePoint);\n\t\t}\n\n\t\t// Difference in time between releasing of two last touch points (zoom gesture)\n\t\tvar releaseTimeDiff = -1;\n\n\t\t// Gesture completed, no pointers left\n\t\tif(numPoints === 0) {\n\t\t\t_isDragging = false;\n\t\t\tframework.unbind(window, _upMoveEvents, self);\n\n\t\t\t_stopDragUpdateLoop();\n\n\t\t\tif(_isZooming) {\n\t\t\t\t// Two points released at the same time\n\t\t\t\treleaseTimeDiff = 0;\n\t\t\t} else if(_lastReleaseTime !== -1) {\n\t\t\t\treleaseTimeDiff = _getCurrentTime() - _lastReleaseTime;\n\t\t\t}\n\t\t}\n\t\t_lastReleaseTime = numPoints === 1 ? _getCurrentTime() : -1;\n\t\t\n\t\tif(releaseTimeDiff !== -1 && releaseTimeDiff < 150) {\n\t\t\tgestureType = 'zoom';\n\t\t} else {\n\t\t\tgestureType = 'swipe';\n\t\t}\n\n\t\tif(_isZooming && numPoints < 2) {\n\t\t\t_isZooming = false;\n\n\t\t\t// Only second point released\n\t\t\tif(numPoints === 1) {\n\t\t\t\tgestureType = 'zoomPointerUp';\n\t\t\t}\n\t\t\t_shout('zoomGestureEnded');\n\t\t}\n\n\t\t_currentPoints = null;\n\t\tif(!_moved && !_zoomStarted && !_mainScrollAnimating && !_verticalDragInitiated) {\n\t\t\t// nothing to animate\n\t\t\treturn;\n\t\t}\n\t\n\t\t_stopAllAnimations();\n\n\t\t\n\t\tif(!_releaseAnimData) {\n\t\t\t_releaseAnimData = _initDragReleaseAnimationData();\n\t\t}\n\t\t\n\t\t_releaseAnimData.calculateSwipeSpeed('x');\n\n\n\t\tif(_verticalDragInitiated) {\n\n\t\t\tvar opacityRatio = _calculateVerticalDragOpacityRatio();\n\n\t\t\tif(opacityRatio < _options.verticalDragRange) {\n\t\t\t\tself.close();\n\t\t\t} else {\n\t\t\t\tvar initalPanY = _panOffset.y,\n\t\t\t\t\tinitialBgOpacity = _bgOpacity;\n\n\t\t\t\t_animateProp('verticalDrag', 0, 1, 300, framework.easing.cubic.out, function(now) {\n\t\t\t\t\t\n\t\t\t\t\t_panOffset.y = (self.currItem.initialPosition.y - initalPanY) * now + initalPanY;\n\n\t\t\t\t\t_applyBgOpacity( (1 - initialBgOpacity) * now + initialBgOpacity );\n\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t});\n\n\t\t\t\t_shout('onVerticalDrag', 1);\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\n\t\t// main scroll \n\t\tif( (_mainScrollShifted || _mainScrollAnimating) && numPoints === 0) {\n\t\t\tvar itemChanged = _finishSwipeMainScrollGesture(gestureType, _releaseAnimData);\n\t\t\tif(itemChanged) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgestureType = 'zoomPointerUp';\n\t\t}\n\n\t\t// prevent zoom/pan animation when main scroll animation runs\n\t\tif(_mainScrollAnimating) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Complete simple zoom gesture (reset zoom level if it's out of the bounds) \n\t\tif(gestureType !== 'swipe') {\n\t\t\t_completeZoomGesture();\n\t\t\treturn;\n\t\t}\n\t\n\t\t// Complete pan gesture if main scroll is not shifted, and it's possible to pan current image\n\t\tif(!_mainScrollShifted && _currZoomLevel > self.currItem.fitRatio) {\n\t\t\t_completePanGesture(_releaseAnimData);\n\t\t}\n\t},\n\n\n\t// Returns object with data about gesture\n\t// It's created only once and then reused\n\t_initDragReleaseAnimationData = function() {\n\t\t// temp local vars\n\t\tvar lastFlickDuration,\n\t\t\ttempReleasePos;\n\n\t\t// s = this\n\t\tvar s = {\n\t\t\tlastFlickOffset: {},\n\t\t\tlastFlickDist: {},\n\t\t\tlastFlickSpeed: {},\n\t\t\tslowDownRatio: {},\n\t\t\tslowDownRatioReverse: {},\n\t\t\tspeedDecelerationRatio: {},\n\t\t\tspeedDecelerationRatioAbs: {},\n\t\t\tdistanceOffset: {},\n\t\t\tbackAnimDestination: {},\n\t\t\tbackAnimStarted: {},\n\t\t\tcalculateSwipeSpeed: function(axis) {\n\t\t\t\t\n\n\t\t\t\tif( _posPoints.length > 1) {\n\t\t\t\t\tlastFlickDuration = _getCurrentTime() - _gestureCheckSpeedTime + 50;\n\t\t\t\t\ttempReleasePos = _posPoints[_posPoints.length-2][axis];\n\t\t\t\t} else {\n\t\t\t\t\tlastFlickDuration = _getCurrentTime() - _gestureStartTime; // total gesture duration\n\t\t\t\t\ttempReleasePos = _startPoint[axis];\n\t\t\t\t}\n\t\t\t\ts.lastFlickOffset[axis] = _currPoint[axis] - tempReleasePos;\n\t\t\t\ts.lastFlickDist[axis] = Math.abs(s.lastFlickOffset[axis]);\n\t\t\t\tif(s.lastFlickDist[axis] > 20) {\n\t\t\t\t\ts.lastFlickSpeed[axis] = s.lastFlickOffset[axis] / lastFlickDuration;\n\t\t\t\t} else {\n\t\t\t\t\ts.lastFlickSpeed[axis] = 0;\n\t\t\t\t}\n\t\t\t\tif( Math.abs(s.lastFlickSpeed[axis]) < 0.1 ) {\n\t\t\t\t\ts.lastFlickSpeed[axis] = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ts.slowDownRatio[axis] = 0.95;\n\t\t\t\ts.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis];\n\t\t\t\ts.speedDecelerationRatio[axis] = 1;\n\t\t\t},\n\n\t\t\tcalculateOverBoundsAnimOffset: function(axis, speed) {\n\t\t\t\tif(!s.backAnimStarted[axis]) {\n\n\t\t\t\t\tif(_panOffset[axis] > _currPanBounds.min[axis]) {\n\t\t\t\t\t\ts.backAnimDestination[axis] = _currPanBounds.min[axis];\n\t\t\t\t\t\t\n\t\t\t\t\t} else if(_panOffset[axis] < _currPanBounds.max[axis]) {\n\t\t\t\t\t\ts.backAnimDestination[axis] = _currPanBounds.max[axis];\n\t\t\t\t\t}\n\n\t\t\t\t\tif(s.backAnimDestination[axis] !== undefined) {\n\t\t\t\t\t\ts.slowDownRatio[axis] = 0.7;\n\t\t\t\t\t\ts.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis];\n\t\t\t\t\t\tif(s.speedDecelerationRatioAbs[axis] < 0.05) {\n\n\t\t\t\t\t\t\ts.lastFlickSpeed[axis] = 0;\n\t\t\t\t\t\t\ts.backAnimStarted[axis] = true;\n\n\t\t\t\t\t\t\t_animateProp('bounceZoomPan'+axis,_panOffset[axis], \n\t\t\t\t\t\t\t\ts.backAnimDestination[axis], \n\t\t\t\t\t\t\t\tspeed || 300, \n\t\t\t\t\t\t\t\tframework.easing.sine.out, \n\t\t\t\t\t\t\t\tfunction(pos) {\n\t\t\t\t\t\t\t\t\t_panOffset[axis] = pos;\n\t\t\t\t\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t// Reduces the speed by slowDownRatio (per 10ms)\n\t\t\tcalculateAnimOffset: function(axis) {\n\t\t\t\tif(!s.backAnimStarted[axis]) {\n\t\t\t\t\ts.speedDecelerationRatio[axis] = s.speedDecelerationRatio[axis] * (s.slowDownRatio[axis] + \n\t\t\t\t\t\t\t\t\t\t\t\ts.slowDownRatioReverse[axis] - \n\t\t\t\t\t\t\t\t\t\t\t\ts.slowDownRatioReverse[axis] * s.timeDiff / 10);\n\n\t\t\t\t\ts.speedDecelerationRatioAbs[axis] = Math.abs(s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis]);\n\t\t\t\t\ts.distanceOffset[axis] = s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis] * s.timeDiff;\n\t\t\t\t\t_panOffset[axis] += s.distanceOffset[axis];\n\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tpanAnimLoop: function() {\n\t\t\t\tif ( _animations.zoomPan ) {\n\t\t\t\t\t_animations.zoomPan.raf = _requestAF(s.panAnimLoop);\n\n\t\t\t\t\ts.now = _getCurrentTime();\n\t\t\t\t\ts.timeDiff = s.now - s.lastNow;\n\t\t\t\t\ts.lastNow = s.now;\n\t\t\t\t\t\n\t\t\t\t\ts.calculateAnimOffset('x');\n\t\t\t\t\ts.calculateAnimOffset('y');\n\n\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t\n\t\t\t\t\ts.calculateOverBoundsAnimOffset('x');\n\t\t\t\t\ts.calculateOverBoundsAnimOffset('y');\n\n\n\t\t\t\t\tif (s.speedDecelerationRatioAbs.x < 0.05 && s.speedDecelerationRatioAbs.y < 0.05) {\n\n\t\t\t\t\t\t// round pan position\n\t\t\t\t\t\t_panOffset.x = Math.round(_panOffset.x);\n\t\t\t\t\t\t_panOffset.y = Math.round(_panOffset.y);\n\t\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t\t\n\t\t\t\t\t\t_stopAnimation('zoomPan');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\treturn s;\n\t},\n\n\t_completePanGesture = function(animData) {\n\t\t// calculate swipe speed for Y axis (paanning)\n\t\tanimData.calculateSwipeSpeed('y');\n\n\t\t_currPanBounds = self.currItem.bounds;\n\t\t\n\t\tanimData.backAnimDestination = {};\n\t\tanimData.backAnimStarted = {};\n\n\t\t// Avoid acceleration animation if speed is too low\n\t\tif(Math.abs(animData.lastFlickSpeed.x) <= 0.05 && Math.abs(animData.lastFlickSpeed.y) <= 0.05 ) {\n\t\t\tanimData.speedDecelerationRatioAbs.x = animData.speedDecelerationRatioAbs.y = 0;\n\n\t\t\t// Run pan drag release animation. E.g. if you drag image and release finger without momentum.\n\t\t\tanimData.calculateOverBoundsAnimOffset('x');\n\t\t\tanimData.calculateOverBoundsAnimOffset('y');\n\t\t\treturn true;\n\t\t}\n\n\t\t// Animation loop that controls the acceleration after pan gesture ends\n\t\t_registerStartAnimation('zoomPan');\n\t\tanimData.lastNow = _getCurrentTime();\n\t\tanimData.panAnimLoop();\n\t},\n\n\n\t_finishSwipeMainScrollGesture = function(gestureType, _releaseAnimData) {\n\t\tvar itemChanged;\n\t\tif(!_mainScrollAnimating) {\n\t\t\t_currZoomedItemIndex = _currentItemIndex;\n\t\t}\n\n\n\t\t\n\t\tvar itemsDiff;\n\n\t\tif(gestureType === 'swipe') {\n\t\t\tvar totalShiftDist = _currPoint.x - _startPoint.x,\n\t\t\t\tisFastLastFlick = _releaseAnimData.lastFlickDist.x < 10;\n\n\t\t\t// if container is shifted for more than MIN_SWIPE_DISTANCE, \n\t\t\t// and last flick gesture was in right direction\n\t\t\tif(totalShiftDist > MIN_SWIPE_DISTANCE && \n\t\t\t\t(isFastLastFlick || _releaseAnimData.lastFlickOffset.x > 20) ) {\n\t\t\t\t// go to prev item\n\t\t\t\titemsDiff = -1;\n\t\t\t} else if(totalShiftDist < -MIN_SWIPE_DISTANCE && \n\t\t\t\t(isFastLastFlick || _releaseAnimData.lastFlickOffset.x < -20) ) {\n\t\t\t\t// go to next item\n\t\t\t\titemsDiff = 1;\n\t\t\t}\n\t\t}\n\n\t\tvar nextCircle;\n\n\t\tif(itemsDiff) {\n\t\t\t\n\t\t\t_currentItemIndex += itemsDiff;\n\n\t\t\tif(_currentItemIndex < 0) {\n\t\t\t\t_currentItemIndex = _options.loop ? _getNumItems()-1 : 0;\n\t\t\t\tnextCircle = true;\n\t\t\t} else if(_currentItemIndex >= _getNumItems()) {\n\t\t\t\t_currentItemIndex = _options.loop ? 0 : _getNumItems()-1;\n\t\t\t\tnextCircle = true;\n\t\t\t}\n\n\t\t\tif(!nextCircle || _options.loop) {\n\t\t\t\t_indexDiff += itemsDiff;\n\t\t\t\t_currPositionIndex -= itemsDiff;\n\t\t\t\titemChanged = true;\n\t\t\t}\n\t\t\t\n\n\t\t\t\n\t\t}\n\n\t\tvar animateToX = _slideSize.x * _currPositionIndex;\n\t\tvar animateToDist = Math.abs( animateToX - _mainScrollPos.x );\n\t\tvar finishAnimDuration;\n\n\n\t\tif(!itemChanged && animateToX > _mainScrollPos.x !== _releaseAnimData.lastFlickSpeed.x > 0) {\n\t\t\t// \"return to current\" duration, e.g. when dragging from slide 0 to -1\n\t\t\tfinishAnimDuration = 333; \n\t\t} else {\n\t\t\tfinishAnimDuration = Math.abs(_releaseAnimData.lastFlickSpeed.x) > 0 ? \n\t\t\t\t\t\t\t\t\tanimateToDist / Math.abs(_releaseAnimData.lastFlickSpeed.x) : \n\t\t\t\t\t\t\t\t\t333;\n\n\t\t\tfinishAnimDuration = Math.min(finishAnimDuration, 400);\n\t\t\tfinishAnimDuration = Math.max(finishAnimDuration, 250);\n\t\t}\n\n\t\tif(_currZoomedItemIndex === _currentItemIndex) {\n\t\t\titemChanged = false;\n\t\t}\n\t\t\n\t\t_mainScrollAnimating = true;\n\t\t\n\t\t_shout('mainScrollAnimStart');\n\n\t\t_animateProp('mainScroll', _mainScrollPos.x, animateToX, finishAnimDuration, framework.easing.cubic.out, \n\t\t\t_moveMainScroll,\n\t\t\tfunction() {\n\t\t\t\t_stopAllAnimations();\n\t\t\t\t_mainScrollAnimating = false;\n\t\t\t\t_currZoomedItemIndex = -1;\n\t\t\t\t\n\t\t\t\tif(itemChanged || _currZoomedItemIndex !== _currentItemIndex) {\n\t\t\t\t\tself.updateCurrItem();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_shout('mainScrollAnimComplete');\n\t\t\t}\n\t\t);\n\n\t\tif(itemChanged) {\n\t\t\tself.updateCurrItem(true);\n\t\t}\n\n\t\treturn itemChanged;\n\t},\n\n\t_calculateZoomLevel = function(touchesDistance) {\n\t\treturn 1 / _startPointsDistance * touchesDistance * _startZoomLevel;\n\t},\n\n\t// Resets zoom if it's out of bounds\n\t_completeZoomGesture = function() {\n\t\tvar destZoomLevel = _currZoomLevel,\n\t\t\tminZoomLevel = _getMinZoomLevel(),\n\t\t\tmaxZoomLevel = _getMaxZoomLevel();\n\n\t\tif ( _currZoomLevel < minZoomLevel ) {\n\t\t\tdestZoomLevel = minZoomLevel;\n\t\t} else if ( _currZoomLevel > maxZoomLevel ) {\n\t\t\tdestZoomLevel = maxZoomLevel;\n\t\t}\n\n\t\tvar destOpacity = 1,\n\t\t\tonUpdate,\n\t\t\tinitialOpacity = _bgOpacity;\n\n\t\tif(_opacityChanged && !_isZoomingIn && !_wasOverInitialZoom && _currZoomLevel < minZoomLevel) {\n\t\t\t//_closedByScroll = true;\n\t\t\tself.close();\n\t\t\treturn true;\n\t\t}\n\n\t\tif(_opacityChanged) {\n\t\t\tonUpdate = function(now) {\n\t\t\t\t_applyBgOpacity( (destOpacity - initialOpacity) * now + initialOpacity );\n\t\t\t};\n\t\t}\n\n\t\tself.zoomTo(destZoomLevel, 0, 200, framework.easing.cubic.out, onUpdate);\n\t\treturn true;\n\t};\n\n\n_registerModule('Gestures', {\n\tpublicMethods: {\n\n\t\tinitGestures: function() {\n\n\t\t\t// helper function that builds touch/pointer/mouse events\n\t\t\tvar addEventNames = function(pref, down, move, up, cancel) {\n\t\t\t\t_dragStartEvent = pref + down;\n\t\t\t\t_dragMoveEvent = pref + move;\n\t\t\t\t_dragEndEvent = pref + up;\n\t\t\t\tif(cancel) {\n\t\t\t\t\t_dragCancelEvent = pref + cancel;\n\t\t\t\t} else {\n\t\t\t\t\t_dragCancelEvent = '';\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t_pointerEventEnabled = _features.pointerEvent;\n\t\t\tif(_pointerEventEnabled && _features.touch) {\n\t\t\t\t// we don't need touch events, if browser supports pointer events\n\t\t\t\t_features.touch = false;\n\t\t\t}\n\n\t\t\tif(_pointerEventEnabled) {\n\t\t\t\tif(navigator.msPointerEnabled) {\n\t\t\t\t\t// IE10 pointer events are case-sensitive\n\t\t\t\t\taddEventNames('MSPointer', 'Down', 'Move', 'Up', 'Cancel');\n\t\t\t\t} else {\n\t\t\t\t\taddEventNames('pointer', 'down', 'move', 'up', 'cancel');\n\t\t\t\t}\n\t\t\t} else if(_features.touch) {\n\t\t\t\taddEventNames('touch', 'start', 'move', 'end', 'cancel');\n\t\t\t\t_likelyTouchDevice = true;\n\t\t\t} else {\n\t\t\t\taddEventNames('mouse', 'down', 'move', 'up');\t\n\t\t\t}\n\n\t\t\t_upMoveEvents = _dragMoveEvent + ' ' + _dragEndEvent + ' ' + _dragCancelEvent;\n\t\t\t_downEvents = _dragStartEvent;\n\n\t\t\tif(_pointerEventEnabled && !_likelyTouchDevice) {\n\t\t\t\t_likelyTouchDevice = (navigator.maxTouchPoints > 1) || (navigator.msMaxTouchPoints > 1);\n\t\t\t}\n\t\t\t// make variable public\n\t\t\tself.likelyTouchDevice = _likelyTouchDevice; \n\t\t\t\n\t\t\t_globalEventHandlers[_dragStartEvent] = _onDragStart;\n\t\t\t_globalEventHandlers[_dragMoveEvent] = _onDragMove;\n\t\t\t_globalEventHandlers[_dragEndEvent] = _onDragRelease; // the Kraken\n\n\t\t\tif(_dragCancelEvent) {\n\t\t\t\t_globalEventHandlers[_dragCancelEvent] = _globalEventHandlers[_dragEndEvent];\n\t\t\t}\n\n\t\t\t// Bind mouse events on device with detected hardware touch support, in case it supports multiple types of input.\n\t\t\tif(_features.touch) {\n\t\t\t\t_downEvents += ' mousedown';\n\t\t\t\t_upMoveEvents += ' mousemove mouseup';\n\t\t\t\t_globalEventHandlers.mousedown = _globalEventHandlers[_dragStartEvent];\n\t\t\t\t_globalEventHandlers.mousemove = _globalEventHandlers[_dragMoveEvent];\n\t\t\t\t_globalEventHandlers.mouseup = _globalEventHandlers[_dragEndEvent];\n\t\t\t}\n\n\t\t\tif(!_likelyTouchDevice) {\n\t\t\t\t// don't allow pan to next slide from zoomed state on Desktop\n\t\t\t\t_options.allowPanToNext = false;\n\t\t\t}\n\t\t}\n\n\t}\n});\n\n\n/*>>gestures*/\n\n/*>>show-hide-transition*/\n/**\n * show-hide-transition.js:\n *\n * Manages initial opening or closing transition.\n *\n * If you're not planning to use transition for gallery at all,\n * you may set options hideAnimationDuration and showAnimationDuration to 0,\n * and just delete startAnimation function.\n * \n */\n\n\nvar _showOrHideTimeout,\n\t_showOrHide = function(item, img, out, completeFn) {\n\n\t\tif(_showOrHideTimeout) {\n\t\t\tclearTimeout(_showOrHideTimeout);\n\t\t}\n\n\t\t_initialZoomRunning = true;\n\t\t_initialContentSet = true;\n\t\t\n\t\t// dimensions of small thumbnail {x:,y:,w:}.\n\t\t// Height is optional, as calculated based on large image.\n\t\tvar thumbBounds; \n\t\tif(item.initialLayout) {\n\t\t\tthumbBounds = item.initialLayout;\n\t\t\titem.initialLayout = null;\n\t\t} else {\n\t\t\tthumbBounds = _options.getThumbBoundsFn && _options.getThumbBoundsFn(_currentItemIndex);\n\t\t}\n\n\t\tvar duration = out ? _options.hideAnimationDuration : _options.showAnimationDuration;\n\n\t\tvar onComplete = function() {\n\t\t\t_stopAnimation('initialZoom');\n\t\t\tif(!out) {\n\t\t\t\t_applyBgOpacity(1);\n\t\t\t\tif(img) {\n\t\t\t\t\timg.style.display = 'block';\n\t\t\t\t}\n\t\t\t\tframework.addClass(template, 'pswp--animated-in');\n\t\t\t\t_shout('initialZoom' + (out ? 'OutEnd' : 'InEnd'));\n\t\t\t} else {\n\t\t\t\tself.template.removeAttribute('style');\n\t\t\t\tself.bg.removeAttribute('style');\n\t\t\t}\n\n\t\t\tif(completeFn) {\n\t\t\t\tcompleteFn();\n\t\t\t}\n\t\t\t_initialZoomRunning = false;\n\t\t};\n\n\t\t// if bounds aren't provided, just open gallery without animation\n\t\tif(!duration || !thumbBounds || thumbBounds.x === undefined) {\n\n\t\t\t_shout('initialZoom' + (out ? 'Out' : 'In') );\n\n\t\t\t_currZoomLevel = item.initialZoomLevel;\n\t\t\t_equalizePoints(_panOffset, item.initialPosition );\n\t\t\t_applyCurrentZoomPan();\n\n\t\t\ttemplate.style.opacity = out ? 0 : 1;\n\t\t\t_applyBgOpacity(1);\n\n\t\t\tif(duration) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tonComplete();\n\t\t\t\t}, duration);\n\t\t\t} else {\n\t\t\t\tonComplete();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvar startAnimation = function() {\n\t\t\tvar closeWithRaf = _closedByScroll,\n\t\t\t\tfadeEverything = !self.currItem.src || self.currItem.loadError || _options.showHideOpacity;\n\t\t\t\n\t\t\t// apply hw-acceleration to image\n\t\t\tif(item.miniImg) {\n\t\t\t\titem.miniImg.style.webkitBackfaceVisibility = 'hidden';\n\t\t\t}\n\n\t\t\tif(!out) {\n\t\t\t\t_currZoomLevel = thumbBounds.w / item.w;\n\t\t\t\t_panOffset.x = thumbBounds.x;\n\t\t\t\t_panOffset.y = thumbBounds.y - _initalWindowScrollY;\n\n\t\t\t\tself[fadeEverything ? 'template' : 'bg'].style.opacity = 0.001;\n\t\t\t\t_applyCurrentZoomPan();\n\t\t\t}\n\n\t\t\t_registerStartAnimation('initialZoom');\n\t\t\t\n\t\t\tif(out && !closeWithRaf) {\n\t\t\t\tframework.removeClass(template, 'pswp--animated-in');\n\t\t\t}\n\n\t\t\tif(fadeEverything) {\n\t\t\t\tif(out) {\n\t\t\t\t\tframework[ (closeWithRaf ? 'remove' : 'add') + 'Class' ](template, 'pswp--animate_opacity');\n\t\t\t\t} else {\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\tframework.addClass(template, 'pswp--animate_opacity');\n\t\t\t\t\t}, 30);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_showOrHideTimeout = setTimeout(function() {\n\n\t\t\t\t_shout('initialZoom' + (out ? 'Out' : 'In') );\n\t\t\t\t\n\n\t\t\t\tif(!out) {\n\n\t\t\t\t\t// \"in\" animation always uses CSS transitions (instead of rAF).\n\t\t\t\t\t// CSS transition work faster here, \n\t\t\t\t\t// as developer may also want to animate other things, \n\t\t\t\t\t// like ui on top of sliding area, which can be animated just via CSS\n\t\t\t\t\t\n\t\t\t\t\t_currZoomLevel = item.initialZoomLevel;\n\t\t\t\t\t_equalizePoints(_panOffset, item.initialPosition );\n\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t_applyBgOpacity(1);\n\n\t\t\t\t\tif(fadeEverything) {\n\t\t\t\t\t\ttemplate.style.opacity = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_applyBgOpacity(1);\n\t\t\t\t\t}\n\n\t\t\t\t\t_showOrHideTimeout = setTimeout(onComplete, duration + 20);\n\t\t\t\t} else {\n\n\t\t\t\t\t// \"out\" animation uses rAF only when PhotoSwipe is closed by browser scroll, to recalculate position\n\t\t\t\t\tvar destZoomLevel = thumbBounds.w / item.w,\n\t\t\t\t\t\tinitialPanOffset = {\n\t\t\t\t\t\t\tx: _panOffset.x,\n\t\t\t\t\t\t\ty: _panOffset.y\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinitialZoomLevel = _currZoomLevel,\n\t\t\t\t\t\tinitalBgOpacity = _bgOpacity,\n\t\t\t\t\t\tonUpdate = function(now) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(now === 1) {\n\t\t\t\t\t\t\t\t_currZoomLevel = destZoomLevel;\n\t\t\t\t\t\t\t\t_panOffset.x = thumbBounds.x;\n\t\t\t\t\t\t\t\t_panOffset.y = thumbBounds.y - _currentWindowScrollY;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_currZoomLevel = (destZoomLevel - initialZoomLevel) * now + initialZoomLevel;\n\t\t\t\t\t\t\t\t_panOffset.x = (thumbBounds.x - initialPanOffset.x) * now + initialPanOffset.x;\n\t\t\t\t\t\t\t\t_panOffset.y = (thumbBounds.y - _currentWindowScrollY - initialPanOffset.y) * now + initialPanOffset.y;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_applyCurrentZoomPan();\n\t\t\t\t\t\t\tif(fadeEverything) {\n\t\t\t\t\t\t\t\ttemplate.style.opacity = 1 - now;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_applyBgOpacity( initalBgOpacity - now * initalBgOpacity );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\tif(closeWithRaf) {\n\t\t\t\t\t\t_animateProp('initialZoom', 0, 1, duration, framework.easing.cubic.out, onUpdate, onComplete);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonUpdate(1);\n\t\t\t\t\t\t_showOrHideTimeout = setTimeout(onComplete, duration + 20);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}, out ? 25 : 90); // Main purpose of this delay is to give browser time to paint and\n\t\t\t\t\t// create composite layers of PhotoSwipe UI parts (background, controls, caption, arrows).\n\t\t\t\t\t// Which avoids lag at the beginning of scale transition.\n\t\t};\n\t\tstartAnimation();\n\n\t\t\n\t};\n\n/*>>show-hide-transition*/\n\n/*>>items-controller*/\n/**\n*\n* Controller manages gallery items, their dimensions, and their content.\n* \n*/\n\nvar _items,\n\t_tempPanAreaSize = {},\n\t_imagesToAppendPool = [],\n\t_initialContentSet,\n\t_initialZoomRunning,\n\t_controllerDefaultOptions = {\n\t\tindex: 0,\n\t\terrorMsg: '<div class=\"pswp__error-msg\"><a href=\"%url%\" target=\"_blank\">The image</a> could not be loaded.</div>',\n\t\tforceProgressiveLoading: false, // TODO\n\t\tpreload: [1,1],\n\t\tgetNumItemsFn: function() {\n\t\t\treturn _items.length;\n\t\t}\n\t};\n\n\nvar _getItemAt,\n\t_getNumItems,\n\t_initialIsLoop,\n\t_getZeroBounds = function() {\n\t\treturn {\n\t\t\tcenter:{x:0,y:0}, \n\t\t\tmax:{x:0,y:0}, \n\t\t\tmin:{x:0,y:0}\n\t\t};\n\t},\n\t_calculateSingleItemPanBounds = function(item, realPanElementW, realPanElementH ) {\n\t\tvar bounds = item.bounds;\n\n\t\t// position of element when it's centered\n\t\tbounds.center.x = Math.round((_tempPanAreaSize.x - realPanElementW) / 2);\n\t\tbounds.center.y = Math.round((_tempPanAreaSize.y - realPanElementH) / 2) + item.vGap.top;\n\n\t\t// maximum pan position\n\t\tbounds.max.x = (realPanElementW > _tempPanAreaSize.x) ? \n\t\t\t\t\t\t\tMath.round(_tempPanAreaSize.x - realPanElementW) : \n\t\t\t\t\t\t\tbounds.center.x;\n\t\t\n\t\tbounds.max.y = (realPanElementH > _tempPanAreaSize.y) ? \n\t\t\t\t\t\t\tMath.round(_tempPanAreaSize.y - realPanElementH) + item.vGap.top : \n\t\t\t\t\t\t\tbounds.center.y;\n\t\t\n\t\t// minimum pan position\n\t\tbounds.min.x = (realPanElementW > _tempPanAreaSize.x) ? 0 : bounds.center.x;\n\t\tbounds.min.y = (realPanElementH > _tempPanAreaSize.y) ? item.vGap.top : bounds.center.y;\n\t},\n\t_calculateItemSize = function(item, viewportSize, zoomLevel) {\n\n\t\tif (item.src && !item.loadError) {\n\t\t\tvar isInitial = !zoomLevel;\n\t\t\t\n\t\t\tif(isInitial) {\n\t\t\t\tif(!item.vGap) {\n\t\t\t\t\titem.vGap = {top:0,bottom:0};\n\t\t\t\t}\n\t\t\t\t// allows overriding vertical margin for individual items\n\t\t\t\t_shout('parseVerticalMargin', item);\n\t\t\t}\n\n\n\t\t\t_tempPanAreaSize.x = viewportSize.x;\n\t\t\t_tempPanAreaSize.y = viewportSize.y - item.vGap.top - item.vGap.bottom;\n\n\t\t\tif (isInitial) {\n\t\t\t\tvar hRatio = _tempPanAreaSize.x / item.w;\n\t\t\t\tvar vRatio = _tempPanAreaSize.y / item.h;\n\n\t\t\t\titem.fitRatio = hRatio < vRatio ? hRatio : vRatio;\n\t\t\t\t//item.fillRatio = hRatio > vRatio ? hRatio : vRatio;\n\n\t\t\t\tvar scaleMode = _options.scaleMode;\n\n\t\t\t\tif (scaleMode === 'orig') {\n\t\t\t\t\tzoomLevel = 1;\n\t\t\t\t} else if (scaleMode === 'fit') {\n\t\t\t\t\tzoomLevel = item.fitRatio;\n\t\t\t\t}\n\n\t\t\t\tif (zoomLevel > 1) {\n\t\t\t\t\tzoomLevel = 1;\n\t\t\t\t}\n\n\t\t\t\titem.initialZoomLevel = zoomLevel;\n\t\t\t\t\n\t\t\t\tif(!item.bounds) {\n\t\t\t\t\t// reuse bounds object\n\t\t\t\t\titem.bounds = _getZeroBounds(); \n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!zoomLevel) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_calculateSingleItemPanBounds(item, item.w * zoomLevel, item.h * zoomLevel);\n\n\t\t\tif (isInitial && zoomLevel === item.initialZoomLevel) {\n\t\t\t\titem.initialPosition = item.bounds.center;\n\t\t\t}\n\n\t\t\treturn item.bounds;\n\t\t} else {\n\t\t\titem.w = item.h = 0;\n\t\t\titem.initialZoomLevel = item.fitRatio = 1;\n\t\t\titem.bounds = _getZeroBounds();\n\t\t\titem.initialPosition = item.bounds.center;\n\n\t\t\t// if it's not image, we return zero bounds (content is not zoomable)\n\t\t\treturn item.bounds;\n\t\t}\n\t\t\n\t},\n\n\t\n\n\n\t_appendImage = function(index, item, baseDiv, img, preventAnimation, keepPlaceholder) {\n\t\t\n\n\t\tif(item.loadError) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(img) {\n\n\t\t\titem.imageAppended = true;\n\t\t\t_setImageSize(item, img, (item === self.currItem && _renderMaxResolution) );\n\t\t\t\n\t\t\tbaseDiv.appendChild(img);\n\n\t\t\tif(keepPlaceholder) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif(item && item.loaded && item.placeholder) {\n\t\t\t\t\t\titem.placeholder.style.display = 'none';\n\t\t\t\t\t\titem.placeholder = null;\n\t\t\t\t\t}\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t}\n\t},\n\t\n\n\n\t_preloadImage = function(item) {\n\t\titem.loading = true;\n\t\titem.loaded = false;\n\t\tvar img = item.img = framework.createEl('pswp__img', 'img');\n\t\tvar onComplete = function() {\n\t\t\titem.loading = false;\n\t\t\titem.loaded = true;\n\n\t\t\tif(item.loadComplete) {\n\t\t\t\titem.loadComplete(item);\n\t\t\t} else {\n\t\t\t\titem.img = null; // no need to store image object\n\t\t\t}\n\t\t\timg.onload = img.onerror = null;\n\t\t\timg = null;\n\t\t};\n\t\timg.onload = onComplete;\n\t\timg.onerror = function() {\n\t\t\titem.loadError = true;\n\t\t\tonComplete();\n\t\t};\t\t\n\n\t\timg.src = item.src;// + '?a=' + Math.random();\n\n\t\treturn img;\n\t},\n\t_checkForError = function(item, cleanUp) {\n\t\tif(item.src && item.loadError && item.container) {\n\n\t\t\tif(cleanUp) {\n\t\t\t\titem.container.innerHTML = '';\n\t\t\t}\n\n\t\t\titem.container.innerHTML = _options.errorMsg.replace('%url%', item.src );\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\t},\n\t_setImageSize = function(item, img, maxRes) {\n\t\tif(!item.src) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(!img) {\n\t\t\timg = item.container.lastChild;\n\t\t}\n\n\t\tvar w = maxRes ? item.w : Math.round(item.w * item.fitRatio),\n\t\t\th = maxRes ? item.h : Math.round(item.h * item.fitRatio);\n\t\t\n\t\tif(item.placeholder && !item.loaded) {\n\t\t\titem.placeholder.style.width = w + 'px';\n\t\t\titem.placeholder.style.height = h + 'px';\n\t\t}\n\n\t\timg.style.width = w + 'px';\n\t\timg.style.height = h + 'px';\n\t},\n\t_appendImagesPool = function() {\n\n\t\tif(_imagesToAppendPool.length) {\n\t\t\tvar poolItem;\n\n\t\t\tfor(var i = 0; i < _imagesToAppendPool.length; i++) {\n\t\t\t\tpoolItem = _imagesToAppendPool[i];\n\t\t\t\tif( poolItem.holder.index === poolItem.index ) {\n\t\t\t\t\t_appendImage(poolItem.index, poolItem.item, poolItem.baseDiv, poolItem.img, false, poolItem.clearPlaceholder);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_imagesToAppendPool = [];\n\t\t}\n\t};\n\t\n\n\n_registerModule('Controller', {\n\n\tpublicMethods: {\n\n\t\tlazyLoadItem: function(index) {\n\t\t\tindex = _getLoopedId(index);\n\t\t\tvar item = _getItemAt(index);\n\n\t\t\tif(!item || ((item.loaded || item.loading) && !_itemsNeedUpdate)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_shout('gettingData', index, item);\n\n\t\t\tif (!item.src) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_preloadImage(item);\n\t\t},\n\t\tinitController: function() {\n\t\t\tframework.extend(_options, _controllerDefaultOptions, true);\n\t\t\tself.items = _items = items;\n\t\t\t_getItemAt = self.getItemAt;\n\t\t\t_getNumItems = _options.getNumItemsFn; //self.getNumItems;\n\n\n\n\t\t\t_initialIsLoop = _options.loop;\n\t\t\tif(_getNumItems() < 3) {\n\t\t\t\t_options.loop = false; // disable loop if less then 3 items\n\t\t\t}\n\n\t\t\t_listen('beforeChange', function(diff) {\n\n\t\t\t\tvar p = _options.preload,\n\t\t\t\t\tisNext = diff === null ? true : (diff >= 0),\n\t\t\t\t\tpreloadBefore = Math.min(p[0], _getNumItems() ),\n\t\t\t\t\tpreloadAfter = Math.min(p[1], _getNumItems() ),\n\t\t\t\t\ti;\n\n\n\t\t\t\tfor(i = 1; i <= (isNext ? preloadAfter : preloadBefore); i++) {\n\t\t\t\t\tself.lazyLoadItem(_currentItemIndex+i);\n\t\t\t\t}\n\t\t\t\tfor(i = 1; i <= (isNext ? preloadBefore : preloadAfter); i++) {\n\t\t\t\t\tself.lazyLoadItem(_currentItemIndex-i);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_listen('initialLayout', function() {\n\t\t\t\tself.currItem.initialLayout = _options.getThumbBoundsFn && _options.getThumbBoundsFn(_currentItemIndex);\n\t\t\t});\n\n\t\t\t_listen('mainScrollAnimComplete', _appendImagesPool);\n\t\t\t_listen('initialZoomInEnd', _appendImagesPool);\n\n\n\n\t\t\t_listen('destroy', function() {\n\t\t\t\tvar item;\n\t\t\t\tfor(var i = 0; i < _items.length; i++) {\n\t\t\t\t\titem = _items[i];\n\t\t\t\t\t// remove reference to DOM elements, for GC\n\t\t\t\t\tif(item.container) {\n\t\t\t\t\t\titem.container = null; \n\t\t\t\t\t}\n\t\t\t\t\tif(item.placeholder) {\n\t\t\t\t\t\titem.placeholder = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(item.img) {\n\t\t\t\t\t\titem.img = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(item.preloader) {\n\t\t\t\t\t\titem.preloader = null;\n\t\t\t\t\t}\n\t\t\t\t\tif(item.loadError) {\n\t\t\t\t\t\titem.loaded = item.loadError = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t_imagesToAppendPool = null;\n\t\t\t});\n\t\t},\n\n\n\t\tgetItemAt: function(index) {\n\t\t\tif (index >= 0) {\n\t\t\t\treturn _items[index] !== undefined ? _items[index] : false;\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\n\t\tallowProgressiveImg: function() {\n\t\t\t// 1. Progressive image loading isn't working on webkit/blink \n\t\t\t// when hw-acceleration (e.g. translateZ) is applied to IMG element.\n\t\t\t// That's why in PhotoSwipe parent element gets zoom transform, not image itself.\n\t\t\t// \n\t\t\t// 2. Progressive image loading sometimes blinks in webkit/blink when applying animation to parent element.\n\t\t\t// That's why it's disabled on touch devices (mainly because of swipe transition)\n\t\t\t// \n\t\t\t// 3. Progressive image loading sometimes doesn't work in IE (up to 11).\n\n\t\t\t// Don't allow progressive loading on non-large touch devices\n\t\t\treturn _options.forceProgressiveLoading || !_likelyTouchDevice || _options.mouseUsed || screen.width > 1200; \n\t\t\t// 1200 - to eliminate touch devices with large screen (like Chromebook Pixel)\n\t\t},\n\n\t\tsetContent: function(holder, index) {\n\n\t\t\tif(_options.loop) {\n\t\t\t\tindex = _getLoopedId(index);\n\t\t\t}\n\n\t\t\tvar prevItem = self.getItemAt(holder.index);\n\t\t\tif(prevItem) {\n\t\t\t\tprevItem.container = null;\n\t\t\t}\n\t\n\t\t\tvar item = self.getItemAt(index),\n\t\t\t\timg;\n\t\t\t\n\t\t\tif(!item) {\n\t\t\t\tholder.el.innerHTML = '';\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// allow to override data\n\t\t\t_shout('gettingData', index, item);\n\n\t\t\tholder.index = index;\n\t\t\tholder.item = item;\n\n\t\t\t// base container DIV is created only once for each of 3 holders\n\t\t\tvar baseDiv = item.container = framework.createEl('pswp__zoom-wrap'); \n\n\t\t\t\n\n\t\t\tif(!item.src && item.html) {\n\t\t\t\tif(item.html.tagName) {\n\t\t\t\t\tbaseDiv.appendChild(item.html);\n\t\t\t\t} else {\n\t\t\t\t\tbaseDiv.innerHTML = item.html;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_checkForError(item);\n\n\t\t\t_calculateItemSize(item, _viewportSize);\n\t\t\t\n\t\t\tif(item.src && !item.loadError && !item.loaded) {\n\n\t\t\t\titem.loadComplete = function(item) {\n\n\t\t\t\t\t// gallery closed before image finished loading\n\t\t\t\t\tif(!_isOpen) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// check if holder hasn't changed while image was loading\n\t\t\t\t\tif(holder && holder.index === index ) {\n\t\t\t\t\t\tif( _checkForError(item, true) ) {\n\t\t\t\t\t\t\titem.loadComplete = item.img = null;\n\t\t\t\t\t\t\t_calculateItemSize(item, _viewportSize);\n\t\t\t\t\t\t\t_applyZoomPanToItem(item);\n\n\t\t\t\t\t\t\tif(holder.index === _currentItemIndex) {\n\t\t\t\t\t\t\t\t// recalculate dimensions\n\t\t\t\t\t\t\t\tself.updateCurrZoomItem();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif( !item.imageAppended ) {\n\t\t\t\t\t\t\tif(_features.transform && (_mainScrollAnimating || _initialZoomRunning) ) {\n\t\t\t\t\t\t\t\t_imagesToAppendPool.push({\n\t\t\t\t\t\t\t\t\titem:item,\n\t\t\t\t\t\t\t\t\tbaseDiv:baseDiv,\n\t\t\t\t\t\t\t\t\timg:item.img,\n\t\t\t\t\t\t\t\t\tindex:index,\n\t\t\t\t\t\t\t\t\tholder:holder,\n\t\t\t\t\t\t\t\t\tclearPlaceholder:true\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_appendImage(index, item, baseDiv, item.img, _mainScrollAnimating || _initialZoomRunning, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// remove preloader & mini-img\n\t\t\t\t\t\t\tif(!_initialZoomRunning && item.placeholder) {\n\t\t\t\t\t\t\t\titem.placeholder.style.display = 'none';\n\t\t\t\t\t\t\t\titem.placeholder = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\titem.loadComplete = null;\n\t\t\t\t\titem.img = null; // no need to store image element after it's added\n\n\t\t\t\t\t_shout('imageLoadComplete', index, item);\n\t\t\t\t};\n\n\t\t\t\tif(framework.features.transform) {\n\t\t\t\t\t\n\t\t\t\t\tvar placeholderClassName = 'pswp__img pswp__img--placeholder'; \n\t\t\t\t\tplaceholderClassName += (item.msrc ? '' : ' pswp__img--placeholder--blank');\n\n\t\t\t\t\tvar placeholder = framework.createEl(placeholderClassName, item.msrc ? 'img' : '');\n\t\t\t\t\tif(item.msrc) {\n\t\t\t\t\t\tplaceholder.src = item.msrc;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t_setImageSize(item, placeholder);\n\n\t\t\t\t\tbaseDiv.appendChild(placeholder);\n\t\t\t\t\titem.placeholder = placeholder;\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t\n\n\t\t\t\tif(!item.loading) {\n\t\t\t\t\t_preloadImage(item);\n\t\t\t\t}\n\n\n\t\t\t\tif( self.allowProgressiveImg() ) {\n\t\t\t\t\t// just append image\n\t\t\t\t\tif(!_initialContentSet && _features.transform) {\n\t\t\t\t\t\t_imagesToAppendPool.push({\n\t\t\t\t\t\t\titem:item, \n\t\t\t\t\t\t\tbaseDiv:baseDiv, \n\t\t\t\t\t\t\timg:item.img, \n\t\t\t\t\t\t\tindex:index, \n\t\t\t\t\t\t\tholder:holder\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t_appendImage(index, item, baseDiv, item.img, true, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if(item.src && !item.loadError) {\n\t\t\t\t// image object is created every time, due to bugs of image loading & delay when switching images\n\t\t\t\timg = framework.createEl('pswp__img', 'img');\n\t\t\t\timg.style.opacity = 1;\n\t\t\t\timg.src = item.src;\n\t\t\t\t_setImageSize(item, img);\n\t\t\t\t_appendImage(index, item, baseDiv, img, true);\n\t\t\t}\n\t\t\t\n\n\t\t\tif(!_initialContentSet && index === _currentItemIndex) {\n\t\t\t\t_currZoomElementStyle = baseDiv.style;\n\t\t\t\t_showOrHide(item, (img ||item.img) );\n\t\t\t} else {\n\t\t\t\t_applyZoomPanToItem(item);\n\t\t\t}\n\n\t\t\tholder.el.innerHTML = '';\n\t\t\tholder.el.appendChild(baseDiv);\n\t\t},\n\n\t\tcleanSlide: function( item ) {\n\t\t\tif(item.img ) {\n\t\t\t\titem.img.onload = item.img.onerror = null;\n\t\t\t}\n\t\t\titem.loaded = item.loading = item.img = item.imageAppended = false;\n\t\t}\n\n\t}\n});\n\n/*>>items-controller*/\n\n/*>>tap*/\n/**\n * tap.js:\n *\n * Displatches tap and double-tap events.\n * \n */\n\nvar tapTimer,\n\ttapReleasePoint = {},\n\t_dispatchTapEvent = function(origEvent, releasePoint, pointerType) {\t\t\n\t\tvar e = document.createEvent( 'CustomEvent' ),\n\t\t\teDetail = {\n\t\t\t\torigEvent:origEvent, \n\t\t\t\ttarget:origEvent.target, \n\t\t\t\treleasePoint: releasePoint, \n\t\t\t\tpointerType:pointerType || 'touch'\n\t\t\t};\n\n\t\te.initCustomEvent( 'pswpTap', true, true, eDetail );\n\t\torigEvent.target.dispatchEvent(e);\n\t};\n\n_registerModule('Tap', {\n\tpublicMethods: {\n\t\tinitTap: function() {\n\t\t\t_listen('firstTouchStart', self.onTapStart);\n\t\t\t_listen('touchRelease', self.onTapRelease);\n\t\t\t_listen('destroy', function() {\n\t\t\t\ttapReleasePoint = {};\n\t\t\t\ttapTimer = null;\n\t\t\t});\n\t\t},\n\t\tonTapStart: function(touchList) {\n\t\t\tif(touchList.length > 1) {\n\t\t\t\tclearTimeout(tapTimer);\n\t\t\t\ttapTimer = null;\n\t\t\t}\n\t\t},\n\t\tonTapRelease: function(e, releasePoint) {\n\t\t\tif(!releasePoint) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!_moved && !_isMultitouch && !_numAnimations) {\n\t\t\t\tvar p0 = releasePoint;\n\t\t\t\tif(tapTimer) {\n\t\t\t\t\tclearTimeout(tapTimer);\n\t\t\t\t\ttapTimer = null;\n\n\t\t\t\t\t// Check if taped on the same place\n\t\t\t\t\tif ( _isNearbyPoints(p0, tapReleasePoint) ) {\n\t\t\t\t\t\t_shout('doubleTap', p0);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif(releasePoint.type === 'mouse') {\n\t\t\t\t\t_dispatchTapEvent(e, releasePoint, 'mouse');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar clickedTagName = e.target.tagName.toUpperCase();\n\t\t\t\t// avoid double tap delay on buttons and elements that have class pswp__single-tap\n\t\t\t\tif(clickedTagName === 'BUTTON' || framework.hasClass(e.target, 'pswp__single-tap') ) {\n\t\t\t\t\t_dispatchTapEvent(e, releasePoint);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t_equalizePoints(tapReleasePoint, p0);\n\n\t\t\t\ttapTimer = setTimeout(function() {\n\t\t\t\t\t_dispatchTapEvent(e, releasePoint);\n\t\t\t\t\ttapTimer = null;\n\t\t\t\t}, 300);\n\t\t\t}\n\t\t}\n\t}\n});\n\n/*>>tap*/\n\n/*>>desktop-zoom*/\n/**\n *\n * desktop-zoom.js:\n *\n * - Binds mousewheel event for paning zoomed image.\n * - Manages \"dragging\", \"zoomed-in\", \"zoom-out\" classes.\n * (which are used for cursors and zoom icon)\n * - Adds toggleDesktopZoom function.\n * \n */\n\nvar _wheelDelta;\n\t\n_registerModule('DesktopZoom', {\n\n\tpublicMethods: {\n\n\t\tinitDesktopZoom: function() {\n\n\t\t\tif(_oldIE) {\n\t\t\t\t// no zoom for old IE (<=8)\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(_likelyTouchDevice) {\n\t\t\t\t// if detected hardware touch support, we wait until mouse is used,\n\t\t\t\t// and only then apply desktop-zoom features\n\t\t\t\t_listen('mouseUsed', function() {\n\t\t\t\t\tself.setupDesktopZoom();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tself.setupDesktopZoom(true);\n\t\t\t}\n\n\t\t},\n\n\t\tsetupDesktopZoom: function(onInit) {\n\n\t\t\t_wheelDelta = {};\n\n\t\t\tvar events = 'wheel mousewheel DOMMouseScroll';\n\t\t\t\n\t\t\t_listen('bindEvents', function() {\n\t\t\t\tframework.bind(template, events, self.handleMouseWheel);\n\t\t\t});\n\n\t\t\t_listen('unbindEvents', function() {\n\t\t\t\tif(_wheelDelta) {\n\t\t\t\t\tframework.unbind(template, events, self.handleMouseWheel);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tself.mouseZoomedIn = false;\n\n\t\t\tvar hasDraggingClass,\n\t\t\t\tupdateZoomable = function() {\n\t\t\t\t\tif(self.mouseZoomedIn) {\n\t\t\t\t\t\tframework.removeClass(template, 'pswp--zoomed-in');\n\t\t\t\t\t\tself.mouseZoomedIn = false;\n\t\t\t\t\t}\n\t\t\t\t\tif(_currZoomLevel < 1) {\n\t\t\t\t\t\tframework.addClass(template, 'pswp--zoom-allowed');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tframework.removeClass(template, 'pswp--zoom-allowed');\n\t\t\t\t\t}\n\t\t\t\t\tremoveDraggingClass();\n\t\t\t\t},\n\t\t\t\tremoveDraggingClass = function() {\n\t\t\t\t\tif(hasDraggingClass) {\n\t\t\t\t\t\tframework.removeClass(template, 'pswp--dragging');\n\t\t\t\t\t\thasDraggingClass = false;\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t_listen('resize' , updateZoomable);\n\t\t\t_listen('afterChange' , updateZoomable);\n\t\t\t_listen('pointerDown', function() {\n\t\t\t\tif(self.mouseZoomedIn) {\n\t\t\t\t\thasDraggingClass = true;\n\t\t\t\t\tframework.addClass(template, 'pswp--dragging');\n\t\t\t\t}\n\t\t\t});\n\t\t\t_listen('pointerUp', removeDraggingClass);\n\n\t\t\tif(!onInit) {\n\t\t\t\tupdateZoomable();\n\t\t\t}\n\t\t\t\n\t\t},\n\n\t\thandleMouseWheel: function(e) {\n\n\t\t\tif(_currZoomLevel <= self.currItem.fitRatio) {\n\t\t\t\tif( _options.modal ) {\n\n\t\t\t\t\tif (!_options.closeOnScroll || _numAnimations || _isDragging) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t} else if(_transformKey && Math.abs(e.deltaY) > 2) {\n\t\t\t\t\t\t// close PhotoSwipe\n\t\t\t\t\t\t// if browser supports transforms & scroll changed enough\n\t\t\t\t\t\t_closedByScroll = true;\n\t\t\t\t\t\tself.close();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// allow just one event to fire\n\t\t\te.stopPropagation();\n\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/Events/wheel\n\t\t\t_wheelDelta.x = 0;\n\n\t\t\tif('deltaX' in e) {\n\t\t\t\tif(e.deltaMode === 1 /* DOM_DELTA_LINE */) {\n\t\t\t\t\t// 18 - average line height\n\t\t\t\t\t_wheelDelta.x = e.deltaX * 18;\n\t\t\t\t\t_wheelDelta.y = e.deltaY * 18;\n\t\t\t\t} else {\n\t\t\t\t\t_wheelDelta.x = e.deltaX;\n\t\t\t\t\t_wheelDelta.y = e.deltaY;\n\t\t\t\t}\n\t\t\t} else if('wheelDelta' in e) {\n\t\t\t\tif(e.wheelDeltaX) {\n\t\t\t\t\t_wheelDelta.x = -0.16 * e.wheelDeltaX;\n\t\t\t\t}\n\t\t\t\tif(e.wheelDeltaY) {\n\t\t\t\t\t_wheelDelta.y = -0.16 * e.wheelDeltaY;\n\t\t\t\t} else {\n\t\t\t\t\t_wheelDelta.y = -0.16 * e.wheelDelta;\n\t\t\t\t}\n\t\t\t} else if('detail' in e) {\n\t\t\t\t_wheelDelta.y = e.detail;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_calculatePanBounds(_currZoomLevel, true);\n\n\t\t\tvar newPanX = _panOffset.x - _wheelDelta.x,\n\t\t\t\tnewPanY = _panOffset.y - _wheelDelta.y;\n\n\t\t\t// only prevent scrolling in nonmodal mode when not at edges\n\t\t\tif (_options.modal ||\n\t\t\t\t(\n\t\t\t\tnewPanX <= _currPanBounds.min.x && newPanX >= _currPanBounds.max.x &&\n\t\t\t\tnewPanY <= _currPanBounds.min.y && newPanY >= _currPanBounds.max.y\n\t\t\t\t) ) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\n\t\t\t// TODO: use rAF instead of mousewheel?\n\t\t\tself.panTo(newPanX, newPanY);\n\t\t},\n\n\t\ttoggleDesktopZoom: function(centerPoint) {\n\t\t\tcenterPoint = centerPoint || {x:_viewportSize.x/2 + _offset.x, y:_viewportSize.y/2 + _offset.y };\n\n\t\t\tvar doubleTapZoomLevel = _options.getDoubleTapZoom(true, self.currItem);\n\t\t\tvar zoomOut = _currZoomLevel === doubleTapZoomLevel;\n\t\t\t\n\t\t\tself.mouseZoomedIn = !zoomOut;\n\n\t\t\tself.zoomTo(zoomOut ? self.currItem.initialZoomLevel : doubleTapZoomLevel, centerPoint, 333);\n\t\t\tframework[ (!zoomOut ? 'add' : 'remove') + 'Class'](template, 'pswp--zoomed-in');\n\t\t}\n\n\t}\n});\n\n\n/*>>desktop-zoom*/\n\n/*>>history*/\n/**\n *\n * history.js:\n *\n * - Back button to close gallery.\n * \n * - Unique URL for each slide: example.com/&pid=1&gid=3\n * (where PID is picture index, and GID and gallery index)\n * \n * - Switch URL when slides change.\n * \n */\n\n\nvar _historyDefaultOptions = {\n\thistory: true,\n\tgalleryUID: 1\n};\n\nvar _historyUpdateTimeout,\n\t_hashChangeTimeout,\n\t_hashAnimCheckTimeout,\n\t_hashChangedByScript,\n\t_hashChangedByHistory,\n\t_hashReseted,\n\t_initialHash,\n\t_historyChanged,\n\t_closedFromURL,\n\t_urlChangedOnce,\n\t_windowLoc,\n\n\t_supportsPushState,\n\n\t_getHash = function() {\n\t\treturn _windowLoc.hash.substring(1);\n\t},\n\t_cleanHistoryTimeouts = function() {\n\n\t\tif(_historyUpdateTimeout) {\n\t\t\tclearTimeout(_historyUpdateTimeout);\n\t\t}\n\n\t\tif(_hashAnimCheckTimeout) {\n\t\t\tclearTimeout(_hashAnimCheckTimeout);\n\t\t}\n\t},\n\n\t// pid - Picture index\n\t// gid - Gallery index\n\t_parseItemIndexFromURL = function() {\n\t\tvar hash = _getHash(),\n\t\t\tparams = {};\n\n\t\tif(hash.length < 5) { // pid=1\n\t\t\treturn params;\n\t\t}\n\n\t\tvar i, vars = hash.split('&');\n\t\tfor (i = 0; i < vars.length; i++) {\n\t\t\tif(!vars[i]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar pair = vars[i].split('=');\t\n\t\t\tif(pair.length < 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tparams[pair[0]] = pair[1];\n\t\t}\n\t\tif(_options.galleryPIDs) {\n\t\t\t// detect custom pid in hash and search for it among the items collection\n\t\t\tvar searchfor = params.pid;\n\t\t\tparams.pid = 0; // if custom pid cannot be found, fallback to the first item\n\t\t\tfor(i = 0; i < _items.length; i++) {\n\t\t\t\tif(_items[i].pid === searchfor) {\n\t\t\t\t\tparams.pid = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tparams.pid = parseInt(params.pid,10)-1;\n\t\t}\n\t\tif( params.pid < 0 ) {\n\t\t\tparams.pid = 0;\n\t\t}\n\t\treturn params;\n\t},\n\t_updateHash = function() {\n\n\t\tif(_hashAnimCheckTimeout) {\n\t\t\tclearTimeout(_hashAnimCheckTimeout);\n\t\t}\n\n\n\t\tif(_numAnimations || _isDragging) {\n\t\t\t// changing browser URL forces layout/paint in some browsers, which causes noticable lag during animation\n\t\t\t// that's why we update hash only when no animations running\n\t\t\t_hashAnimCheckTimeout = setTimeout(_updateHash, 500);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(_hashChangedByScript) {\n\t\t\tclearTimeout(_hashChangeTimeout);\n\t\t} else {\n\t\t\t_hashChangedByScript = true;\n\t\t}\n\n\n\t\tvar pid = (_currentItemIndex + 1);\n\t\tvar item = _getItemAt( _currentItemIndex );\n\t\tif(item.hasOwnProperty('pid')) {\n\t\t\t// carry forward any custom pid assigned to the item\n\t\t\tpid = item.pid;\n\t\t}\n\t\tvar newHash = _initialHash + '&' + 'gid=' + _options.galleryUID + '&' + 'pid=' + pid;\n\n\t\tif(!_historyChanged) {\n\t\t\tif(_windowLoc.hash.indexOf(newHash) === -1) {\n\t\t\t\t_urlChangedOnce = true;\n\t\t\t}\n\t\t\t// first time - add new hisory record, then just replace\n\t\t}\n\n\t\tvar newURL = _windowLoc.href.split('#')[0] + '#' + newHash;\n\n\t\tif( _supportsPushState ) {\n\n\t\t\tif('#' + newHash !== window.location.hash) {\n\t\t\t\thistory[_historyChanged ? 'replaceState' : 'pushState']('', document.title, newURL);\n\t\t\t}\n\n\t\t} else {\n\t\t\tif(_historyChanged) {\n\t\t\t\t_windowLoc.replace( newURL );\n\t\t\t} else {\n\t\t\t\t_windowLoc.hash = newHash;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\n\t\t_historyChanged = true;\n\t\t_hashChangeTimeout = setTimeout(function() {\n\t\t\t_hashChangedByScript = false;\n\t\t}, 60);\n\t};\n\n\n\n\t\n\n_registerModule('History', {\n\n\t\n\n\tpublicMethods: {\n\t\tinitHistory: function() {\n\n\t\t\tframework.extend(_options, _historyDefaultOptions, true);\n\n\t\t\tif( !_options.history ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\n\t\t\t_windowLoc = window.location;\n\t\t\t_urlChangedOnce = false;\n\t\t\t_closedFromURL = false;\n\t\t\t_historyChanged = false;\n\t\t\t_initialHash = _getHash();\n\t\t\t_supportsPushState = ('pushState' in history);\n\n\n\t\t\tif(_initialHash.indexOf('gid=') > -1) {\n\t\t\t\t_initialHash = _initialHash.split('&gid=')[0];\n\t\t\t\t_initialHash = _initialHash.split('?gid=')[0];\n\t\t\t}\n\t\t\t\n\n\t\t\t_listen('afterChange', self.updateURL);\n\t\t\t_listen('unbindEvents', function() {\n\t\t\t\tframework.unbind(window, 'hashchange', self.onHashChange);\n\t\t\t});\n\n\n\t\t\tvar returnToOriginal = function() {\n\t\t\t\t_hashReseted = true;\n\t\t\t\tif(!_closedFromURL) {\n\n\t\t\t\t\tif(_urlChangedOnce) {\n\t\t\t\t\t\thistory.back();\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif(_initialHash) {\n\t\t\t\t\t\t\t_windowLoc.hash = _initialHash;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (_supportsPushState) {\n\n\t\t\t\t\t\t\t\t// remove hash from url without refreshing it or scrolling to top\n\t\t\t\t\t\t\t\thistory.pushState('', document.title, _windowLoc.pathname + _windowLoc.search );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_windowLoc.hash = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t_cleanHistoryTimeouts();\n\t\t\t};\n\n\n\t\t\t_listen('unbindEvents', function() {\n\t\t\t\tif(_closedByScroll) {\n\t\t\t\t\t// if PhotoSwipe is closed by scroll, we go \"back\" before the closing animation starts\n\t\t\t\t\t// this is done to keep the scroll position\n\t\t\t\t\treturnToOriginal();\n\t\t\t\t}\n\t\t\t});\n\t\t\t_listen('destroy', function() {\n\t\t\t\tif(!_hashReseted) {\n\t\t\t\t\treturnToOriginal();\n\t\t\t\t}\n\t\t\t});\n\t\t\t_listen('firstUpdate', function() {\n\t\t\t\t_currentItemIndex = _parseItemIndexFromURL().pid;\n\t\t\t});\n\n\t\t\t\n\n\t\t\t\n\t\t\tvar index = _initialHash.indexOf('pid=');\n\t\t\tif(index > -1) {\n\t\t\t\t_initialHash = _initialHash.substring(0, index);\n\t\t\t\tif(_initialHash.slice(-1) === '&') {\n\t\t\t\t\t_initialHash = _initialHash.slice(0, -1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\n\t\t\tsetTimeout(function() {\n\t\t\t\tif(_isOpen) { // hasn't destroyed yet\n\t\t\t\t\tframework.bind(window, 'hashchange', self.onHashChange);\n\t\t\t\t}\n\t\t\t}, 40);\n\t\t\t\n\t\t},\n\t\tonHashChange: function() {\n\n\t\t\tif(_getHash() === _initialHash) {\n\n\t\t\t\t_closedFromURL = true;\n\t\t\t\tself.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!_hashChangedByScript) {\n\n\t\t\t\t_hashChangedByHistory = true;\n\t\t\t\tself.goTo( _parseItemIndexFromURL().pid );\n\t\t\t\t_hashChangedByHistory = false;\n\t\t\t}\n\t\t\t\n\t\t},\n\t\tupdateURL: function() {\n\n\t\t\t// Delay the update of URL, to avoid lag during transition, \n\t\t\t// and to not to trigger actions like \"refresh page sound\" or \"blinking favicon\" to often\n\t\t\t\n\t\t\t_cleanHistoryTimeouts();\n\t\t\t\n\n\t\t\tif(_hashChangedByHistory) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(!_historyChanged) {\n\t\t\t\t_updateHash(); // first time\n\t\t\t} else {\n\t\t\t\t_historyUpdateTimeout = setTimeout(_updateHash, 800);\n\t\t\t}\n\t\t}\n\t\n\t}\n});\n\n\n/*>>history*/\n\tframework.extend(self, publicMethods); };\n\treturn PhotoSwipe;\n});", "/*! PhotoSwipe Default UI - 4.1.3 - 2019-01-08\n* http://photoswipe.com\n* Copyright (c) 2019 Dmitry Semenov; */\n/**\n*\n* UI on top of main sliding area (caption, arrows, close button, etc.).\n* Built just using public methods/properties of PhotoSwipe.\n* \n*/\n(function (root, factory) { \n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t} else if (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t} else {\n\t\troot.PhotoSwipeUI_Default = factory();\n\t}\n})(this, function () {\n\n\t'use strict';\n\n\n\nvar PhotoSwipeUI_Default =\n function(pswp, framework) {\n\n\tvar ui = this;\n\tvar _overlayUIUpdated = false,\n\t\t_controlsVisible = true,\n\t\t_fullscrenAPI,\n\t\t_controls,\n\t\t_captionContainer,\n\t\t_fakeCaptionContainer,\n\t\t_indexIndicator,\n\t\t_shareButton,\n\t\t_shareModal,\n\t\t_shareModalHidden = true,\n\t\t_initalCloseOnScrollValue,\n\t\t_isIdle,\n\t\t_listen,\n\n\t\t_loadingIndicator,\n\t\t_loadingIndicatorHidden,\n\t\t_loadingIndicatorTimeout,\n\n\t\t_galleryHasOneSlide,\n\n\t\t_options,\n\t\t_defaultUIOptions = {\n\t\t\tbarsSize: {top:44, bottom:'auto'},\n\t\t\tcloseElClasses: ['item', 'caption', 'zoom-wrap', 'ui', 'top-bar'], \n\t\t\ttimeToIdle: 4000, \n\t\t\ttimeToIdleOutside: 1000,\n\t\t\tloadingIndicatorDelay: 1000, // 2s\n\t\t\t\n\t\t\taddCaptionHTMLFn: function(item, captionEl /*, isFake */) {\n\t\t\t\tif(!item.title) {\n\t\t\t\t\tcaptionEl.children[0].innerHTML = '';\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcaptionEl.children[0].innerHTML = item.title;\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\tcloseEl:true,\n\t\t\tcaptionEl: true,\n\t\t\tfullscreenEl: true,\n\t\t\tzoomEl: true,\n\t\t\tshareEl: true,\n\t\t\tcounterEl: true,\n\t\t\tarrowEl: true,\n\t\t\tpreloaderEl: true,\n\n\t\t\ttapToClose: false,\n\t\t\ttapToToggleControls: true,\n\n\t\t\tclickToCloseNonZoomable: true,\n\n\t\t\tshareButtons: [\n\t\t\t\t{id:'facebook', label:'Share on Facebook', url:'https://www.facebook.com/sharer/sharer.php?u={{url}}'},\n\t\t\t\t{id:'twitter', label:'Tweet', url:'https://twitter.com/intent/tweet?text={{text}}&url={{url}}'},\n\t\t\t\t{id:'pinterest', label:'Pin it', url:'http://www.pinterest.com/pin/create/button/'+\n\t\t\t\t\t\t\t\t\t\t\t\t\t'?url={{url}}&media={{image_url}}&description={{text}}'},\n\t\t\t\t{id:'download', label:'Download image', url:'{{raw_image_url}}', download:true}\n\t\t\t],\n\t\t\tgetImageURLForShare: function( /* shareButtonData */ ) {\n\t\t\t\treturn pswp.currItem.src || '';\n\t\t\t},\n\t\t\tgetPageURLForShare: function( /* shareButtonData */ ) {\n\t\t\t\treturn window.location.href;\n\t\t\t},\n\t\t\tgetTextForShare: function( /* shareButtonData */ ) {\n\t\t\t\treturn pswp.currItem.title || '';\n\t\t\t},\n\t\t\t\t\n\t\t\tindexIndicatorSep: ' / ',\n\t\t\tfitControlsWidth: 1200\n\n\t\t},\n\t\t_blockControlsTap,\n\t\t_blockControlsTapTimeout;\n\n\n\n\tvar _onControlsTap = function(e) {\n\t\t\tif(_blockControlsTap) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\n\t\t\te = e || window.event;\n\n\t\t\tif(_options.timeToIdle && _options.mouseUsed && !_isIdle) {\n\t\t\t\t// reset idle timer\n\t\t\t\t_onIdleMouseMove();\n\t\t\t}\n\n\n\t\t\tvar target = e.target || e.srcElement,\n\t\t\t\tuiElement,\n\t\t\t\tclickedClass = target.getAttribute('class') || '',\n\t\t\t\tfound;\n\n\t\t\tfor(var i = 0; i < _uiElements.length; i++) {\n\t\t\t\tuiElement = _uiElements[i];\n\t\t\t\tif(uiElement.onTap && clickedClass.indexOf('pswp__' + uiElement.name ) > -1 ) {\n\t\t\t\t\tuiElement.onTap();\n\t\t\t\t\tfound = true;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(found) {\n\t\t\t\tif(e.stopPropagation) {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\t_blockControlsTap = true;\n\n\t\t\t\t// Some versions of Android don't prevent ghost click event \n\t\t\t\t// when preventDefault() was called on touchstart and/or touchend.\n\t\t\t\t// \n\t\t\t\t// This happens on v4.3, 4.2, 4.1, \n\t\t\t\t// older versions strangely work correctly, \n\t\t\t\t// but just in case we add delay on all of them)\t\n\t\t\t\tvar tapDelay = framework.features.isOldAndroid ? 600 : 30;\n\t\t\t\t_blockControlsTapTimeout = setTimeout(function() {\n\t\t\t\t\t_blockControlsTap = false;\n\t\t\t\t}, tapDelay);\n\t\t\t}\n\n\t\t},\n\t\t_fitControlsInViewport = function() {\n\t\t\treturn !pswp.likelyTouchDevice || _options.mouseUsed || screen.width > _options.fitControlsWidth;\n\t\t},\n\t\t_togglePswpClass = function(el, cName, add) {\n\t\t\tframework[ (add ? 'add' : 'remove') + 'Class' ](el, 'pswp__' + cName);\n\t\t},\n\n\t\t// add class when there is just one item in the gallery\n\t\t// (by default it hides left/right arrows and 1ofX counter)\n\t\t_countNumItems = function() {\n\t\t\tvar hasOneSlide = (_options.getNumItemsFn() === 1);\n\n\t\t\tif(hasOneSlide !== _galleryHasOneSlide) {\n\t\t\t\t_togglePswpClass(_controls, 'ui--one-slide', hasOneSlide);\n\t\t\t\t_galleryHasOneSlide = hasOneSlide;\n\t\t\t}\n\t\t},\n\t\t_toggleShareModalClass = function() {\n\t\t\t_togglePswpClass(_shareModal, 'share-modal--hidden', _shareModalHidden);\n\t\t},\n\t\t_toggleShareModal = function() {\n\n\t\t\t_shareModalHidden = !_shareModalHidden;\n\t\t\t\n\t\t\t\n\t\t\tif(!_shareModalHidden) {\n\t\t\t\t_toggleShareModalClass();\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif(!_shareModalHidden) {\n\t\t\t\t\t\tframework.addClass(_shareModal, 'pswp__share-modal--fade-in');\n\t\t\t\t\t}\n\t\t\t\t}, 30);\n\t\t\t} else {\n\t\t\t\tframework.removeClass(_shareModal, 'pswp__share-modal--fade-in');\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tif(_shareModalHidden) {\n\t\t\t\t\t\t_toggleShareModalClass();\n\t\t\t\t\t}\n\t\t\t\t}, 300);\n\t\t\t}\n\t\t\t\n\t\t\tif(!_shareModalHidden) {\n\t\t\t\t_updateShareURLs();\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\n\t\t_openWindowPopup = function(e) {\n\t\t\te = e || window.event;\n\t\t\tvar target = e.target || e.srcElement;\n\n\t\t\tpswp.shout('shareLinkClick', e, target);\n\n\t\t\tif(!target.href) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif( target.hasAttribute('download') ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\twindow.open(target.href, 'pswp_share', 'scrollbars=yes,resizable=yes,toolbar=no,'+\n\t\t\t\t\t\t\t\t\t\t'location=yes,width=550,height=420,top=100,left=' + \n\t\t\t\t\t\t\t\t\t\t(window.screen ? Math.round(screen.width / 2 - 275) : 100) );\n\n\t\t\tif(!_shareModalHidden) {\n\t\t\t\t_toggleShareModal();\n\t\t\t}\n\t\t\t\n\t\t\treturn false;\n\t\t},\n\t\t_updateShareURLs = function() {\n\t\t\tvar shareButtonOut = '',\n\t\t\t\tshareButtonData,\n\t\t\t\tshareURL,\n\t\t\t\timage_url,\n\t\t\t\tpage_url,\n\t\t\t\tshare_text;\n\n\t\t\tfor(var i = 0; i < _options.shareButtons.length; i++) {\n\t\t\t\tshareButtonData = _options.shareButtons[i];\n\n\t\t\t\timage_url = _options.getImageURLForShare(shareButtonData);\n\t\t\t\tpage_url = _options.getPageURLForShare(shareButtonData);\n\t\t\t\tshare_text = _options.getTextForShare(shareButtonData);\n\n\t\t\t\tshareURL = shareButtonData.url.replace('{{url}}', encodeURIComponent(page_url) )\n\t\t\t\t\t\t\t\t\t.replace('{{image_url}}', encodeURIComponent(image_url) )\n\t\t\t\t\t\t\t\t\t.replace('{{raw_image_url}}', image_url )\n\t\t\t\t\t\t\t\t\t.replace('{{text}}', encodeURIComponent(share_text) );\n\n\t\t\t\tshareButtonOut += '<a href=\"' + shareURL + '\" target=\"_blank\" '+\n\t\t\t\t\t\t\t\t\t'class=\"pswp__share--' + shareButtonData.id + '\"' +\n\t\t\t\t\t\t\t\t\t(shareButtonData.download ? 'download' : '') + '>' + \n\t\t\t\t\t\t\t\t\tshareButtonData.label + '</a>';\n\n\t\t\t\tif(_options.parseShareButtonOut) {\n\t\t\t\t\tshareButtonOut = _options.parseShareButtonOut(shareButtonData, shareButtonOut);\n\t\t\t\t}\n\t\t\t}\n\t\t\t_shareModal.children[0].innerHTML = shareButtonOut;\n\t\t\t_shareModal.children[0].onclick = _openWindowPopup;\n\n\t\t},\n\t\t_hasCloseClass = function(target) {\n\t\t\tfor(var i = 0; i < _options.closeElClasses.length; i++) {\n\t\t\t\tif( framework.hasClass(target, 'pswp__' + _options.closeElClasses[i]) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t_idleInterval,\n\t\t_idleTimer,\n\t\t_idleIncrement = 0,\n\t\t_onIdleMouseMove = function() {\n\t\t\tclearTimeout(_idleTimer);\n\t\t\t_idleIncrement = 0;\n\t\t\tif(_isIdle) {\n\t\t\t\tui.setIdle(false);\n\t\t\t}\n\t\t},\n\t\t_onMouseLeaveWindow = function(e) {\n\t\t\te = e ? e : window.event;\n\t\t\tvar from = e.relatedTarget || e.toElement;\n\t\t\tif (!from || from.nodeName === 'HTML') {\n\t\t\t\tclearTimeout(_idleTimer);\n\t\t\t\t_idleTimer = setTimeout(function() {\n\t\t\t\t\tui.setIdle(true);\n\t\t\t\t}, _options.timeToIdleOutside);\n\t\t\t}\n\t\t},\n\t\t_setupFullscreenAPI = function() {\n\t\t\tif(_options.fullscreenEl && !framework.features.isOldAndroid) {\n\t\t\t\tif(!_fullscrenAPI) {\n\t\t\t\t\t_fullscrenAPI = ui.getFullscreenAPI();\n\t\t\t\t}\n\t\t\t\tif(_fullscrenAPI) {\n\t\t\t\t\tframework.bind(document, _fullscrenAPI.eventK, ui.updateFullscreen);\n\t\t\t\t\tui.updateFullscreen();\n\t\t\t\t\tframework.addClass(pswp.template, 'pswp--supports-fs');\n\t\t\t\t} else {\n\t\t\t\t\tframework.removeClass(pswp.template, 'pswp--supports-fs');\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t_setupLoadingIndicator = function() {\n\t\t\t// Setup loading indicator\n\t\t\tif(_options.preloaderEl) {\n\t\t\t\n\t\t\t\t_toggleLoadingIndicator(true);\n\n\t\t\t\t_listen('beforeChange', function() {\n\n\t\t\t\t\tclearTimeout(_loadingIndicatorTimeout);\n\n\t\t\t\t\t// display loading indicator with delay\n\t\t\t\t\t_loadingIndicatorTimeout = setTimeout(function() {\n\n\t\t\t\t\t\tif(pswp.currItem && pswp.currItem.loading) {\n\n\t\t\t\t\t\t\tif( !pswp.allowProgressiveImg() || (pswp.currItem.img && !pswp.currItem.img.naturalWidth) ) {\n\t\t\t\t\t\t\t\t// show preloader if progressive loading is not enabled, \n\t\t\t\t\t\t\t\t// or image width is not defined yet (because of slow connection)\n\t\t\t\t\t\t\t\t_toggleLoadingIndicator(false); \n\t\t\t\t\t\t\t\t// items-controller.js function allowProgressiveImg\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t_toggleLoadingIndicator(true); // hide preloader\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, _options.loadingIndicatorDelay);\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t_listen('imageLoadComplete', function(index, item) {\n\t\t\t\t\tif(pswp.currItem === item) {\n\t\t\t\t\t\t_toggleLoadingIndicator(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t}\n\t\t},\n\t\t_toggleLoadingIndicator = function(hide) {\n\t\t\tif( _loadingIndicatorHidden !== hide ) {\n\t\t\t\t_togglePswpClass(_loadingIndicator, 'preloader--active', !hide);\n\t\t\t\t_loadingIndicatorHidden = hide;\n\t\t\t}\n\t\t},\n\t\t_applyNavBarGaps = function(item) {\n\t\t\tvar gap = item.vGap;\n\n\t\t\tif( _fitControlsInViewport() ) {\n\t\t\t\t\n\t\t\t\tvar bars = _options.barsSize; \n\t\t\t\tif(_options.captionEl && bars.bottom === 'auto') {\n\t\t\t\t\tif(!_fakeCaptionContainer) {\n\t\t\t\t\t\t_fakeCaptionContainer = framework.createEl('pswp__caption pswp__caption--fake');\n\t\t\t\t\t\t_fakeCaptionContainer.appendChild( framework.createEl('pswp__caption__center') );\n\t\t\t\t\t\t_controls.insertBefore(_fakeCaptionContainer, _captionContainer);\n\t\t\t\t\t\tframework.addClass(_controls, 'pswp__ui--fit');\n\t\t\t\t\t}\n\t\t\t\t\tif( _options.addCaptionHTMLFn(item, _fakeCaptionContainer, true) ) {\n\n\t\t\t\t\t\tvar captionSize = _fakeCaptionContainer.clientHeight;\n\t\t\t\t\t\tgap.bottom = parseInt(captionSize,10) || 44;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgap.bottom = bars.top; // if no caption, set size of bottom gap to size of top\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tgap.bottom = bars.bottom === 'auto' ? 0 : bars.bottom;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// height of top bar is static, no need to calculate it\n\t\t\t\tgap.top = bars.top;\n\t\t\t} else {\n\t\t\t\tgap.top = gap.bottom = 0;\n\t\t\t}\n\t\t},\n\t\t_setupIdle = function() {\n\t\t\t// Hide controls when mouse is used\n\t\t\tif(_options.timeToIdle) {\n\t\t\t\t_listen('mouseUsed', function() {\n\t\t\t\t\t\n\t\t\t\t\tframework.bind(document, 'mousemove', _onIdleMouseMove);\n\t\t\t\t\tframework.bind(document, 'mouseout', _onMouseLeaveWindow);\n\n\t\t\t\t\t_idleInterval = setInterval(function() {\n\t\t\t\t\t\t_idleIncrement++;\n\t\t\t\t\t\tif(_idleIncrement === 2) {\n\t\t\t\t\t\t\tui.setIdle(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}, _options.timeToIdle / 2);\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t_setupHidingControlsDuringGestures = function() {\n\n\t\t\t// Hide controls on vertical drag\n\t\t\t_listen('onVerticalDrag', function(now) {\n\t\t\t\tif(_controlsVisible && now < 0.95) {\n\t\t\t\t\tui.hideControls();\n\t\t\t\t} else if(!_controlsVisible && now >= 0.95) {\n\t\t\t\t\tui.showControls();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Hide controls when pinching to close\n\t\t\tvar pinchControlsHidden;\n\t\t\t_listen('onPinchClose' , function(now) {\n\t\t\t\tif(_controlsVisible && now < 0.9) {\n\t\t\t\t\tui.hideControls();\n\t\t\t\t\tpinchControlsHidden = true;\n\t\t\t\t} else if(pinchControlsHidden && !_controlsVisible && now > 0.9) {\n\t\t\t\t\tui.showControls();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_listen('zoomGestureEnded', function() {\n\t\t\t\tpinchControlsHidden = false;\n\t\t\t\tif(pinchControlsHidden && !_controlsVisible) {\n\t\t\t\t\tui.showControls();\n\t\t\t\t}\n\t\t\t});\n\n\t\t};\n\n\n\n\tvar _uiElements = [\n\t\t{ \n\t\t\tname: 'caption', \n\t\t\toption: 'captionEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_captionContainer = el; \n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'share-modal', \n\t\t\toption: 'shareEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_shareModal = el;\n\t\t\t},\n\t\t\tonTap: function() {\n\t\t\t\t_toggleShareModal();\n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'button--share', \n\t\t\toption: 'shareEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_shareButton = el;\n\t\t\t},\n\t\t\tonTap: function() {\n\t\t\t\t_toggleShareModal();\n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'button--zoom', \n\t\t\toption: 'zoomEl',\n\t\t\tonTap: pswp.toggleDesktopZoom\n\t\t},\n\t\t{ \n\t\t\tname: 'counter', \n\t\t\toption: 'counterEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_indexIndicator = el;\n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'button--close', \n\t\t\toption: 'closeEl',\n\t\t\tonTap: pswp.close\n\t\t},\n\t\t{ \n\t\t\tname: 'button--arrow--left', \n\t\t\toption: 'arrowEl',\n\t\t\tonTap: pswp.prev\n\t\t},\n\t\t{ \n\t\t\tname: 'button--arrow--right', \n\t\t\toption: 'arrowEl',\n\t\t\tonTap: pswp.next\n\t\t},\n\t\t{ \n\t\t\tname: 'button--fs', \n\t\t\toption: 'fullscreenEl',\n\t\t\tonTap: function() { \n\t\t\t\tif(_fullscrenAPI.isFullscreen()) {\n\t\t\t\t\t_fullscrenAPI.exit();\n\t\t\t\t} else {\n\t\t\t\t\t_fullscrenAPI.enter();\n\t\t\t\t}\n\t\t\t} \n\t\t},\n\t\t{ \n\t\t\tname: 'preloader', \n\t\t\toption: 'preloaderEl',\n\t\t\tonInit: function(el) { \n\t\t\t\t_loadingIndicator = el;\n\t\t\t} \n\t\t}\n\n\t];\n\n\tvar _setupUIElements = function() {\n\t\tvar item,\n\t\t\tclassAttr,\n\t\t\tuiElement;\n\n\t\tvar loopThroughChildElements = function(sChildren) {\n\t\t\tif(!sChildren) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar l = sChildren.length;\n\t\t\tfor(var i = 0; i < l; i++) {\n\t\t\t\titem = sChildren[i];\n\t\t\t\tclassAttr = item.className;\n\n\t\t\t\tfor(var a = 0; a < _uiElements.length; a++) {\n\t\t\t\t\tuiElement = _uiElements[a];\n\n\t\t\t\t\tif(classAttr.indexOf('pswp__' + uiElement.name) > -1 ) {\n\n\t\t\t\t\t\tif( _options[uiElement.option] ) { // if element is not disabled from options\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tframework.removeClass(item, 'pswp__element--disabled');\n\t\t\t\t\t\t\tif(uiElement.onInit) {\n\t\t\t\t\t\t\t\tuiElement.onInit(item);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//item.style.display = 'block';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tframework.addClass(item, 'pswp__element--disabled');\n\t\t\t\t\t\t\t//item.style.display = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tloopThroughChildElements(_controls.children);\n\n\t\tvar topBar = framework.getChildByClass(_controls, 'pswp__top-bar');\n\t\tif(topBar) {\n\t\t\tloopThroughChildElements( topBar.children );\n\t\t}\n\t};\n\n\n\t\n\n\tui.init = function() {\n\n\t\t// extend options\n\t\tframework.extend(pswp.options, _defaultUIOptions, true);\n\n\t\t// create local link for fast access\n\t\t_options = pswp.options;\n\n\t\t// find pswp__ui element\n\t\t_controls = framework.getChildByClass(pswp.scrollWrap, 'pswp__ui');\n\n\t\t// create local link\n\t\t_listen = pswp.listen;\n\n\n\t\t_setupHidingControlsDuringGestures();\n\n\t\t// update controls when slides change\n\t\t_listen('beforeChange', ui.update);\n\n\t\t// toggle zoom on double-tap\n\t\t_listen('doubleTap', function(point) {\n\t\t\tvar initialZoomLevel = pswp.currItem.initialZoomLevel;\n\t\t\tif(pswp.getZoomLevel() !== initialZoomLevel) {\n\t\t\t\tpswp.zoomTo(initialZoomLevel, point, 333);\n\t\t\t} else {\n\t\t\t\tpswp.zoomTo(_options.getDoubleTapZoom(false, pswp.currItem), point, 333);\n\t\t\t}\n\t\t});\n\n\t\t// Allow text selection in caption\n\t\t_listen('preventDragEvent', function(e, isDown, preventObj) {\n\t\t\tvar t = e.target || e.srcElement;\n\t\t\tif(\n\t\t\t\tt && \n\t\t\t\tt.getAttribute('class') && e.type.indexOf('mouse') > -1 && \n\t\t\t\t( t.getAttribute('class').indexOf('__caption') > 0 || (/(SMALL|STRONG|EM)/i).test(t.tagName) ) \n\t\t\t) {\n\t\t\t\tpreventObj.prevent = false;\n\t\t\t}\n\t\t});\n\n\t\t// bind events for UI\n\t\t_listen('bindEvents', function() {\n\t\t\tframework.bind(_controls, 'pswpTap click', _onControlsTap);\n\t\t\tframework.bind(pswp.scrollWrap, 'pswpTap', ui.onGlobalTap);\n\n\t\t\tif(!pswp.likelyTouchDevice) {\n\t\t\t\tframework.bind(pswp.scrollWrap, 'mouseover', ui.onMouseOver);\n\t\t\t}\n\t\t});\n\n\t\t// unbind events for UI\n\t\t_listen('unbindEvents', function() {\n\t\t\tif(!_shareModalHidden) {\n\t\t\t\t_toggleShareModal();\n\t\t\t}\n\n\t\t\tif(_idleInterval) {\n\t\t\t\tclearInterval(_idleInterval);\n\t\t\t}\n\t\t\tframework.unbind(document, 'mouseout', _onMouseLeaveWindow);\n\t\t\tframework.unbind(document, 'mousemove', _onIdleMouseMove);\n\t\t\tframework.unbind(_controls, 'pswpTap click', _onControlsTap);\n\t\t\tframework.unbind(pswp.scrollWrap, 'pswpTap', ui.onGlobalTap);\n\t\t\tframework.unbind(pswp.scrollWrap, 'mouseover', ui.onMouseOver);\n\n\t\t\tif(_fullscrenAPI) {\n\t\t\t\tframework.unbind(document, _fullscrenAPI.eventK, ui.updateFullscreen);\n\t\t\t\tif(_fullscrenAPI.isFullscreen()) {\n\t\t\t\t\t_options.hideAnimationDuration = 0;\n\t\t\t\t\t_fullscrenAPI.exit();\n\t\t\t\t}\n\t\t\t\t_fullscrenAPI = null;\n\t\t\t}\n\t\t});\n\n\n\t\t// clean up things when gallery is destroyed\n\t\t_listen('destroy', function() {\n\t\t\tif(_options.captionEl) {\n\t\t\t\tif(_fakeCaptionContainer) {\n\t\t\t\t\t_controls.removeChild(_fakeCaptionContainer);\n\t\t\t\t}\n\t\t\t\tframework.removeClass(_captionContainer, 'pswp__caption--empty');\n\t\t\t}\n\n\t\t\tif(_shareModal) {\n\t\t\t\t_shareModal.children[0].onclick = null;\n\t\t\t}\n\t\t\tframework.removeClass(_controls, 'pswp__ui--over-close');\n\t\t\tframework.addClass( _controls, 'pswp__ui--hidden');\n\t\t\tui.setIdle(false);\n\t\t});\n\t\t\n\n\t\tif(!_options.showAnimationDuration) {\n\t\t\tframework.removeClass( _controls, 'pswp__ui--hidden');\n\t\t}\n\t\t_listen('initialZoomIn', function() {\n\t\t\tif(_options.showAnimationDuration) {\n\t\t\t\tframework.removeClass( _controls, 'pswp__ui--hidden');\n\t\t\t}\n\t\t});\n\t\t_listen('initialZoomOut', function() {\n\t\t\tframework.addClass( _controls, 'pswp__ui--hidden');\n\t\t});\n\n\t\t_listen('parseVerticalMargin', _applyNavBarGaps);\n\t\t\n\t\t_setupUIElements();\n\n\t\tif(_options.shareEl && _shareButton && _shareModal) {\n\t\t\t_shareModalHidden = true;\n\t\t}\n\n\t\t_countNumItems();\n\n\t\t_setupIdle();\n\n\t\t_setupFullscreenAPI();\n\n\t\t_setupLoadingIndicator();\n\t};\n\n\tui.setIdle = function(isIdle) {\n\t\t_isIdle = isIdle;\n\t\t_togglePswpClass(_controls, 'ui--idle', isIdle);\n\t};\n\n\tui.update = function() {\n\t\t// Don't update UI if it's hidden\n\t\tif(_controlsVisible && pswp.currItem) {\n\t\t\t\n\t\t\tui.updateIndexIndicator();\n\n\t\t\tif(_options.captionEl) {\n\t\t\t\t_options.addCaptionHTMLFn(pswp.currItem, _captionContainer);\n\n\t\t\t\t_togglePswpClass(_captionContainer, 'caption--empty', !pswp.currItem.title);\n\t\t\t}\n\n\t\t\t_overlayUIUpdated = true;\n\n\t\t} else {\n\t\t\t_overlayUIUpdated = false;\n\t\t}\n\n\t\tif(!_shareModalHidden) {\n\t\t\t_toggleShareModal();\n\t\t}\n\n\t\t_countNumItems();\n\t};\n\n\tui.updateFullscreen = function(e) {\n\n\t\tif(e) {\n\t\t\t// some browsers change window scroll position during the fullscreen\n\t\t\t// so PhotoSwipe updates it just in case\n\t\t\tsetTimeout(function() {\n\t\t\t\tpswp.setScrollOffset( 0, framework.getScrollY() );\n\t\t\t}, 50);\n\t\t}\n\t\t\n\t\t// toogle pswp--fs class on root element\n\t\tframework[ (_fullscrenAPI.isFullscreen() ? 'add' : 'remove') + 'Class' ](pswp.template, 'pswp--fs');\n\t};\n\n\tui.updateIndexIndicator = function() {\n\t\tif(_options.counterEl) {\n\t\t\t_indexIndicator.innerHTML = (pswp.getCurrentIndex()+1) + \n\t\t\t\t\t\t\t\t\t\t_options.indexIndicatorSep + \n\t\t\t\t\t\t\t\t\t\t_options.getNumItemsFn();\n\t\t}\n\t};\n\t\n\tui.onGlobalTap = function(e) {\n\t\te = e || window.event;\n\t\tvar target = e.target || e.srcElement;\n\n\t\tif(_blockControlsTap) {\n\t\t\treturn;\n\t\t}\n\n\t\tif(e.detail && e.detail.pointerType === 'mouse') {\n\n\t\t\t// close gallery if clicked outside of the image\n\t\t\tif(_hasCloseClass(target)) {\n\t\t\t\tpswp.close();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif(framework.hasClass(target, 'pswp__img')) {\n\t\t\t\tif(pswp.getZoomLevel() === 1 && pswp.getZoomLevel() <= pswp.currItem.fitRatio) {\n\t\t\t\t\tif(_options.clickToCloseNonZoomable) {\n\t\t\t\t\t\tpswp.close();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tpswp.toggleDesktopZoom(e.detail.releasePoint);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} else {\n\n\t\t\t// tap anywhere (except buttons) to toggle visibility of controls\n\t\t\tif(_options.tapToToggleControls) {\n\t\t\t\tif(_controlsVisible) {\n\t\t\t\t\tui.hideControls();\n\t\t\t\t} else {\n\t\t\t\t\tui.showControls();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// tap to close gallery\n\t\t\tif(_options.tapToClose && (framework.hasClass(target, 'pswp__img') || _hasCloseClass(target)) ) {\n\t\t\t\tpswp.close();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t}\n\t};\n\tui.onMouseOver = function(e) {\n\t\te = e || window.event;\n\t\tvar target = e.target || e.srcElement;\n\n\t\t// add class when mouse is over an element that should close the gallery\n\t\t_togglePswpClass(_controls, 'ui--over-close', _hasCloseClass(target));\n\t};\n\n\tui.hideControls = function() {\n\t\tframework.addClass(_controls,'pswp__ui--hidden');\n\t\t_controlsVisible = false;\n\t};\n\n\tui.showControls = function() {\n\t\t_controlsVisible = true;\n\t\tif(!_overlayUIUpdated) {\n\t\t\tui.update();\n\t\t}\n\t\tframework.removeClass(_controls,'pswp__ui--hidden');\n\t};\n\n\tui.supportsFullscreen = function() {\n\t\tvar d = document;\n\t\treturn !!(d.exitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen || d.msExitFullscreen);\n\t};\n\n\tui.getFullscreenAPI = function() {\n\t\tvar dE = document.documentElement,\n\t\t\tapi,\n\t\t\ttF = 'fullscreenchange';\n\n\t\tif (dE.requestFullscreen) {\n\t\t\tapi = {\n\t\t\t\tenterK: 'requestFullscreen',\n\t\t\t\texitK: 'exitFullscreen',\n\t\t\t\telementK: 'fullscreenElement',\n\t\t\t\teventK: tF\n\t\t\t};\n\n\t\t} else if(dE.mozRequestFullScreen ) {\n\t\t\tapi = {\n\t\t\t\tenterK: 'mozRequestFullScreen',\n\t\t\t\texitK: 'mozCancelFullScreen',\n\t\t\t\telementK: 'mozFullScreenElement',\n\t\t\t\teventK: 'moz' + tF\n\t\t\t};\n\n\t\t\t\n\n\t\t} else if(dE.webkitRequestFullscreen) {\n\t\t\tapi = {\n\t\t\t\tenterK: 'webkitRequestFullscreen',\n\t\t\t\texitK: 'webkitExitFullscreen',\n\t\t\t\telementK: 'webkitFullscreenElement',\n\t\t\t\teventK: 'webkit' + tF\n\t\t\t};\n\n\t\t} else if(dE.msRequestFullscreen) {\n\t\t\tapi = {\n\t\t\t\tenterK: 'msRequestFullscreen',\n\t\t\t\texitK: 'msExitFullscreen',\n\t\t\t\telementK: 'msFullscreenElement',\n\t\t\t\teventK: 'MSFullscreenChange'\n\t\t\t};\n\t\t}\n\n\t\tif(api) {\n\t\t\tapi.enter = function() { \n\t\t\t\t// disable close-on-scroll in fullscreen\n\t\t\t\t_initalCloseOnScrollValue = _options.closeOnScroll; \n\t\t\t\t_options.closeOnScroll = false; \n\n\t\t\t\tif(this.enterK === 'webkitRequestFullscreen') {\n\t\t\t\t\tpswp.template[this.enterK]( Element.ALLOW_KEYBOARD_INPUT );\n\t\t\t\t} else {\n\t\t\t\t\treturn pswp.template[this.enterK](); \n\t\t\t\t}\n\t\t\t};\n\t\t\tapi.exit = function() { \n\t\t\t\t_options.closeOnScroll = _initalCloseOnScrollValue;\n\n\t\t\t\treturn document[this.exitK](); \n\n\t\t\t};\n\t\t\tapi.isFullscreen = function() { return document[this.elementK]; };\n\t\t}\n\n\t\treturn api;\n\t};\n\n\n\n};\nreturn PhotoSwipeUI_Default;\n\n\n});\n", "(function() {\n\n var debug = false;\n\n var root = this;\n\n var EXIF = function(obj) {\n if (obj instanceof EXIF) return obj;\n if (!(this instanceof EXIF)) return new EXIF(obj);\n this.EXIFwrapped = obj;\n };\n\n if (typeof exports !== 'undefined') {\n if (typeof module !== 'undefined' && module.exports) {\n exports = module.exports = EXIF;\n }\n exports.EXIF = EXIF;\n } else {\n root.EXIF = EXIF;\n }\n\n var ExifTags = EXIF.Tags = {\n\n // version tags\n 0x9000 : \"ExifVersion\", // EXIF version\n 0xA000 : \"FlashpixVersion\", // Flashpix format version\n\n // colorspace tags\n 0xA001 : \"ColorSpace\", // Color space information tag\n\n // image configuration\n 0xA002 : \"PixelXDimension\", // Valid width of meaningful image\n 0xA003 : \"PixelYDimension\", // Valid height of meaningful image\n 0x9101 : \"ComponentsConfiguration\", // Information about channels\n 0x9102 : \"CompressedBitsPerPixel\", // Compressed bits per pixel\n\n // user information\n 0x927C : \"MakerNote\", // Any desired information written by the manufacturer\n 0x9286 : \"UserComment\", // Comments by user\n\n // related file\n 0xA004 : \"RelatedSoundFile\", // Name of related sound file\n\n // date and time\n 0x9003 : \"DateTimeOriginal\", // Date and time when the original image was generated\n 0x9004 : \"DateTimeDigitized\", // Date and time when the image was stored digitally\n 0x9290 : \"SubsecTime\", // Fractions of seconds for DateTime\n 0x9291 : \"SubsecTimeOriginal\", // Fractions of seconds for DateTimeOriginal\n 0x9292 : \"SubsecTimeDigitized\", // Fractions of seconds for DateTimeDigitized\n\n // picture-taking conditions\n 0x829A : \"ExposureTime\", // Exposure time (in seconds)\n 0x829D : \"FNumber\", // F number\n 0x8822 : \"ExposureProgram\", // Exposure program\n 0x8824 : \"SpectralSensitivity\", // Spectral sensitivity\n 0x8827 : \"ISOSpeedRatings\", // ISO speed rating\n 0x8828 : \"OECF\", // Optoelectric conversion factor\n 0x9201 : \"ShutterSpeedValue\", // Shutter speed\n 0x9202 : \"ApertureValue\", // Lens aperture\n 0x9203 : \"BrightnessValue\", // Value of brightness\n 0x9204 : \"ExposureBias\", // Exposure bias\n 0x9205 : \"MaxApertureValue\", // Smallest F number of lens\n 0x9206 : \"SubjectDistance\", // Distance to subject in meters\n 0x9207 : \"MeteringMode\", // Metering mode\n 0x9208 : \"LightSource\", // Kind of light source\n 0x9209 : \"Flash\", // Flash status\n 0x9214 : \"SubjectArea\", // Location and area of main subject\n 0x920A : \"FocalLength\", // Focal length of the lens in mm\n 0xA20B : \"FlashEnergy\", // Strobe energy in BCPS\n 0xA20C : \"SpatialFrequencyResponse\", //\n 0xA20E : \"FocalPlaneXResolution\", // Number of pixels in width direction per FocalPlaneResolutionUnit\n 0xA20F : \"FocalPlaneYResolution\", // Number of pixels in height direction per FocalPlaneResolutionUnit\n 0xA210 : \"FocalPlaneResolutionUnit\", // Unit for measuring FocalPlaneXResolution and FocalPlaneYResolution\n 0xA214 : \"SubjectLocation\", // Location of subject in image\n 0xA215 : \"ExposureIndex\", // Exposure index selected on camera\n 0xA217 : \"SensingMethod\", // Image sensor type\n 0xA300 : \"FileSource\", // Image source (3 == DSC)\n 0xA301 : \"SceneType\", // Scene type (1 == directly photographed)\n 0xA302 : \"CFAPattern\", // Color filter array geometric pattern\n 0xA401 : \"CustomRendered\", // Special processing\n 0xA402 : \"ExposureMode\", // Exposure mode\n 0xA403 : \"WhiteBalance\", // 1 = auto white balance, 2 = manual\n 0xA404 : \"DigitalZoomRation\", // Digital zoom ratio\n 0xA405 : \"FocalLengthIn35mmFilm\", // Equivalent foacl length assuming 35mm film camera (in mm)\n 0xA406 : \"SceneCaptureType\", // Type of scene\n 0xA407 : \"GainControl\", // Degree of overall image gain adjustment\n 0xA408 : \"Contrast\", // Direction of contrast processing applied by camera\n 0xA409 : \"Saturation\", // Direction of saturation processing applied by camera\n 0xA40A : \"Sharpness\", // Direction of sharpness processing applied by camera\n 0xA40B : \"DeviceSettingDescription\", //\n 0xA40C : \"SubjectDistanceRange\", // Distance to subject\n\n // other tags\n 0xA005 : \"InteroperabilityIFDPointer\",\n 0xA420 : \"ImageUniqueID\" // Identifier assigned uniquely to each image\n };\n\n var TiffTags = EXIF.TiffTags = {\n 0x0100 : \"ImageWidth\",\n 0x0101 : \"ImageHeight\",\n 0x8769 : \"ExifIFDPointer\",\n 0x8825 : \"GPSInfoIFDPointer\",\n 0xA005 : \"InteroperabilityIFDPointer\",\n 0x0102 : \"BitsPerSample\",\n 0x0103 : \"Compression\",\n 0x0106 : \"PhotometricInterpretation\",\n 0x0112 : \"Orientation\",\n 0x0115 : \"SamplesPerPixel\",\n 0x011C : \"PlanarConfiguration\",\n 0x0212 : \"YCbCrSubSampling\",\n 0x0213 : \"YCbCrPositioning\",\n 0x011A : \"XResolution\",\n 0x011B : \"YResolution\",\n 0x0128 : \"ResolutionUnit\",\n 0x0111 : \"StripOffsets\",\n 0x0116 : \"RowsPerStrip\",\n 0x0117 : \"StripByteCounts\",\n 0x0201 : \"JPEGInterchangeFormat\",\n 0x0202 : \"JPEGInterchangeFormatLength\",\n 0x012D : \"TransferFunction\",\n 0x013E : \"WhitePoint\",\n 0x013F : \"PrimaryChromaticities\",\n 0x0211 : \"YCbCrCoefficients\",\n 0x0214 : \"ReferenceBlackWhite\",\n 0x0132 : \"DateTime\",\n 0x010E : \"ImageDescription\",\n 0x010F : \"Make\",\n 0x0110 : \"Model\",\n 0x0131 : \"Software\",\n 0x013B : \"Artist\",\n 0x8298 : \"Copyright\"\n };\n\n var GPSTags = EXIF.GPSTags = {\n 0x0000 : \"GPSVersionID\",\n 0x0001 : \"GPSLatitudeRef\",\n 0x0002 : \"GPSLatitude\",\n 0x0003 : \"GPSLongitudeRef\",\n 0x0004 : \"GPSLongitude\",\n 0x0005 : \"GPSAltitudeRef\",\n 0x0006 : \"GPSAltitude\",\n 0x0007 : \"GPSTimeStamp\",\n 0x0008 : \"GPSSatellites\",\n 0x0009 : \"GPSStatus\",\n 0x000A : \"GPSMeasureMode\",\n 0x000B : \"GPSDOP\",\n 0x000C : \"GPSSpeedRef\",\n 0x000D : \"GPSSpeed\",\n 0x000E : \"GPSTrackRef\",\n 0x000F : \"GPSTrack\",\n 0x0010 : \"GPSImgDirectionRef\",\n 0x0011 : \"GPSImgDirection\",\n 0x0012 : \"GPSMapDatum\",\n 0x0013 : \"GPSDestLatitudeRef\",\n 0x0014 : \"GPSDestLatitude\",\n 0x0015 : \"GPSDestLongitudeRef\",\n 0x0016 : \"GPSDestLongitude\",\n 0x0017 : \"GPSDestBearingRef\",\n 0x0018 : \"GPSDestBearing\",\n 0x0019 : \"GPSDestDistanceRef\",\n 0x001A : \"GPSDestDistance\",\n 0x001B : \"GPSProcessingMethod\",\n 0x001C : \"GPSAreaInformation\",\n 0x001D : \"GPSDateStamp\",\n 0x001E : \"GPSDifferential\"\n };\n\n // EXIF 2.3 Spec\n var IFD1Tags = EXIF.IFD1Tags = {\n 0x0100: \"ImageWidth\",\n 0x0101: \"ImageHeight\",\n 0x0102: \"BitsPerSample\",\n 0x0103: \"Compression\",\n 0x0106: \"PhotometricInterpretation\",\n 0x0111: \"StripOffsets\",\n 0x0112: \"Orientation\",\n 0x0115: \"SamplesPerPixel\",\n 0x0116: \"RowsPerStrip\",\n 0x0117: \"StripByteCounts\",\n 0x011A: \"XResolution\",\n 0x011B: \"YResolution\",\n 0x011C: \"PlanarConfiguration\",\n 0x0128: \"ResolutionUnit\",\n 0x0201: \"JpegIFOffset\", // When image format is JPEG, this value show offset to JPEG data stored.(aka \"ThumbnailOffset\" or \"JPEGInterchangeFormat\")\n 0x0202: \"JpegIFByteCount\", // When image format is JPEG, this value shows data size of JPEG image (aka \"ThumbnailLength\" or \"JPEGInterchangeFormatLength\")\n 0x0211: \"YCbCrCoefficients\",\n 0x0212: \"YCbCrSubSampling\",\n 0x0213: \"YCbCrPositioning\",\n 0x0214: \"ReferenceBlackWhite\"\n };\n\n var StringValues = EXIF.StringValues = {\n ExposureProgram : {\n 0 : \"Not defined\",\n 1 : \"Manual\",\n 2 : \"Normal program\",\n 3 : \"Aperture priority\",\n 4 : \"Shutter priority\",\n 5 : \"Creative program\",\n 6 : \"Action program\",\n 7 : \"Portrait mode\",\n 8 : \"Landscape mode\"\n },\n MeteringMode : {\n 0 : \"Unknown\",\n 1 : \"Average\",\n 2 : \"CenterWeightedAverage\",\n 3 : \"Spot\",\n 4 : \"MultiSpot\",\n 5 : \"Pattern\",\n 6 : \"Partial\",\n 255 : \"Other\"\n },\n LightSource : {\n 0 : \"Unknown\",\n 1 : \"Daylight\",\n 2 : \"Fluorescent\",\n 3 : \"Tungsten (incandescent light)\",\n 4 : \"Flash\",\n 9 : \"Fine weather\",\n 10 : \"Cloudy weather\",\n 11 : \"Shade\",\n 12 : \"Daylight fluorescent (D 5700 - 7100K)\",\n 13 : \"Day white fluorescent (N 4600 - 5400K)\",\n 14 : \"Cool white fluorescent (W 3900 - 4500K)\",\n 15 : \"White fluorescent (WW 3200 - 3700K)\",\n 17 : \"Standard light A\",\n 18 : \"Standard light B\",\n 19 : \"Standard light C\",\n 20 : \"D55\",\n 21 : \"D65\",\n 22 : \"D75\",\n 23 : \"D50\",\n 24 : \"ISO studio tungsten\",\n 255 : \"Other\"\n },\n Flash : {\n 0x0000 : \"Flash did not fire\",\n 0x0001 : \"Flash fired\",\n 0x0005 : \"Strobe return light not detected\",\n 0x0007 : \"Strobe return light detected\",\n 0x0009 : \"Flash fired, compulsory flash mode\",\n 0x000D : \"Flash fired, compulsory flash mode, return light not detected\",\n 0x000F : \"Flash fired, compulsory flash mode, return light detected\",\n 0x0010 : \"Flash did not fire, compulsory flash mode\",\n 0x0018 : \"Flash did not fire, auto mode\",\n 0x0019 : \"Flash fired, auto mode\",\n 0x001D : \"Flash fired, auto mode, return light not detected\",\n 0x001F : \"Flash fired, auto mode, return light detected\",\n 0x0020 : \"No flash function\",\n 0x0041 : \"Flash fired, red-eye reduction mode\",\n 0x0045 : \"Flash fired, red-eye reduction mode, return light not detected\",\n 0x0047 : \"Flash fired, red-eye reduction mode, return light detected\",\n 0x0049 : \"Flash fired, compulsory flash mode, red-eye reduction mode\",\n 0x004D : \"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected\",\n 0x004F : \"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected\",\n 0x0059 : \"Flash fired, auto mode, red-eye reduction mode\",\n 0x005D : \"Flash fired, auto mode, return light not detected, red-eye reduction mode\",\n 0x005F : \"Flash fired, auto mode, return light detected, red-eye reduction mode\"\n },\n SensingMethod : {\n 1 : \"Not defined\",\n 2 : \"One-chip color area sensor\",\n 3 : \"Two-chip color area sensor\",\n 4 : \"Three-chip color area sensor\",\n 5 : \"Color sequential area sensor\",\n 7 : \"Trilinear sensor\",\n 8 : \"Color sequential linear sensor\"\n },\n SceneCaptureType : {\n 0 : \"Standard\",\n 1 : \"Landscape\",\n 2 : \"Portrait\",\n 3 : \"Night scene\"\n },\n SceneType : {\n 1 : \"Directly photographed\"\n },\n CustomRendered : {\n 0 : \"Normal process\",\n 1 : \"Custom process\"\n },\n WhiteBalance : {\n 0 : \"Auto white balance\",\n 1 : \"Manual white balance\"\n },\n GainControl : {\n 0 : \"None\",\n 1 : \"Low gain up\",\n 2 : \"High gain up\",\n 3 : \"Low gain down\",\n 4 : \"High gain down\"\n },\n Contrast : {\n 0 : \"Normal\",\n 1 : \"Soft\",\n 2 : \"Hard\"\n },\n Saturation : {\n 0 : \"Normal\",\n 1 : \"Low saturation\",\n 2 : \"High saturation\"\n },\n Sharpness : {\n 0 : \"Normal\",\n 1 : \"Soft\",\n 2 : \"Hard\"\n },\n SubjectDistanceRange : {\n 0 : \"Unknown\",\n 1 : \"Macro\",\n 2 : \"Close view\",\n 3 : \"Distant view\"\n },\n FileSource : {\n 3 : \"DSC\"\n },\n\n Components : {\n 0 : \"\",\n 1 : \"Y\",\n 2 : \"Cb\",\n 3 : \"Cr\",\n 4 : \"R\",\n 5 : \"G\",\n 6 : \"B\"\n }\n };\n\n function addEvent(element, event, handler) {\n if (element.addEventListener) {\n element.addEventListener(event, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + event, handler);\n }\n }\n\n function imageHasData(img) {\n return !!(img.exifdata);\n }\n\n\n function base64ToArrayBuffer(base64, contentType) {\n contentType = contentType || base64.match(/^data\\:([^\\;]+)\\;base64,/mi)[1] || ''; // e.g. 'data:image/jpeg;base64,...' => 'image/jpeg'\n base64 = base64.replace(/^data\\:([^\\;]+)\\;base64,/gmi, '');\n var binary = atob(base64);\n var len = binary.length;\n var buffer = new ArrayBuffer(len);\n var view = new Uint8Array(buffer);\n for (var i = 0; i < len; i++) {\n view[i] = binary.charCodeAt(i);\n }\n return buffer;\n }\n\n function objectURLToBlob(url, callback) {\n var http = new XMLHttpRequest();\n http.open(\"GET\", url, true);\n http.responseType = \"blob\";\n http.onload = function(e) {\n if (this.status == 200 || this.status === 0) {\n callback(this.response);\n }\n };\n http.send();\n }\n\n function getImageData(img, callback) {\n function handleBinaryFile(binFile) {\n var data = findEXIFinJPEG(binFile);\n img.exifdata = data || {};\n var iptcdata = findIPTCinJPEG(binFile);\n img.iptcdata = iptcdata || {};\n if (EXIF.isXmpEnabled) {\n var xmpdata= findXMPinJPEG(binFile);\n img.xmpdata = xmpdata || {}; \n }\n if (callback) {\n callback.call(img);\n }\n }\n\n if (img.src) {\n if (/^data\\:/i.test(img.src)) { // Data URI\n var arrayBuffer = base64ToArrayBuffer(img.src);\n handleBinaryFile(arrayBuffer);\n\n } else if (/^blob\\:/i.test(img.src)) { // Object URL\n var fileReader = new FileReader();\n fileReader.onload = function(e) {\n handleBinaryFile(e.target.result);\n };\n objectURLToBlob(img.src, function (blob) {\n fileReader.readAsArrayBuffer(blob);\n });\n } else {\n var http = new XMLHttpRequest();\n http.onload = function() {\n if (this.status == 200 || this.status === 0) {\n handleBinaryFile(http.response);\n } else {\n throw \"Could not load image\";\n }\n http = null;\n };\n http.open(\"GET\", img.src, true);\n http.responseType = \"arraybuffer\";\n http.send(null);\n }\n } else if (self.FileReader && (img instanceof self.Blob || img instanceof self.File)) {\n var fileReader = new FileReader();\n fileReader.onload = function(e) {\n if (debug) console.log(\"Got file of length \" + e.target.result.byteLength);\n handleBinaryFile(e.target.result);\n };\n\n fileReader.readAsArrayBuffer(img);\n }\n }\n\n function findEXIFinJPEG(file) {\n var dataView = new DataView(file);\n\n if (debug) console.log(\"Got file of length \" + file.byteLength);\n if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {\n if (debug) console.log(\"Not a valid JPEG\");\n return false; // not a valid jpeg\n }\n\n var offset = 2,\n length = file.byteLength,\n marker;\n\n while (offset < length) {\n if (dataView.getUint8(offset) != 0xFF) {\n if (debug) console.log(\"Not a valid marker at offset \" + offset + \", found: \" + dataView.getUint8(offset));\n return false; // not a valid marker, something is wrong\n }\n\n marker = dataView.getUint8(offset + 1);\n if (debug) console.log(marker);\n\n // we could implement handling for other markers here,\n // but we're only looking for 0xFFE1 for EXIF data\n\n if (marker == 225) {\n if (debug) console.log(\"Found 0xFFE1 marker\");\n\n return readEXIFData(dataView, offset + 4, dataView.getUint16(offset + 2) - 2);\n\n // offset += 2 + file.getShortAt(offset+2, true);\n\n } else {\n offset += 2 + dataView.getUint16(offset+2);\n }\n\n }\n\n }\n\n function findIPTCinJPEG(file) {\n var dataView = new DataView(file);\n\n if (debug) console.log(\"Got file of length \" + file.byteLength);\n if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {\n if (debug) console.log(\"Not a valid JPEG\");\n return false; // not a valid jpeg\n }\n\n var offset = 2,\n length = file.byteLength;\n\n\n var isFieldSegmentStart = function(dataView, offset){\n return (\n dataView.getUint8(offset) === 0x38 &&\n dataView.getUint8(offset+1) === 0x42 &&\n dataView.getUint8(offset+2) === 0x49 &&\n dataView.getUint8(offset+3) === 0x4D &&\n dataView.getUint8(offset+4) === 0x04 &&\n dataView.getUint8(offset+5) === 0x04\n );\n };\n\n while (offset < length) {\n\n if ( isFieldSegmentStart(dataView, offset )){\n\n // Get the length of the name header (which is padded to an even number of bytes)\n var nameHeaderLength = dataView.getUint8(offset+7);\n if(nameHeaderLength % 2 !== 0) nameHeaderLength += 1;\n // Check for pre photoshop 6 format\n if(nameHeaderLength === 0) {\n // Always 4\n nameHeaderLength = 4;\n }\n\n var startOffset = offset + 8 + nameHeaderLength;\n var sectionLength = dataView.getUint16(offset + 6 + nameHeaderLength);\n\n return readIPTCData(file, startOffset, sectionLength);\n\n break;\n\n }\n\n\n // Not the marker, continue searching\n offset++;\n\n }\n\n }\n var IptcFieldMap = {\n 0x78 : 'caption',\n 0x6E : 'credit',\n 0x19 : 'keywords',\n 0x37 : 'dateCreated',\n 0x50 : 'byline',\n 0x55 : 'bylineTitle',\n 0x7A : 'captionWriter',\n 0x69 : 'headline',\n 0x74 : 'copyright',\n 0x0F : 'category'\n };\n function readIPTCData(file, startOffset, sectionLength){\n var dataView = new DataView(file);\n var data = {};\n var fieldValue, fieldName, dataSize, segmentType, segmentSize;\n var segmentStartPos = startOffset;\n while(segmentStartPos < startOffset+sectionLength) {\n if(dataView.getUint8(segmentStartPos) === 0x1C && dataView.getUint8(segmentStartPos+1) === 0x02){\n segmentType = dataView.getUint8(segmentStartPos+2);\n if(segmentType in IptcFieldMap) {\n dataSize = dataView.getInt16(segmentStartPos+3);\n segmentSize = dataSize + 5;\n fieldName = IptcFieldMap[segmentType];\n fieldValue = getStringFromDB(dataView, segmentStartPos+5, dataSize);\n // Check if we already stored a value with this name\n if(data.hasOwnProperty(fieldName)) {\n // Value already stored with this name, create multivalue field\n if(data[fieldName] instanceof Array) {\n data[fieldName].push(fieldValue);\n }\n else {\n data[fieldName] = [data[fieldName], fieldValue];\n }\n }\n else {\n data[fieldName] = fieldValue;\n }\n }\n\n }\n segmentStartPos++;\n }\n return data;\n }\n\n\n\n function readTags(file, tiffStart, dirStart, strings, bigEnd) {\n var entries = file.getUint16(dirStart, !bigEnd),\n tags = {},\n entryOffset, tag,\n i;\n\n for (i=0;i<entries;i++) {\n entryOffset = dirStart + i*12 + 2;\n tag = strings[file.getUint16(entryOffset, !bigEnd)];\n if (!tag && debug) console.log(\"Unknown tag: \" + file.getUint16(entryOffset, !bigEnd));\n tags[tag] = readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd);\n }\n return tags;\n }\n\n\n function readTagValue(file, entryOffset, tiffStart, dirStart, bigEnd) {\n var type = file.getUint16(entryOffset+2, !bigEnd),\n numValues = file.getUint32(entryOffset+4, !bigEnd),\n valueOffset = file.getUint32(entryOffset+8, !bigEnd) + tiffStart,\n offset,\n vals, val, n,\n numerator, denominator;\n\n switch (type) {\n case 1: // byte, 8-bit unsigned int\n case 7: // undefined, 8-bit byte, value depending on field\n if (numValues == 1) {\n return file.getUint8(entryOffset + 8, !bigEnd);\n } else {\n offset = numValues > 4 ? valueOffset : (entryOffset + 8);\n vals = [];\n for (n=0;n<numValues;n++) {\n vals[n] = file.getUint8(offset + n);\n }\n return vals;\n }\n\n case 2: // ascii, 8-bit byte\n offset = numValues > 4 ? valueOffset : (entryOffset + 8);\n return getStringFromDB(file, offset, numValues-1);\n\n case 3: // short, 16 bit int\n if (numValues == 1) {\n return file.getUint16(entryOffset + 8, !bigEnd);\n } else {\n offset = numValues > 2 ? valueOffset : (entryOffset + 8);\n vals = [];\n for (n=0;n<numValues;n++) {\n vals[n] = file.getUint16(offset + 2*n, !bigEnd);\n }\n return vals;\n }\n\n case 4: // long, 32 bit int\n if (numValues == 1) {\n return file.getUint32(entryOffset + 8, !bigEnd);\n } else {\n vals = [];\n for (n=0;n<numValues;n++) {\n vals[n] = file.getUint32(valueOffset + 4*n, !bigEnd);\n }\n return vals;\n }\n\n case 5: // rational = two long values, first is numerator, second is denominator\n if (numValues == 1) {\n numerator = file.getUint32(valueOffset, !bigEnd);\n denominator = file.getUint32(valueOffset+4, !bigEnd);\n val = new Number(numerator / denominator);\n val.numerator = numerator;\n val.denominator = denominator;\n return val;\n } else {\n vals = [];\n for (n=0;n<numValues;n++) {\n numerator = file.getUint32(valueOffset + 8*n, !bigEnd);\n denominator = file.getUint32(valueOffset+4 + 8*n, !bigEnd);\n vals[n] = new Number(numerator / denominator);\n vals[n].numerator = numerator;\n vals[n].denominator = denominator;\n }\n return vals;\n }\n\n case 9: // slong, 32 bit signed int\n if (numValues == 1) {\n return file.getInt32(entryOffset + 8, !bigEnd);\n } else {\n vals = [];\n for (n=0;n<numValues;n++) {\n vals[n] = file.getInt32(valueOffset + 4*n, !bigEnd);\n }\n return vals;\n }\n\n case 10: // signed rational, two slongs, first is numerator, second is denominator\n if (numValues == 1) {\n return file.getInt32(valueOffset, !bigEnd) / file.getInt32(valueOffset+4, !bigEnd);\n } else {\n vals = [];\n for (n=0;n<numValues;n++) {\n vals[n] = file.getInt32(valueOffset + 8*n, !bigEnd) / file.getInt32(valueOffset+4 + 8*n, !bigEnd);\n }\n return vals;\n }\n }\n }\n\n /**\n * Given an IFD (Image File Directory) start offset\n * returns an offset to next IFD or 0 if it's the last IFD.\n */\n function getNextIFDOffset(dataView, dirStart, bigEnd){\n //the first 2bytes means the number of directory entries contains in this IFD\n var entries = dataView.getUint16(dirStart, !bigEnd);\n\n // After last directory entry, there is a 4bytes of data,\n // it means an offset to next IFD.\n // If its value is '0x00000000', it means this is the last IFD and there is no linked IFD.\n\n return dataView.getUint32(dirStart + 2 + entries * 12, !bigEnd); // each entry is 12 bytes long\n }\n\n function readThumbnailImage(dataView, tiffStart, firstIFDOffset, bigEnd){\n // get the IFD1 offset\n var IFD1OffsetPointer = getNextIFDOffset(dataView, tiffStart+firstIFDOffset, bigEnd);\n\n if (!IFD1OffsetPointer) {\n // console.log('******** IFD1Offset is empty, image thumb not found ********');\n return {};\n }\n else if (IFD1OffsetPointer > dataView.byteLength) { // this should not happen\n // console.log('******** IFD1Offset is outside the bounds of the DataView ********');\n return {};\n }\n // console.log('******* thumbnail IFD offset (IFD1) is: %s', IFD1OffsetPointer);\n\n var thumbTags = readTags(dataView, tiffStart, tiffStart + IFD1OffsetPointer, IFD1Tags, bigEnd)\n\n // EXIF 2.3 specification for JPEG format thumbnail\n\n // If the value of Compression(0x0103) Tag in IFD1 is '6', thumbnail image format is JPEG.\n // Most of Exif image uses JPEG format for thumbnail. In that case, you can get offset of thumbnail\n // by JpegIFOffset(0x0201) Tag in IFD1, size of thumbnail by JpegIFByteCount(0x0202) Tag.\n // Data format is ordinary JPEG format, starts from 0xFFD8 and ends by 0xFFD9. It seems that\n // JPEG format and 160x120pixels of size are recommended thumbnail format for Exif2.1 or later.\n\n if (thumbTags['Compression']) {\n // console.log('Thumbnail image found!');\n\n switch (thumbTags['Compression']) {\n case 6:\n // console.log('Thumbnail image format is JPEG');\n if (thumbTags.JpegIFOffset && thumbTags.JpegIFByteCount) {\n // extract the thumbnail\n var tOffset = tiffStart + thumbTags.JpegIFOffset;\n var tLength = thumbTags.JpegIFByteCount;\n thumbTags['blob'] = new Blob([new Uint8Array(dataView.buffer, tOffset, tLength)], {\n type: 'image/jpeg'\n });\n }\n break;\n\n case 1:\n console.log(\"Thumbnail image format is TIFF, which is not implemented.\");\n break;\n default:\n console.log(\"Unknown thumbnail image format '%s'\", thumbTags['Compression']);\n }\n }\n else if (thumbTags['PhotometricInterpretation'] == 2) {\n console.log(\"Thumbnail image format is RGB, which is not implemented.\");\n }\n return thumbTags;\n }\n\n function getStringFromDB(buffer, start, length) {\n var outstr = \"\";\n for (n = start; n < start+length; n++) {\n outstr += String.fromCharCode(buffer.getUint8(n));\n }\n return outstr;\n }\n\n function readEXIFData(file, start) {\n if (getStringFromDB(file, start, 4) != \"Exif\") {\n if (debug) console.log(\"Not valid EXIF data! \" + getStringFromDB(file, start, 4));\n return false;\n }\n\n var bigEnd,\n tags, tag,\n exifData, gpsData,\n tiffOffset = start + 6;\n\n // test for TIFF validity and endianness\n if (file.getUint16(tiffOffset) == 0x4949) {\n bigEnd = false;\n } else if (file.getUint16(tiffOffset) == 0x4D4D) {\n bigEnd = true;\n } else {\n if (debug) console.log(\"Not valid TIFF data! (no 0x4949 or 0x4D4D)\");\n return false;\n }\n\n if (file.getUint16(tiffOffset+2, !bigEnd) != 0x002A) {\n if (debug) console.log(\"Not valid TIFF data! (no 0x002A)\");\n return false;\n }\n\n var firstIFDOffset = file.getUint32(tiffOffset+4, !bigEnd);\n\n if (firstIFDOffset < 0x00000008) {\n if (debug) console.log(\"Not valid TIFF data! (First offset less than 8)\", file.getUint32(tiffOffset+4, !bigEnd));\n return false;\n }\n\n tags = readTags(file, tiffOffset, tiffOffset + firstIFDOffset, TiffTags, bigEnd);\n\n if (tags.ExifIFDPointer) {\n exifData = readTags(file, tiffOffset, tiffOffset + tags.ExifIFDPointer, ExifTags, bigEnd);\n for (tag in exifData) {\n switch (tag) {\n case \"LightSource\" :\n case \"Flash\" :\n case \"MeteringMode\" :\n case \"ExposureProgram\" :\n case \"SensingMethod\" :\n case \"SceneCaptureType\" :\n case \"SceneType\" :\n case \"CustomRendered\" :\n case \"WhiteBalance\" :\n case \"GainControl\" :\n case \"Contrast\" :\n case \"Saturation\" :\n case \"Sharpness\" :\n case \"SubjectDistanceRange\" :\n case \"FileSource\" :\n exifData[tag] = StringValues[tag][exifData[tag]];\n break;\n\n case \"ExifVersion\" :\n case \"FlashpixVersion\" :\n exifData[tag] = String.fromCharCode(exifData[tag][0], exifData[tag][1], exifData[tag][2], exifData[tag][3]);\n break;\n\n case \"ComponentsConfiguration\" :\n exifData[tag] =\n StringValues.Components[exifData[tag][0]] +\n StringValues.Components[exifData[tag][1]] +\n StringValues.Components[exifData[tag][2]] +\n StringValues.Components[exifData[tag][3]];\n break;\n }\n tags[tag] = exifData[tag];\n }\n }\n\n if (tags.GPSInfoIFDPointer) {\n gpsData = readTags(file, tiffOffset, tiffOffset + tags.GPSInfoIFDPointer, GPSTags, bigEnd);\n for (tag in gpsData) {\n switch (tag) {\n case \"GPSVersionID\" :\n gpsData[tag] = gpsData[tag][0] +\n \".\" + gpsData[tag][1] +\n \".\" + gpsData[tag][2] +\n \".\" + gpsData[tag][3];\n break;\n }\n tags[tag] = gpsData[tag];\n }\n }\n\n // extract thumbnail\n tags['thumbnail'] = readThumbnailImage(file, tiffOffset, firstIFDOffset, bigEnd);\n\n return tags;\n }\n\n function findXMPinJPEG(file) {\n\n if (!('DOMParser' in self)) {\n // console.warn('XML parsing not supported without DOMParser');\n return;\n }\n var dataView = new DataView(file);\n\n if (debug) console.log(\"Got file of length \" + file.byteLength);\n if ((dataView.getUint8(0) != 0xFF) || (dataView.getUint8(1) != 0xD8)) {\n if (debug) console.log(\"Not a valid JPEG\");\n return false; // not a valid jpeg\n }\n\n var offset = 2,\n length = file.byteLength,\n dom = new DOMParser();\n\n while (offset < (length-4)) {\n if (getStringFromDB(dataView, offset, 4) == \"http\") {\n var startOffset = offset - 1;\n var sectionLength = dataView.getUint16(offset - 2) - 1;\n var xmpString = getStringFromDB(dataView, startOffset, sectionLength)\n var xmpEndIndex = xmpString.indexOf('xmpmeta>') + 8;\n xmpString = xmpString.substring( xmpString.indexOf( '<x:xmpmeta' ), xmpEndIndex );\n\n var indexOfXmp = xmpString.indexOf('x:xmpmeta') + 10\n //Many custom written programs embed xmp/xml without any namespace. Following are some of them.\n //Without these namespaces, XML is thought to be invalid by parsers\n xmpString = xmpString.slice(0, indexOfXmp)\n + 'xmlns:Iptc4xmpCore=\"http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/\" '\n + 'xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" '\n + 'xmlns:tiff=\"http://ns.adobe.com/tiff/1.0/\" '\n + 'xmlns:plus=\"http://schemas.android.com/apk/lib/com.google.android.gms.plus\" '\n + 'xmlns:ext=\"http://www.gettyimages.com/xsltExtension/1.0\" '\n + 'xmlns:exif=\"http://ns.adobe.com/exif/1.0/\" '\n + 'xmlns:stEvt=\"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#\" '\n + 'xmlns:stRef=\"http://ns.adobe.com/xap/1.0/sType/ResourceRef#\" '\n + 'xmlns:crs=\"http://ns.adobe.com/camera-raw-settings/1.0/\" '\n + 'xmlns:xapGImg=\"http://ns.adobe.com/xap/1.0/g/img/\" '\n + 'xmlns:Iptc4xmpExt=\"http://iptc.org/std/Iptc4xmpExt/2008-02-29/\" '\n + xmpString.slice(indexOfXmp)\n\n var domDocument = dom.parseFromString( xmpString, 'text/xml' );\n return xml2Object(domDocument);\n } else{\n offset++;\n }\n }\n }\n\n function xml2json(xml) {\n var json = {};\n \n if (xml.nodeType == 1) { // element node\n if (xml.attributes.length > 0) {\n json['@attributes'] = {};\n for (var j = 0; j < xml.attributes.length; j++) {\n var attribute = xml.attributes.item(j);\n json['@attributes'][attribute.nodeName] = attribute.nodeValue;\n }\n }\n } else if (xml.nodeType == 3) { // text node\n return xml.nodeValue;\n }\n \n // deal with children\n if (xml.hasChildNodes()) {\n for(var i = 0; i < xml.childNodes.length; i++) {\n var child = xml.childNodes.item(i);\n var nodeName = child.nodeName;\n if (json[nodeName] == null) {\n json[nodeName] = xml2json(child);\n } else {\n if (json[nodeName].push == null) {\n var old = json[nodeName];\n json[nodeName] = [];\n json[nodeName].push(old);\n }\n json[nodeName].push(xml2json(child));\n }\n }\n }\n \n return json;\n }\n\n function xml2Object(xml) {\n try {\n var obj = {};\n if (xml.children.length > 0) {\n for (var i = 0; i < xml.children.length; i++) {\n var item = xml.children.item(i);\n var attributes = item.attributes;\n for(var idx in attributes) {\n var itemAtt = attributes[idx];\n var dataKey = itemAtt.nodeName;\n var dataValue = itemAtt.nodeValue;\n\n if(dataKey !== undefined) {\n obj[dataKey] = dataValue;\n }\n }\n var nodeName = item.nodeName;\n\n if (typeof (obj[nodeName]) == \"undefined\") {\n obj[nodeName] = xml2json(item);\n } else {\n if (typeof (obj[nodeName].push) == \"undefined\") {\n var old = obj[nodeName];\n\n obj[nodeName] = [];\n obj[nodeName].push(old);\n }\n obj[nodeName].push(xml2json(item));\n }\n }\n } else {\n obj = xml.textContent;\n }\n return obj;\n } catch (e) {\n console.log(e.message);\n }\n }\n\n EXIF.enableXmp = function() {\n EXIF.isXmpEnabled = true;\n }\n\n EXIF.disableXmp = function() {\n EXIF.isXmpEnabled = false;\n }\n\n EXIF.getData = function(img, callback) {\n if (((self.Image && img instanceof self.Image)\n || (self.HTMLImageElement && img instanceof self.HTMLImageElement))\n && !img.complete)\n return false;\n\n if (!imageHasData(img)) {\n getImageData(img, callback);\n } else {\n if (callback) {\n callback.call(img);\n }\n }\n return true;\n }\n\n EXIF.getTag = function(img, tag) {\n if (!imageHasData(img)) return;\n return img.exifdata[tag];\n }\n \n EXIF.getIptcTag = function(img, tag) {\n if (!imageHasData(img)) return;\n return img.iptcdata[tag];\n }\n\n EXIF.getAllTags = function(img) {\n if (!imageHasData(img)) return {};\n var a,\n data = img.exifdata,\n tags = {};\n for (a in data) {\n if (data.hasOwnProperty(a)) {\n tags[a] = data[a];\n }\n }\n return tags;\n }\n \n EXIF.getAllIptcTags = function(img) {\n if (!imageHasData(img)) return {};\n var a,\n data = img.iptcdata,\n tags = {};\n for (a in data) {\n if (data.hasOwnProperty(a)) {\n tags[a] = data[a];\n }\n }\n return tags;\n }\n\n EXIF.pretty = function(img) {\n if (!imageHasData(img)) return \"\";\n var a,\n data = img.exifdata,\n strPretty = \"\";\n for (a in data) {\n if (data.hasOwnProperty(a)) {\n if (typeof data[a] == \"object\") {\n if (data[a] instanceof Number) {\n strPretty += a + \" : \" + data[a] + \" [\" + data[a].numerator + \"/\" + data[a].denominator + \"]\\r\\n\";\n } else {\n strPretty += a + \" : [\" + data[a].length + \" values]\\r\\n\";\n }\n } else {\n strPretty += a + \" : \" + data[a] + \"\\r\\n\";\n }\n }\n }\n return strPretty;\n }\n\n EXIF.readFromBinaryFile = function(file) {\n return findEXIFinJPEG(file);\n }\n\n if (typeof define === 'function' && define.amd) {\n define('exif-js', [], function() {\n return EXIF;\n });\n }\n}.call(this));\n\n", "/*!\n* sweetalert2 v11.4.8\n* Released under the MIT License.\n*/\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Sweetalert2 = factory());\n}(this, function () { 'use strict';\n\n const consolePrefix = 'SweetAlert2:';\n /**\n * Filter the unique values into a new array\n * @param arr\n */\n\n const uniqueArray = arr => {\n const result = [];\n\n for (let i = 0; i < arr.length; i++) {\n if (result.indexOf(arr[i]) === -1) {\n result.push(arr[i]);\n }\n }\n\n return result;\n };\n /**\n * Capitalize the first letter of a string\n * @param {string} str\n * @returns {string}\n */\n\n const capitalizeFirstLetter = str => str.charAt(0).toUpperCase() + str.slice(1);\n /**\n * @param {NodeList | HTMLCollection | NamedNodeMap} nodeList\n * @returns {array}\n */\n\n const toArray = nodeList => Array.prototype.slice.call(nodeList);\n /**\n * Standardize console warnings\n * @param {string | array} message\n */\n\n const warn = message => {\n console.warn(\"\".concat(consolePrefix, \" \").concat(typeof message === 'object' ? message.join(' ') : message));\n };\n /**\n * Standardize console errors\n * @param {string} message\n */\n\n const error = message => {\n console.error(\"\".concat(consolePrefix, \" \").concat(message));\n };\n /**\n * Private global state for `warnOnce`\n * @type {Array}\n * @private\n */\n\n const previousWarnOnceMessages = [];\n /**\n * Show a console warning, but only if it hasn't already been shown\n * @param {string} message\n */\n\n const warnOnce = message => {\n if (!previousWarnOnceMessages.includes(message)) {\n previousWarnOnceMessages.push(message);\n warn(message);\n }\n };\n /**\n * Show a one-time console warning about deprecated params/methods\n */\n\n const warnAboutDeprecation = (deprecatedParam, useInstead) => {\n warnOnce(\"\\\"\".concat(deprecatedParam, \"\\\" is deprecated and will be removed in the next major release. Please use \\\"\").concat(useInstead, \"\\\" instead.\"));\n };\n /**\n * If `arg` is a function, call it (with no arguments or context) and return the result.\n * Otherwise, just pass the value through\n * @param arg\n */\n\n const callIfFunction = arg => typeof arg === 'function' ? arg() : arg;\n const hasToPromiseFn = arg => arg && typeof arg.toPromise === 'function';\n const asPromise = arg => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg);\n const isPromise = arg => arg && Promise.resolve(arg) === arg;\n\n const defaultParams = {\n title: '',\n titleText: '',\n text: '',\n html: '',\n footer: '',\n icon: undefined,\n iconColor: undefined,\n iconHtml: undefined,\n template: undefined,\n toast: false,\n showClass: {\n popup: 'swal2-show',\n backdrop: 'swal2-backdrop-show',\n icon: 'swal2-icon-show'\n },\n hideClass: {\n popup: 'swal2-hide',\n backdrop: 'swal2-backdrop-hide',\n icon: 'swal2-icon-hide'\n },\n customClass: {},\n target: 'body',\n color: undefined,\n backdrop: true,\n heightAuto: true,\n allowOutsideClick: true,\n allowEscapeKey: true,\n allowEnterKey: true,\n stopKeydownPropagation: true,\n keydownListenerCapture: false,\n showConfirmButton: true,\n showDenyButton: false,\n showCancelButton: false,\n preConfirm: undefined,\n preDeny: undefined,\n confirmButtonText: 'OK',\n confirmButtonAriaLabel: '',\n confirmButtonColor: undefined,\n denyButtonText: 'No',\n denyButtonAriaLabel: '',\n denyButtonColor: undefined,\n cancelButtonText: 'Cancel',\n cancelButtonAriaLabel: '',\n cancelButtonColor: undefined,\n buttonsStyling: true,\n reverseButtons: false,\n focusConfirm: true,\n focusDeny: false,\n focusCancel: false,\n returnFocus: true,\n showCloseButton: false,\n closeButtonHtml: '×',\n closeButtonAriaLabel: 'Close this dialog',\n loaderHtml: '',\n showLoaderOnConfirm: false,\n showLoaderOnDeny: false,\n imageUrl: undefined,\n imageWidth: undefined,\n imageHeight: undefined,\n imageAlt: '',\n timer: undefined,\n timerProgressBar: false,\n width: undefined,\n padding: undefined,\n background: undefined,\n input: undefined,\n inputPlaceholder: '',\n inputLabel: '',\n inputValue: '',\n inputOptions: {},\n inputAutoTrim: true,\n inputAttributes: {},\n inputValidator: undefined,\n returnInputValueOnDeny: false,\n validationMessage: undefined,\n grow: false,\n position: 'center',\n progressSteps: [],\n currentProgressStep: undefined,\n progressStepsDistance: undefined,\n willOpen: undefined,\n didOpen: undefined,\n didRender: undefined,\n willClose: undefined,\n didClose: undefined,\n didDestroy: undefined,\n scrollbarPadding: true\n };\n const updatableParams = ['allowEscapeKey', 'allowOutsideClick', 'background', 'buttonsStyling', 'cancelButtonAriaLabel', 'cancelButtonColor', 'cancelButtonText', 'closeButtonAriaLabel', 'closeButtonHtml', 'color', 'confirmButtonAriaLabel', 'confirmButtonColor', 'confirmButtonText', 'currentProgressStep', 'customClass', 'denyButtonAriaLabel', 'denyButtonColor', 'denyButtonText', 'didClose', 'didDestroy', 'footer', 'hideClass', 'html', 'icon', 'iconColor', 'iconHtml', 'imageAlt', 'imageHeight', 'imageUrl', 'imageWidth', 'preConfirm', 'preDeny', 'progressSteps', 'returnFocus', 'reverseButtons', 'showCancelButton', 'showCloseButton', 'showConfirmButton', 'showDenyButton', 'text', 'title', 'titleText', 'willClose'];\n const deprecatedParams = {};\n const toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusDeny', 'focusCancel', 'returnFocus', 'heightAuto', 'keydownListenerCapture'];\n /**\n * Is valid parameter\n * @param {string} paramName\n */\n\n const isValidParameter = paramName => {\n return Object.prototype.hasOwnProperty.call(defaultParams, paramName);\n };\n /**\n * Is valid parameter for Swal.update() method\n * @param {string} paramName\n */\n\n const isUpdatableParameter = paramName => {\n return updatableParams.indexOf(paramName) !== -1;\n };\n /**\n * Is deprecated parameter\n * @param {string} paramName\n */\n\n const isDeprecatedParameter = paramName => {\n return deprecatedParams[paramName];\n };\n\n const checkIfParamIsValid = param => {\n if (!isValidParameter(param)) {\n warn(\"Unknown parameter \\\"\".concat(param, \"\\\"\"));\n }\n };\n\n const checkIfToastParamIsValid = param => {\n if (toastIncompatibleParams.includes(param)) {\n warn(\"The parameter \\\"\".concat(param, \"\\\" is incompatible with toasts\"));\n }\n };\n\n const checkIfParamIsDeprecated = param => {\n if (isDeprecatedParameter(param)) {\n warnAboutDeprecation(param, isDeprecatedParameter(param));\n }\n };\n /**\n * Show relevant warnings for given params\n *\n * @param params\n */\n\n\n const showWarningsForParams = params => {\n if (!params.backdrop && params.allowOutsideClick) {\n warn('\"allowOutsideClick\" parameter requires `backdrop` parameter to be set to `true`');\n }\n\n for (const param in params) {\n checkIfParamIsValid(param);\n\n if (params.toast) {\n checkIfToastParamIsValid(param);\n }\n\n checkIfParamIsDeprecated(param);\n }\n };\n\n const swalPrefix = 'swal2-';\n const prefix = items => {\n const result = {};\n\n for (const i in items) {\n result[items[i]] = swalPrefix + items[i];\n }\n\n return result;\n };\n const swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'show', 'hide', 'close', 'title', 'html-container', 'actions', 'confirm', 'deny', 'cancel', 'default-outline', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'input-label', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loader', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'timer-progress-bar-container', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error']);\n const iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);\n\n /**\n * Gets the popup container which contains the backdrop and the popup itself.\n *\n * @returns {HTMLElement | null}\n */\n\n const getContainer = () => document.body.querySelector(\".\".concat(swalClasses.container));\n const elementBySelector = selectorString => {\n const container = getContainer();\n return container ? container.querySelector(selectorString) : null;\n };\n\n const elementByClass = className => {\n return elementBySelector(\".\".concat(className));\n };\n\n const getPopup = () => elementByClass(swalClasses.popup);\n const getIcon = () => elementByClass(swalClasses.icon);\n const getTitle = () => elementByClass(swalClasses.title);\n const getHtmlContainer = () => elementByClass(swalClasses['html-container']);\n const getImage = () => elementByClass(swalClasses.image);\n const getProgressSteps = () => elementByClass(swalClasses['progress-steps']);\n const getValidationMessage = () => elementByClass(swalClasses['validation-message']);\n const getConfirmButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.confirm));\n const getDenyButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.deny));\n const getInputLabel = () => elementByClass(swalClasses['input-label']);\n const getLoader = () => elementBySelector(\".\".concat(swalClasses.loader));\n const getCancelButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.cancel));\n const getActions = () => elementByClass(swalClasses.actions);\n const getFooter = () => elementByClass(swalClasses.footer);\n const getTimerProgressBar = () => elementByClass(swalClasses['timer-progress-bar']);\n const getCloseButton = () => elementByClass(swalClasses.close); // https://github.com/jkup/focusable/blob/master/index.js\n\n const focusable = \"\\n a[href],\\n area[href],\\n input:not([disabled]),\\n select:not([disabled]),\\n textarea:not([disabled]),\\n button:not([disabled]),\\n iframe,\\n object,\\n embed,\\n [tabindex=\\\"0\\\"],\\n [contenteditable],\\n audio[controls],\\n video[controls],\\n summary\\n\";\n const getFocusableElements = () => {\n const focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex=\"-1\"]):not([tabindex=\"0\"])')) // sort according to tabindex\n .sort((a, b) => {\n const tabindexA = parseInt(a.getAttribute('tabindex'));\n const tabindexB = parseInt(b.getAttribute('tabindex'));\n\n if (tabindexA > tabindexB) {\n return 1;\n } else if (tabindexA < tabindexB) {\n return -1;\n }\n\n return 0;\n });\n const otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter(el => el.getAttribute('tabindex') !== '-1');\n return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(el => isVisible(el));\n };\n const isModal = () => {\n return hasClass(document.body, swalClasses.shown) && !hasClass(document.body, swalClasses['toast-shown']) && !hasClass(document.body, swalClasses['no-backdrop']);\n };\n const isToast = () => {\n return getPopup() && hasClass(getPopup(), swalClasses.toast);\n };\n const isLoading = () => {\n return getPopup().hasAttribute('data-loading');\n };\n\n const states = {\n previousBodyPadding: null\n };\n /**\n * Securely set innerHTML of an element\n * https://github.com/sweetalert2/sweetalert2/issues/1926\n *\n * @param {HTMLElement} elem\n * @param {string} html\n */\n\n const setInnerHtml = (elem, html) => {\n elem.textContent = '';\n\n if (html) {\n const parser = new DOMParser();\n const parsed = parser.parseFromString(html, \"text/html\");\n toArray(parsed.querySelector('head').childNodes).forEach(child => {\n elem.appendChild(child);\n });\n toArray(parsed.querySelector('body').childNodes).forEach(child => {\n elem.appendChild(child);\n });\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} className\n * @returns {boolean}\n */\n\n const hasClass = (elem, className) => {\n if (!className) {\n return false;\n }\n\n const classList = className.split(/\\s+/);\n\n for (let i = 0; i < classList.length; i++) {\n if (!elem.classList.contains(classList[i])) {\n return false;\n }\n }\n\n return true;\n };\n\n const removeCustomClasses = (elem, params) => {\n toArray(elem.classList).forEach(className => {\n if (!Object.values(swalClasses).includes(className) && !Object.values(iconTypes).includes(className) && !Object.values(params.showClass).includes(className)) {\n elem.classList.remove(className);\n }\n });\n };\n\n const applyCustomClass = (elem, params, className) => {\n removeCustomClasses(elem, params);\n\n if (params.customClass && params.customClass[className]) {\n if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) {\n return warn(\"Invalid type of customClass.\".concat(className, \"! Expected string or iterable object, got \\\"\").concat(typeof params.customClass[className], \"\\\"\"));\n }\n\n addClass(elem, params.customClass[className]);\n }\n };\n /**\n * @param {HTMLElement} popup\n * @param {string} inputType\n * @returns {HTMLInputElement | null}\n */\n\n const getInput = (popup, inputType) => {\n if (!inputType) {\n return null;\n }\n\n switch (inputType) {\n case 'select':\n case 'textarea':\n case 'file':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses[inputType]));\n\n case 'checkbox':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.checkbox, \" input\"));\n\n case 'radio':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.radio, \" input:checked\")) || popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.radio, \" input:first-child\"));\n\n case 'range':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.range, \" input\"));\n\n default:\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.input));\n }\n };\n /**\n * @param {HTMLInputElement} input\n */\n\n const focusInput = input => {\n input.focus(); // place cursor at end of text in text input\n\n if (input.type !== 'file') {\n // http://stackoverflow.com/a/2345915\n const val = input.value;\n input.value = '';\n input.value = val;\n }\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[]} classList\n * @param {boolean} condition\n */\n\n const toggleClass = (target, classList, condition) => {\n if (!target || !classList) {\n return;\n }\n\n if (typeof classList === 'string') {\n classList = classList.split(/\\s+/).filter(Boolean);\n }\n\n classList.forEach(className => {\n if (Array.isArray(target)) {\n target.forEach(elem => {\n condition ? elem.classList.add(className) : elem.classList.remove(className);\n });\n } else {\n condition ? target.classList.add(className) : target.classList.remove(className);\n }\n });\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[]} classList\n */\n\n const addClass = (target, classList) => {\n toggleClass(target, classList, true);\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[]} classList\n */\n\n const removeClass = (target, classList) => {\n toggleClass(target, classList, false);\n };\n /**\n * Get direct child of an element by class name\n *\n * @param {HTMLElement} elem\n * @param {string} className\n * @returns {HTMLElement | null}\n */\n\n const getDirectChildByClass = (elem, className) => {\n const childNodes = toArray(elem.childNodes);\n\n for (let i = 0; i < childNodes.length; i++) {\n if (hasClass(childNodes[i], className)) {\n return childNodes[i];\n }\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} property\n * @param {*} value\n */\n\n const applyNumericalStyle = (elem, property, value) => {\n if (value === \"\".concat(parseInt(value))) {\n value = parseInt(value);\n }\n\n if (value || parseInt(value) === 0) {\n elem.style[property] = typeof value === 'number' ? \"\".concat(value, \"px\") : value;\n } else {\n elem.style.removeProperty(property);\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} display\n */\n\n const show = function (elem) {\n let display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex';\n elem.style.display = display;\n };\n /**\n * @param {HTMLElement} elem\n */\n\n const hide = elem => {\n elem.style.display = 'none';\n };\n const setStyle = (parent, selector, property, value) => {\n const el = parent.querySelector(selector);\n\n if (el) {\n el.style[property] = value;\n }\n };\n const toggle = (elem, condition, display) => {\n condition ? show(elem, display) : hide(elem);\n }; // borrowed from jquery $(elem).is(':visible') implementation\n\n const isVisible = elem => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length));\n const allButtonsAreHidden = () => !isVisible(getConfirmButton()) && !isVisible(getDenyButton()) && !isVisible(getCancelButton());\n const isScrollable = elem => !!(elem.scrollHeight > elem.clientHeight); // borrowed from https://stackoverflow.com/a/46352119\n\n const hasCssAnimation = elem => {\n const style = window.getComputedStyle(elem);\n const animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0');\n const transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0');\n return animDuration > 0 || transDuration > 0;\n };\n const animateTimerProgressBar = function (timer) {\n let reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n const timerProgressBar = getTimerProgressBar();\n\n if (isVisible(timerProgressBar)) {\n if (reset) {\n timerProgressBar.style.transition = 'none';\n timerProgressBar.style.width = '100%';\n }\n\n setTimeout(() => {\n timerProgressBar.style.transition = \"width \".concat(timer / 1000, \"s linear\");\n timerProgressBar.style.width = '0%';\n }, 10);\n }\n };\n const stopTimerProgressBar = () => {\n const timerProgressBar = getTimerProgressBar();\n const timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width);\n timerProgressBar.style.removeProperty('transition');\n timerProgressBar.style.width = '100%';\n const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width);\n const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100;\n timerProgressBar.style.removeProperty('transition');\n timerProgressBar.style.width = \"\".concat(timerProgressBarPercent, \"%\");\n };\n\n /**\n * Detect Node env\n *\n * @returns {boolean}\n */\n const isNodeEnv = () => typeof window === 'undefined' || typeof document === 'undefined';\n\n const RESTORE_FOCUS_TIMEOUT = 100;\n\n const globalState = {};\n\n const focusPreviousActiveElement = () => {\n if (globalState.previousActiveElement && globalState.previousActiveElement.focus) {\n globalState.previousActiveElement.focus();\n globalState.previousActiveElement = null;\n } else if (document.body) {\n document.body.focus();\n }\n }; // Restore previous active (focused) element\n\n\n const restoreActiveElement = returnFocus => {\n return new Promise(resolve => {\n if (!returnFocus) {\n return resolve();\n }\n\n const x = window.scrollX;\n const y = window.scrollY;\n globalState.restoreFocusTimeout = setTimeout(() => {\n focusPreviousActiveElement();\n resolve();\n }, RESTORE_FOCUS_TIMEOUT); // issues/900\n\n window.scrollTo(x, y);\n });\n };\n\n const sweetHTML = \"\\n <div aria-labelledby=\\\"\".concat(swalClasses.title, \"\\\" aria-describedby=\\\"\").concat(swalClasses['html-container'], \"\\\" class=\\\"\").concat(swalClasses.popup, \"\\\" tabindex=\\\"-1\\\">\\n <button type=\\\"button\\\" class=\\\"\").concat(swalClasses.close, \"\\\"></button>\\n <ul class=\\\"\").concat(swalClasses['progress-steps'], \"\\\"></ul>\\n <div class=\\\"\").concat(swalClasses.icon, \"\\\"></div>\\n <img class=\\\"\").concat(swalClasses.image, \"\\\" />\\n <h2 class=\\\"\").concat(swalClasses.title, \"\\\" id=\\\"\").concat(swalClasses.title, \"\\\"></h2>\\n <div class=\\\"\").concat(swalClasses['html-container'], \"\\\" id=\\\"\").concat(swalClasses['html-container'], \"\\\"></div>\\n <input class=\\\"\").concat(swalClasses.input, \"\\\" />\\n <input type=\\\"file\\\" class=\\\"\").concat(swalClasses.file, \"\\\" />\\n <div class=\\\"\").concat(swalClasses.range, \"\\\">\\n <input type=\\\"range\\\" />\\n <output></output>\\n </div>\\n <select class=\\\"\").concat(swalClasses.select, \"\\\"></select>\\n <div class=\\\"\").concat(swalClasses.radio, \"\\\"></div>\\n <label for=\\\"\").concat(swalClasses.checkbox, \"\\\" class=\\\"\").concat(swalClasses.checkbox, \"\\\">\\n <input type=\\\"checkbox\\\" />\\n <span class=\\\"\").concat(swalClasses.label, \"\\\"></span>\\n </label>\\n <textarea class=\\\"\").concat(swalClasses.textarea, \"\\\"></textarea>\\n <div class=\\\"\").concat(swalClasses['validation-message'], \"\\\" id=\\\"\").concat(swalClasses['validation-message'], \"\\\"></div>\\n <div class=\\\"\").concat(swalClasses.actions, \"\\\">\\n <div class=\\\"\").concat(swalClasses.loader, \"\\\"></div>\\n <button type=\\\"button\\\" class=\\\"\").concat(swalClasses.confirm, \"\\\"></button>\\n <button type=\\\"button\\\" class=\\\"\").concat(swalClasses.deny, \"\\\"></button>\\n <button type=\\\"button\\\" class=\\\"\").concat(swalClasses.cancel, \"\\\"></button>\\n </div>\\n <div class=\\\"\").concat(swalClasses.footer, \"\\\"></div>\\n <div class=\\\"\").concat(swalClasses['timer-progress-bar-container'], \"\\\">\\n <div class=\\\"\").concat(swalClasses['timer-progress-bar'], \"\\\"></div>\\n </div>\\n </div>\\n\").replace(/(^|\\n)\\s*/g, '');\n\n const resetOldContainer = () => {\n const oldContainer = getContainer();\n\n if (!oldContainer) {\n return false;\n }\n\n oldContainer.remove();\n removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]);\n return true;\n };\n\n const resetValidationMessage = () => {\n globalState.currentInstance.resetValidationMessage();\n };\n\n const addInputChangeListeners = () => {\n const popup = getPopup();\n const input = getDirectChildByClass(popup, swalClasses.input);\n const file = getDirectChildByClass(popup, swalClasses.file);\n const range = popup.querySelector(\".\".concat(swalClasses.range, \" input\"));\n const rangeOutput = popup.querySelector(\".\".concat(swalClasses.range, \" output\"));\n const select = getDirectChildByClass(popup, swalClasses.select);\n const checkbox = popup.querySelector(\".\".concat(swalClasses.checkbox, \" input\"));\n const textarea = getDirectChildByClass(popup, swalClasses.textarea);\n input.oninput = resetValidationMessage;\n file.onchange = resetValidationMessage;\n select.onchange = resetValidationMessage;\n checkbox.onchange = resetValidationMessage;\n textarea.oninput = resetValidationMessage;\n\n range.oninput = () => {\n resetValidationMessage();\n rangeOutput.value = range.value;\n };\n\n range.onchange = () => {\n resetValidationMessage();\n range.nextSibling.value = range.value;\n };\n };\n\n const getTarget = target => typeof target === 'string' ? document.querySelector(target) : target;\n\n const setupAccessibility = params => {\n const popup = getPopup();\n popup.setAttribute('role', params.toast ? 'alert' : 'dialog');\n popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive');\n\n if (!params.toast) {\n popup.setAttribute('aria-modal', 'true');\n }\n };\n\n const setupRTL = targetElement => {\n if (window.getComputedStyle(targetElement).direction === 'rtl') {\n addClass(getContainer(), swalClasses.rtl);\n }\n };\n /*\n * Add modal + backdrop to DOM\n */\n\n\n const init = params => {\n // Clean up the old popup container if it exists\n const oldContainerExisted = resetOldContainer();\n /* istanbul ignore if */\n\n if (isNodeEnv()) {\n error('SweetAlert2 requires document to initialize');\n return;\n }\n\n const container = document.createElement('div');\n container.className = swalClasses.container;\n\n if (oldContainerExisted) {\n addClass(container, swalClasses['no-transition']);\n }\n\n setInnerHtml(container, sweetHTML);\n const targetElement = getTarget(params.target);\n targetElement.appendChild(container);\n setupAccessibility(params);\n setupRTL(targetElement);\n addInputChangeListeners();\n };\n\n /**\n * @param {HTMLElement | object | string} param\n * @param {HTMLElement} target\n */\n\n const parseHtmlToContainer = (param, target) => {\n // DOM element\n if (param instanceof HTMLElement) {\n target.appendChild(param);\n } // Object\n else if (typeof param === 'object') {\n handleObject(param, target);\n } // Plain string\n else if (param) {\n setInnerHtml(target, param);\n }\n };\n /**\n * @param {object} param\n * @param {HTMLElement} target\n */\n\n const handleObject = (param, target) => {\n // JQuery element(s)\n if (param.jquery) {\n handleJqueryElem(target, param);\n } // For other objects use their string representation\n else {\n setInnerHtml(target, param.toString());\n }\n };\n\n const handleJqueryElem = (target, elem) => {\n target.textContent = '';\n\n if (0 in elem) {\n for (let i = 0; (i in elem); i++) {\n target.appendChild(elem[i].cloneNode(true));\n }\n } else {\n target.appendChild(elem.cloneNode(true));\n }\n };\n\n const animationEndEvent = (() => {\n // Prevent run in Node env\n\n /* istanbul ignore if */\n if (isNodeEnv()) {\n return false;\n }\n\n const testEl = document.createElement('div');\n const transEndEventNames = {\n WebkitAnimation: 'webkitAnimationEnd',\n // Chrome, Safari and Opera\n animation: 'animationend' // Standard syntax\n\n };\n\n for (const i in transEndEventNames) {\n if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') {\n return transEndEventNames[i];\n }\n }\n\n return false;\n })();\n\n // https://github.com/twbs/bootstrap/blob/master/js/src/modal.js\n\n const measureScrollbar = () => {\n const scrollDiv = document.createElement('div');\n scrollDiv.className = swalClasses['scrollbar-measure'];\n document.body.appendChild(scrollDiv);\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n };\n\n const renderActions = (instance, params) => {\n const actions = getActions();\n const loader = getLoader(); // Actions (buttons) wrapper\n\n if (!params.showConfirmButton && !params.showDenyButton && !params.showCancelButton) {\n hide(actions);\n } else {\n show(actions);\n } // Custom class\n\n\n applyCustomClass(actions, params, 'actions'); // Render all the buttons\n\n renderButtons(actions, loader, params); // Loader\n\n setInnerHtml(loader, params.loaderHtml);\n applyCustomClass(loader, params, 'loader');\n };\n\n function renderButtons(actions, loader, params) {\n const confirmButton = getConfirmButton();\n const denyButton = getDenyButton();\n const cancelButton = getCancelButton(); // Render buttons\n\n renderButton(confirmButton, 'confirm', params);\n renderButton(denyButton, 'deny', params);\n renderButton(cancelButton, 'cancel', params);\n handleButtonsStyling(confirmButton, denyButton, cancelButton, params);\n\n if (params.reverseButtons) {\n if (params.toast) {\n actions.insertBefore(cancelButton, confirmButton);\n actions.insertBefore(denyButton, confirmButton);\n } else {\n actions.insertBefore(cancelButton, loader);\n actions.insertBefore(denyButton, loader);\n actions.insertBefore(confirmButton, loader);\n }\n }\n }\n\n function handleButtonsStyling(confirmButton, denyButton, cancelButton, params) {\n if (!params.buttonsStyling) {\n return removeClass([confirmButton, denyButton, cancelButton], swalClasses.styled);\n }\n\n addClass([confirmButton, denyButton, cancelButton], swalClasses.styled); // Buttons background colors\n\n if (params.confirmButtonColor) {\n confirmButton.style.backgroundColor = params.confirmButtonColor;\n addClass(confirmButton, swalClasses['default-outline']);\n }\n\n if (params.denyButtonColor) {\n denyButton.style.backgroundColor = params.denyButtonColor;\n addClass(denyButton, swalClasses['default-outline']);\n }\n\n if (params.cancelButtonColor) {\n cancelButton.style.backgroundColor = params.cancelButtonColor;\n addClass(cancelButton, swalClasses['default-outline']);\n }\n }\n\n function renderButton(button, buttonType, params) {\n toggle(button, params[\"show\".concat(capitalizeFirstLetter(buttonType), \"Button\")], 'inline-block');\n setInnerHtml(button, params[\"\".concat(buttonType, \"ButtonText\")]); // Set caption text\n\n button.setAttribute('aria-label', params[\"\".concat(buttonType, \"ButtonAriaLabel\")]); // ARIA label\n // Add buttons custom classes\n\n button.className = swalClasses[buttonType];\n applyCustomClass(button, params, \"\".concat(buttonType, \"Button\"));\n addClass(button, params[\"\".concat(buttonType, \"ButtonClass\")]);\n }\n\n function handleBackdropParam(container, backdrop) {\n if (typeof backdrop === 'string') {\n container.style.background = backdrop;\n } else if (!backdrop) {\n addClass([document.documentElement, document.body], swalClasses['no-backdrop']);\n }\n }\n\n function handlePositionParam(container, position) {\n if (position in swalClasses) {\n addClass(container, swalClasses[position]);\n } else {\n warn('The \"position\" parameter is not valid, defaulting to \"center\"');\n addClass(container, swalClasses.center);\n }\n }\n\n function handleGrowParam(container, grow) {\n if (grow && typeof grow === 'string') {\n const growClass = \"grow-\".concat(grow);\n\n if (growClass in swalClasses) {\n addClass(container, swalClasses[growClass]);\n }\n }\n }\n\n const renderContainer = (instance, params) => {\n const container = getContainer();\n\n if (!container) {\n return;\n }\n\n handleBackdropParam(container, params.backdrop);\n handlePositionParam(container, params.position);\n handleGrowParam(container, params.grow); // Custom class\n\n applyCustomClass(container, params, 'container');\n };\n\n /**\n * This module contains `WeakMap`s for each effectively-\"private property\" that a `Swal` has.\n * For example, to set the private property \"foo\" of `this` to \"bar\", you can `privateProps.foo.set(this, 'bar')`\n * This is the approach that Babel will probably take to implement private methods/fields\n * https://github.com/tc39/proposal-private-methods\n * https://github.com/babel/babel/pull/7555\n * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*\n * then we can use that language feature.\n */\n var privateProps = {\n awaitingPromise: new WeakMap(),\n promise: new WeakMap(),\n innerParams: new WeakMap(),\n domCache: new WeakMap()\n };\n\n const inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'];\n const renderInput = (instance, params) => {\n const popup = getPopup();\n const innerParams = privateProps.innerParams.get(instance);\n const rerender = !innerParams || params.input !== innerParams.input;\n inputTypes.forEach(inputType => {\n const inputClass = swalClasses[inputType];\n const inputContainer = getDirectChildByClass(popup, inputClass); // set attributes\n\n setAttributes(inputType, params.inputAttributes); // set class\n\n inputContainer.className = inputClass;\n\n if (rerender) {\n hide(inputContainer);\n }\n });\n\n if (params.input) {\n if (rerender) {\n showInput(params);\n } // set custom class\n\n\n setCustomClass(params);\n }\n };\n\n const showInput = params => {\n if (!renderInputType[params.input]) {\n return error(\"Unexpected type of input! Expected \\\"text\\\", \\\"email\\\", \\\"password\\\", \\\"number\\\", \\\"tel\\\", \\\"select\\\", \\\"radio\\\", \\\"checkbox\\\", \\\"textarea\\\", \\\"file\\\" or \\\"url\\\", got \\\"\".concat(params.input, \"\\\"\"));\n }\n\n const inputContainer = getInputContainer(params.input);\n const input = renderInputType[params.input](inputContainer, params);\n show(input); // input autofocus\n\n setTimeout(() => {\n focusInput(input);\n });\n };\n\n const removeAttributes = input => {\n for (let i = 0; i < input.attributes.length; i++) {\n const attrName = input.attributes[i].name;\n\n if (!['type', 'value', 'style'].includes(attrName)) {\n input.removeAttribute(attrName);\n }\n }\n };\n\n const setAttributes = (inputType, inputAttributes) => {\n const input = getInput(getPopup(), inputType);\n\n if (!input) {\n return;\n }\n\n removeAttributes(input);\n\n for (const attr in inputAttributes) {\n input.setAttribute(attr, inputAttributes[attr]);\n }\n };\n\n const setCustomClass = params => {\n const inputContainer = getInputContainer(params.input);\n\n if (params.customClass) {\n addClass(inputContainer, params.customClass.input);\n }\n };\n\n const setInputPlaceholder = (input, params) => {\n if (!input.placeholder || params.inputPlaceholder) {\n input.placeholder = params.inputPlaceholder;\n }\n };\n\n const setInputLabel = (input, prependTo, params) => {\n if (params.inputLabel) {\n input.id = swalClasses.input;\n const label = document.createElement('label');\n const labelClass = swalClasses['input-label'];\n label.setAttribute('for', input.id);\n label.className = labelClass;\n addClass(label, params.customClass.inputLabel);\n label.innerText = params.inputLabel;\n prependTo.insertAdjacentElement('beforebegin', label);\n }\n };\n\n const getInputContainer = inputType => {\n const inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input;\n return getDirectChildByClass(getPopup(), inputClass);\n };\n\n const renderInputType = {};\n\n renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = (input, params) => {\n if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') {\n input.value = params.inputValue;\n } else if (!isPromise(params.inputValue)) {\n warn(\"Unexpected type of inputValue! Expected \\\"string\\\", \\\"number\\\" or \\\"Promise\\\", got \\\"\".concat(typeof params.inputValue, \"\\\"\"));\n }\n\n setInputLabel(input, input, params);\n setInputPlaceholder(input, params);\n input.type = params.input;\n return input;\n };\n\n renderInputType.file = (input, params) => {\n setInputLabel(input, input, params);\n setInputPlaceholder(input, params);\n return input;\n };\n\n renderInputType.range = (range, params) => {\n const rangeInput = range.querySelector('input');\n const rangeOutput = range.querySelector('output');\n rangeInput.value = params.inputValue;\n rangeInput.type = params.input;\n rangeOutput.value = params.inputValue;\n setInputLabel(rangeInput, range, params);\n return range;\n };\n\n renderInputType.select = (select, params) => {\n select.textContent = '';\n\n if (params.inputPlaceholder) {\n const placeholder = document.createElement('option');\n setInnerHtml(placeholder, params.inputPlaceholder);\n placeholder.value = '';\n placeholder.disabled = true;\n placeholder.selected = true;\n select.appendChild(placeholder);\n }\n\n setInputLabel(select, select, params);\n return select;\n };\n\n renderInputType.radio = radio => {\n radio.textContent = '';\n return radio;\n };\n\n renderInputType.checkbox = (checkboxContainer, params) => {\n /** @type {HTMLInputElement} */\n const checkbox = getInput(getPopup(), 'checkbox');\n checkbox.value = '1';\n checkbox.id = swalClasses.checkbox;\n checkbox.checked = Boolean(params.inputValue);\n const label = checkboxContainer.querySelector('span');\n setInnerHtml(label, params.inputPlaceholder);\n return checkboxContainer;\n };\n\n renderInputType.textarea = (textarea, params) => {\n textarea.value = params.inputValue;\n setInputPlaceholder(textarea, params);\n setInputLabel(textarea, textarea, params);\n\n const getMargin = el => parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight); // https://github.com/sweetalert2/sweetalert2/issues/2291\n\n\n setTimeout(() => {\n // https://github.com/sweetalert2/sweetalert2/issues/1699\n if ('MutationObserver' in window) {\n const initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width);\n\n const textareaResizeHandler = () => {\n const textareaWidth = textarea.offsetWidth + getMargin(textarea);\n\n if (textareaWidth > initialPopupWidth) {\n getPopup().style.width = \"\".concat(textareaWidth, \"px\");\n } else {\n getPopup().style.width = null;\n }\n };\n\n new MutationObserver(textareaResizeHandler).observe(textarea, {\n attributes: true,\n attributeFilter: ['style']\n });\n }\n });\n return textarea;\n };\n\n const renderContent = (instance, params) => {\n const htmlContainer = getHtmlContainer();\n applyCustomClass(htmlContainer, params, 'htmlContainer'); // Content as HTML\n\n if (params.html) {\n parseHtmlToContainer(params.html, htmlContainer);\n show(htmlContainer, 'block');\n } // Content as plain text\n else if (params.text) {\n htmlContainer.textContent = params.text;\n show(htmlContainer, 'block');\n } // No content\n else {\n hide(htmlContainer);\n }\n\n renderInput(instance, params);\n };\n\n const renderFooter = (instance, params) => {\n const footer = getFooter();\n toggle(footer, params.footer);\n\n if (params.footer) {\n parseHtmlToContainer(params.footer, footer);\n } // Custom class\n\n\n applyCustomClass(footer, params, 'footer');\n };\n\n const renderCloseButton = (instance, params) => {\n const closeButton = getCloseButton();\n setInnerHtml(closeButton, params.closeButtonHtml); // Custom class\n\n applyCustomClass(closeButton, params, 'closeButton');\n toggle(closeButton, params.showCloseButton);\n closeButton.setAttribute('aria-label', params.closeButtonAriaLabel);\n };\n\n const renderIcon = (instance, params) => {\n const innerParams = privateProps.innerParams.get(instance);\n const icon = getIcon(); // if the given icon already rendered, apply the styling without re-rendering the icon\n\n if (innerParams && params.icon === innerParams.icon) {\n // Custom or default content\n setContent(icon, params);\n applyStyles(icon, params);\n return;\n }\n\n if (!params.icon && !params.iconHtml) {\n return hide(icon);\n }\n\n if (params.icon && Object.keys(iconTypes).indexOf(params.icon) === -1) {\n error(\"Unknown icon! Expected \\\"success\\\", \\\"error\\\", \\\"warning\\\", \\\"info\\\" or \\\"question\\\", got \\\"\".concat(params.icon, \"\\\"\"));\n return hide(icon);\n }\n\n show(icon); // Custom or default content\n\n setContent(icon, params);\n applyStyles(icon, params); // Animate icon\n\n addClass(icon, params.showClass.icon);\n };\n\n const applyStyles = (icon, params) => {\n for (const iconType in iconTypes) {\n if (params.icon !== iconType) {\n removeClass(icon, iconTypes[iconType]);\n }\n }\n\n addClass(icon, iconTypes[params.icon]); // Icon color\n\n setColor(icon, params); // Success icon background color\n\n adjustSuccessIconBackgroundColor(); // Custom class\n\n applyCustomClass(icon, params, 'icon');\n }; // Adjust success icon background color to match the popup background color\n\n\n const adjustSuccessIconBackgroundColor = () => {\n const popup = getPopup();\n const popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color');\n const successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix');\n\n for (let i = 0; i < successIconParts.length; i++) {\n successIconParts[i].style.backgroundColor = popupBackgroundColor;\n }\n };\n\n const successIconHtml = \"\\n <div class=\\\"swal2-success-circular-line-left\\\"></div>\\n <span class=\\\"swal2-success-line-tip\\\"></span> <span class=\\\"swal2-success-line-long\\\"></span>\\n <div class=\\\"swal2-success-ring\\\"></div> <div class=\\\"swal2-success-fix\\\"></div>\\n <div class=\\\"swal2-success-circular-line-right\\\"></div>\\n\";\n const errorIconHtml = \"\\n <span class=\\\"swal2-x-mark\\\">\\n <span class=\\\"swal2-x-mark-line-left\\\"></span>\\n <span class=\\\"swal2-x-mark-line-right\\\"></span>\\n </span>\\n\";\n\n const setContent = (icon, params) => {\n icon.textContent = '';\n\n if (params.iconHtml) {\n setInnerHtml(icon, iconContent(params.iconHtml));\n } else if (params.icon === 'success') {\n setInnerHtml(icon, successIconHtml);\n } else if (params.icon === 'error') {\n setInnerHtml(icon, errorIconHtml);\n } else {\n const defaultIconHtml = {\n question: '?',\n warning: '!',\n info: 'i'\n };\n setInnerHtml(icon, iconContent(defaultIconHtml[params.icon]));\n }\n };\n\n const setColor = (icon, params) => {\n if (!params.iconColor) {\n return;\n }\n\n icon.style.color = params.iconColor;\n icon.style.borderColor = params.iconColor;\n\n for (const sel of ['.swal2-success-line-tip', '.swal2-success-line-long', '.swal2-x-mark-line-left', '.swal2-x-mark-line-right']) {\n setStyle(icon, sel, 'backgroundColor', params.iconColor);\n }\n\n setStyle(icon, '.swal2-success-ring', 'borderColor', params.iconColor);\n };\n\n const iconContent = content => \"<div class=\\\"\".concat(swalClasses['icon-content'], \"\\\">\").concat(content, \"</div>\");\n\n const renderImage = (instance, params) => {\n const image = getImage();\n\n if (!params.imageUrl) {\n return hide(image);\n }\n\n show(image, ''); // Src, alt\n\n image.setAttribute('src', params.imageUrl);\n image.setAttribute('alt', params.imageAlt); // Width, height\n\n applyNumericalStyle(image, 'width', params.imageWidth);\n applyNumericalStyle(image, 'height', params.imageHeight); // Class\n\n image.className = swalClasses.image;\n applyCustomClass(image, params, 'image');\n };\n\n const createStepElement = step => {\n const stepEl = document.createElement('li');\n addClass(stepEl, swalClasses['progress-step']);\n setInnerHtml(stepEl, step);\n return stepEl;\n };\n\n const createLineElement = params => {\n const lineEl = document.createElement('li');\n addClass(lineEl, swalClasses['progress-step-line']);\n\n if (params.progressStepsDistance) {\n lineEl.style.width = params.progressStepsDistance;\n }\n\n return lineEl;\n };\n\n const renderProgressSteps = (instance, params) => {\n const progressStepsContainer = getProgressSteps();\n\n if (!params.progressSteps || params.progressSteps.length === 0) {\n return hide(progressStepsContainer);\n }\n\n show(progressStepsContainer);\n progressStepsContainer.textContent = '';\n\n if (params.currentProgressStep >= params.progressSteps.length) {\n warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)');\n }\n\n params.progressSteps.forEach((step, index) => {\n const stepEl = createStepElement(step);\n progressStepsContainer.appendChild(stepEl);\n\n if (index === params.currentProgressStep) {\n addClass(stepEl, swalClasses['active-progress-step']);\n }\n\n if (index !== params.progressSteps.length - 1) {\n const lineEl = createLineElement(params);\n progressStepsContainer.appendChild(lineEl);\n }\n });\n };\n\n const renderTitle = (instance, params) => {\n const title = getTitle();\n toggle(title, params.title || params.titleText, 'block');\n\n if (params.title) {\n parseHtmlToContainer(params.title, title);\n }\n\n if (params.titleText) {\n title.innerText = params.titleText;\n } // Custom class\n\n\n applyCustomClass(title, params, 'title');\n };\n\n const renderPopup = (instance, params) => {\n const container = getContainer();\n const popup = getPopup(); // Width\n // https://github.com/sweetalert2/sweetalert2/issues/2170\n\n if (params.toast) {\n applyNumericalStyle(container, 'width', params.width);\n popup.style.width = '100%';\n popup.insertBefore(getLoader(), getIcon());\n } else {\n applyNumericalStyle(popup, 'width', params.width);\n } // Padding\n\n\n applyNumericalStyle(popup, 'padding', params.padding); // Color\n\n if (params.color) {\n popup.style.color = params.color;\n } // Background\n\n\n if (params.background) {\n popup.style.background = params.background;\n }\n\n hide(getValidationMessage()); // Classes\n\n addClasses(popup, params);\n };\n\n const addClasses = (popup, params) => {\n // Default Class + showClass when updating Swal.update({})\n popup.className = \"\".concat(swalClasses.popup, \" \").concat(isVisible(popup) ? params.showClass.popup : '');\n\n if (params.toast) {\n addClass([document.documentElement, document.body], swalClasses['toast-shown']);\n addClass(popup, swalClasses.toast);\n } else {\n addClass(popup, swalClasses.modal);\n } // Custom class\n\n\n applyCustomClass(popup, params, 'popup');\n\n if (typeof params.customClass === 'string') {\n addClass(popup, params.customClass);\n } // Icon class (#1842)\n\n\n if (params.icon) {\n addClass(popup, swalClasses[\"icon-\".concat(params.icon)]);\n }\n };\n\n const render = (instance, params) => {\n renderPopup(instance, params);\n renderContainer(instance, params);\n renderProgressSteps(instance, params);\n renderIcon(instance, params);\n renderImage(instance, params);\n renderTitle(instance, params);\n renderCloseButton(instance, params);\n renderContent(instance, params);\n renderActions(instance, params);\n renderFooter(instance, params);\n\n if (typeof params.didRender === 'function') {\n params.didRender(getPopup());\n }\n };\n\n const DismissReason = Object.freeze({\n cancel: 'cancel',\n backdrop: 'backdrop',\n close: 'close',\n esc: 'esc',\n timer: 'timer'\n });\n\n // Adding aria-hidden=\"true\" to elements outside of the active modal dialog ensures that\n // elements not within the active modal dialog will not be surfaced if a user opens a screen\n // reader\u2019s list of elements (headings, form controls, landmarks, etc.) in the document.\n\n const setAriaHidden = () => {\n const bodyChildren = toArray(document.body.children);\n bodyChildren.forEach(el => {\n if (el === getContainer() || el.contains(getContainer())) {\n return;\n }\n\n if (el.hasAttribute('aria-hidden')) {\n el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden'));\n }\n\n el.setAttribute('aria-hidden', 'true');\n });\n };\n const unsetAriaHidden = () => {\n const bodyChildren = toArray(document.body.children);\n bodyChildren.forEach(el => {\n if (el.hasAttribute('data-previous-aria-hidden')) {\n el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden'));\n el.removeAttribute('data-previous-aria-hidden');\n } else {\n el.removeAttribute('aria-hidden');\n }\n });\n };\n\n const swalStringParams = ['swal-title', 'swal-html', 'swal-footer'];\n const getTemplateParams = params => {\n const template = typeof params.template === 'string' ? document.querySelector(params.template) : params.template;\n\n if (!template) {\n return {};\n }\n /** @type {DocumentFragment} */\n\n\n const templateContent = template.content;\n showWarningsForElements(templateContent);\n const result = Object.assign(getSwalParams(templateContent), getSwalButtons(templateContent), getSwalImage(templateContent), getSwalIcon(templateContent), getSwalInput(templateContent), getSwalStringParams(templateContent, swalStringParams));\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n const getSwalParams = templateContent => {\n const result = {};\n toArray(templateContent.querySelectorAll('swal-param')).forEach(param => {\n showWarningsForAttributes(param, ['name', 'value']);\n const paramName = param.getAttribute('name');\n const value = param.getAttribute('value');\n\n if (typeof defaultParams[paramName] === 'boolean' && value === 'false') {\n result[paramName] = false;\n }\n\n if (typeof defaultParams[paramName] === 'object') {\n result[paramName] = JSON.parse(value);\n }\n });\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const getSwalButtons = templateContent => {\n const result = {};\n toArray(templateContent.querySelectorAll('swal-button')).forEach(button => {\n showWarningsForAttributes(button, ['type', 'color', 'aria-label']);\n const type = button.getAttribute('type');\n result[\"\".concat(type, \"ButtonText\")] = button.innerHTML;\n result[\"show\".concat(capitalizeFirstLetter(type), \"Button\")] = true;\n\n if (button.hasAttribute('color')) {\n result[\"\".concat(type, \"ButtonColor\")] = button.getAttribute('color');\n }\n\n if (button.hasAttribute('aria-label')) {\n result[\"\".concat(type, \"ButtonAriaLabel\")] = button.getAttribute('aria-label');\n }\n });\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const getSwalImage = templateContent => {\n const result = {};\n /** @type {HTMLElement} */\n\n const image = templateContent.querySelector('swal-image');\n\n if (image) {\n showWarningsForAttributes(image, ['src', 'width', 'height', 'alt']);\n\n if (image.hasAttribute('src')) {\n result.imageUrl = image.getAttribute('src');\n }\n\n if (image.hasAttribute('width')) {\n result.imageWidth = image.getAttribute('width');\n }\n\n if (image.hasAttribute('height')) {\n result.imageHeight = image.getAttribute('height');\n }\n\n if (image.hasAttribute('alt')) {\n result.imageAlt = image.getAttribute('alt');\n }\n }\n\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const getSwalIcon = templateContent => {\n const result = {};\n /** @type {HTMLElement} */\n\n const icon = templateContent.querySelector('swal-icon');\n\n if (icon) {\n showWarningsForAttributes(icon, ['type', 'color']);\n\n if (icon.hasAttribute('type')) {\n result.icon = icon.getAttribute('type');\n }\n\n if (icon.hasAttribute('color')) {\n result.iconColor = icon.getAttribute('color');\n }\n\n result.iconHtml = icon.innerHTML;\n }\n\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const getSwalInput = templateContent => {\n const result = {};\n /** @type {HTMLElement} */\n\n const input = templateContent.querySelector('swal-input');\n\n if (input) {\n showWarningsForAttributes(input, ['type', 'label', 'placeholder', 'value']);\n result.input = input.getAttribute('type') || 'text';\n\n if (input.hasAttribute('label')) {\n result.inputLabel = input.getAttribute('label');\n }\n\n if (input.hasAttribute('placeholder')) {\n result.inputPlaceholder = input.getAttribute('placeholder');\n }\n\n if (input.hasAttribute('value')) {\n result.inputValue = input.getAttribute('value');\n }\n }\n\n const inputOptions = templateContent.querySelectorAll('swal-input-option');\n\n if (inputOptions.length) {\n result.inputOptions = {};\n toArray(inputOptions).forEach(option => {\n showWarningsForAttributes(option, ['value']);\n const optionValue = option.getAttribute('value');\n const optionName = option.innerHTML;\n result.inputOptions[optionValue] = optionName;\n });\n }\n\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n * @param {string[]} paramNames\n */\n\n\n const getSwalStringParams = (templateContent, paramNames) => {\n const result = {};\n\n for (const i in paramNames) {\n const paramName = paramNames[i];\n /** @type {HTMLElement} */\n\n const tag = templateContent.querySelector(paramName);\n\n if (tag) {\n showWarningsForAttributes(tag, []);\n result[paramName.replace(/^swal-/, '')] = tag.innerHTML.trim();\n }\n }\n\n return result;\n };\n /**\n * @param {DocumentFragment} templateContent\n */\n\n\n const showWarningsForElements = templateContent => {\n const allowedElements = swalStringParams.concat(['swal-param', 'swal-button', 'swal-image', 'swal-icon', 'swal-input', 'swal-input-option']);\n toArray(templateContent.children).forEach(el => {\n const tagName = el.tagName.toLowerCase();\n\n if (allowedElements.indexOf(tagName) === -1) {\n warn(\"Unrecognized element <\".concat(tagName, \">\"));\n }\n });\n };\n /**\n * @param {HTMLElement} el\n * @param {string[]} allowedAttributes\n */\n\n\n const showWarningsForAttributes = (el, allowedAttributes) => {\n toArray(el.attributes).forEach(attribute => {\n if (allowedAttributes.indexOf(attribute.name) === -1) {\n warn([\"Unrecognized attribute \\\"\".concat(attribute.name, \"\\\" on <\").concat(el.tagName.toLowerCase(), \">.\"), \"\".concat(allowedAttributes.length ? \"Allowed attributes are: \".concat(allowedAttributes.join(', ')) : 'To set the value, use HTML within the element.')]);\n }\n });\n };\n\n var defaultInputValidators = {\n email: (string, validationMessage) => {\n return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address');\n },\n url: (string, validationMessage) => {\n // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 and #2013\n return /^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-z]{2,63}\\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL');\n }\n };\n\n function setDefaultInputValidators(params) {\n // Use default `inputValidator` for supported input types if not provided\n if (!params.inputValidator) {\n Object.keys(defaultInputValidators).forEach(key => {\n if (params.input === key) {\n params.inputValidator = defaultInputValidators[key];\n }\n });\n }\n }\n\n function validateCustomTargetElement(params) {\n // Determine if the custom target element is valid\n if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) {\n warn('Target parameter is not valid, defaulting to \"body\"');\n params.target = 'body';\n }\n }\n /**\n * Set type, text and actions on popup\n *\n * @param params\n */\n\n\n function setParameters(params) {\n setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm\n\n if (params.showLoaderOnConfirm && !params.preConfirm) {\n warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\\n' + 'https://sweetalert2.github.io/#ajax-request');\n }\n\n validateCustomTargetElement(params); // Replace newlines with <br> in title\n\n if (typeof params.title === 'string') {\n params.title = params.title.split('\\n').join('<br />');\n }\n\n init(params);\n }\n\n class Timer {\n constructor(callback, delay) {\n this.callback = callback;\n this.remaining = delay;\n this.running = false;\n this.start();\n }\n\n start() {\n if (!this.running) {\n this.running = true;\n this.started = new Date();\n this.id = setTimeout(this.callback, this.remaining);\n }\n\n return this.remaining;\n }\n\n stop() {\n if (this.running) {\n this.running = false;\n clearTimeout(this.id);\n this.remaining -= new Date().getTime() - this.started.getTime();\n }\n\n return this.remaining;\n }\n\n increase(n) {\n const running = this.running;\n\n if (running) {\n this.stop();\n }\n\n this.remaining += n;\n\n if (running) {\n this.start();\n }\n\n return this.remaining;\n }\n\n getTimerLeft() {\n if (this.running) {\n this.stop();\n this.start();\n }\n\n return this.remaining;\n }\n\n isRunning() {\n return this.running;\n }\n\n }\n\n const fixScrollbar = () => {\n // for queues, do not do this more than once\n if (states.previousBodyPadding !== null) {\n return;\n } // if the body has overflow\n\n\n if (document.body.scrollHeight > window.innerHeight) {\n // add padding so the content doesn't shift after removal of scrollbar\n states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right'));\n document.body.style.paddingRight = \"\".concat(states.previousBodyPadding + measureScrollbar(), \"px\");\n }\n };\n const undoScrollbar = () => {\n if (states.previousBodyPadding !== null) {\n document.body.style.paddingRight = \"\".concat(states.previousBodyPadding, \"px\");\n states.previousBodyPadding = null;\n }\n };\n\n /* istanbul ignore file */\n\n const iOSfix = () => {\n const iOS = // @ts-ignore\n /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;\n\n if (iOS && !hasClass(document.body, swalClasses.iosfix)) {\n const offset = document.body.scrollTop;\n document.body.style.top = \"\".concat(offset * -1, \"px\");\n addClass(document.body, swalClasses.iosfix);\n lockBodyScroll();\n addBottomPaddingForTallPopups();\n }\n };\n /**\n * https://github.com/sweetalert2/sweetalert2/issues/1948\n */\n\n const addBottomPaddingForTallPopups = () => {\n const ua = navigator.userAgent;\n const iOS = !!ua.match(/iPad/i) || !!ua.match(/iPhone/i);\n const webkit = !!ua.match(/WebKit/i);\n const iOSSafari = iOS && webkit && !ua.match(/CriOS/i);\n\n if (iOSSafari) {\n const bottomPanelHeight = 44;\n\n if (getPopup().scrollHeight > window.innerHeight - bottomPanelHeight) {\n getContainer().style.paddingBottom = \"\".concat(bottomPanelHeight, \"px\");\n }\n }\n };\n /**\n * https://github.com/sweetalert2/sweetalert2/issues/1246\n */\n\n\n const lockBodyScroll = () => {\n const container = getContainer();\n let preventTouchMove;\n\n container.ontouchstart = e => {\n preventTouchMove = shouldPreventTouchMove(e);\n };\n\n container.ontouchmove = e => {\n if (preventTouchMove) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n };\n\n const shouldPreventTouchMove = event => {\n const target = event.target;\n const container = getContainer();\n\n if (isStylus(event) || isZoom(event)) {\n return false;\n }\n\n if (target === container) {\n return true;\n }\n\n if (!isScrollable(container) && target.tagName !== 'INPUT' && // #1603\n target.tagName !== 'TEXTAREA' && // #2266\n !(isScrollable(getHtmlContainer()) && // #1944\n getHtmlContainer().contains(target))) {\n return true;\n }\n\n return false;\n };\n /**\n * https://github.com/sweetalert2/sweetalert2/issues/1786\n *\n * @param {*} event\n * @returns {boolean}\n */\n\n\n const isStylus = event => {\n return event.touches && event.touches.length && event.touches[0].touchType === 'stylus';\n };\n /**\n * https://github.com/sweetalert2/sweetalert2/issues/1891\n *\n * @param {TouchEvent} event\n * @returns {boolean}\n */\n\n\n const isZoom = event => {\n return event.touches && event.touches.length > 1;\n };\n\n const undoIOSfix = () => {\n if (hasClass(document.body, swalClasses.iosfix)) {\n const offset = parseInt(document.body.style.top, 10);\n removeClass(document.body, swalClasses.iosfix);\n document.body.style.top = '';\n document.body.scrollTop = offset * -1;\n }\n };\n\n const SHOW_CLASS_TIMEOUT = 10;\n /**\n * Open popup, add necessary classes and styles, fix scrollbar\n *\n * @param params\n */\n\n const openPopup = params => {\n const container = getContainer();\n const popup = getPopup();\n\n if (typeof params.willOpen === 'function') {\n params.willOpen(popup);\n }\n\n const bodyStyles = window.getComputedStyle(document.body);\n const initialBodyOverflow = bodyStyles.overflowY;\n addClasses$1(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto'\n\n setTimeout(() => {\n setScrollingVisibility(container, popup);\n }, SHOW_CLASS_TIMEOUT);\n\n if (isModal()) {\n fixScrollContainer(container, params.scrollbarPadding, initialBodyOverflow);\n setAriaHidden();\n }\n\n if (!isToast() && !globalState.previousActiveElement) {\n globalState.previousActiveElement = document.activeElement;\n }\n\n if (typeof params.didOpen === 'function') {\n setTimeout(() => params.didOpen(popup));\n }\n\n removeClass(container, swalClasses['no-transition']);\n };\n\n const swalOpenAnimationFinished = event => {\n const popup = getPopup();\n\n if (event.target !== popup) {\n return;\n }\n\n const container = getContainer();\n popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished);\n container.style.overflowY = 'auto';\n };\n\n const setScrollingVisibility = (container, popup) => {\n if (animationEndEvent && hasCssAnimation(popup)) {\n container.style.overflowY = 'hidden';\n popup.addEventListener(animationEndEvent, swalOpenAnimationFinished);\n } else {\n container.style.overflowY = 'auto';\n }\n };\n\n const fixScrollContainer = (container, scrollbarPadding, initialBodyOverflow) => {\n iOSfix();\n\n if (scrollbarPadding && initialBodyOverflow !== 'hidden') {\n fixScrollbar();\n } // sweetalert2/issues/1247\n\n\n setTimeout(() => {\n container.scrollTop = 0;\n });\n };\n\n const addClasses$1 = (container, popup, params) => {\n addClass(container, params.showClass.backdrop); // this workaround with opacity is needed for https://github.com/sweetalert2/sweetalert2/issues/2059\n\n popup.style.setProperty('opacity', '0', 'important');\n show(popup, 'grid');\n setTimeout(() => {\n // Animate popup right after showing it\n addClass(popup, params.showClass.popup); // and remove the opacity workaround\n\n popup.style.removeProperty('opacity');\n }, SHOW_CLASS_TIMEOUT); // 10ms in order to fix #2062\n\n addClass([document.documentElement, document.body], swalClasses.shown);\n\n if (params.heightAuto && params.backdrop && !params.toast) {\n addClass([document.documentElement, document.body], swalClasses['height-auto']);\n }\n };\n\n /**\n * Shows loader (spinner), this is useful with AJAX requests.\n * By default the loader be shown instead of the \"Confirm\" button.\n */\n\n const showLoading = buttonToReplace => {\n let popup = getPopup();\n\n if (!popup) {\n new Swal(); // eslint-disable-line no-new\n }\n\n popup = getPopup();\n const loader = getLoader();\n\n if (isToast()) {\n hide(getIcon());\n } else {\n replaceButton(popup, buttonToReplace);\n }\n\n show(loader);\n popup.setAttribute('data-loading', true);\n popup.setAttribute('aria-busy', true);\n popup.focus();\n };\n\n const replaceButton = (popup, buttonToReplace) => {\n const actions = getActions();\n const loader = getLoader();\n\n if (!buttonToReplace && isVisible(getConfirmButton())) {\n buttonToReplace = getConfirmButton();\n }\n\n show(actions);\n\n if (buttonToReplace) {\n hide(buttonToReplace);\n loader.setAttribute('data-button-to-replace', buttonToReplace.className);\n }\n\n loader.parentNode.insertBefore(loader, buttonToReplace);\n addClass([popup, actions], swalClasses.loading);\n };\n\n const handleInputOptionsAndValue = (instance, params) => {\n if (params.input === 'select' || params.input === 'radio') {\n handleInputOptions(instance, params);\n } else if (['text', 'email', 'number', 'tel', 'textarea'].includes(params.input) && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) {\n showLoading(getConfirmButton());\n handleInputValue(instance, params);\n }\n };\n const getInputValue = (instance, innerParams) => {\n const input = instance.getInput();\n\n if (!input) {\n return null;\n }\n\n switch (innerParams.input) {\n case 'checkbox':\n return getCheckboxValue(input);\n\n case 'radio':\n return getRadioValue(input);\n\n case 'file':\n return getFileValue(input);\n\n default:\n return innerParams.inputAutoTrim ? input.value.trim() : input.value;\n }\n };\n\n const getCheckboxValue = input => input.checked ? 1 : 0;\n\n const getRadioValue = input => input.checked ? input.value : null;\n\n const getFileValue = input => input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null;\n\n const handleInputOptions = (instance, params) => {\n const popup = getPopup();\n\n const processInputOptions = inputOptions => populateInputOptions[params.input](popup, formatInputOptions(inputOptions), params);\n\n if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) {\n showLoading(getConfirmButton());\n asPromise(params.inputOptions).then(inputOptions => {\n instance.hideLoading();\n processInputOptions(inputOptions);\n });\n } else if (typeof params.inputOptions === 'object') {\n processInputOptions(params.inputOptions);\n } else {\n error(\"Unexpected type of inputOptions! Expected object, Map or Promise, got \".concat(typeof params.inputOptions));\n }\n };\n\n const handleInputValue = (instance, params) => {\n const input = instance.getInput();\n hide(input);\n asPromise(params.inputValue).then(inputValue => {\n input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : \"\".concat(inputValue);\n show(input);\n input.focus();\n instance.hideLoading();\n }).catch(err => {\n error(\"Error in inputValue promise: \".concat(err));\n input.value = '';\n show(input);\n input.focus();\n instance.hideLoading();\n });\n };\n\n const populateInputOptions = {\n select: (popup, inputOptions, params) => {\n const select = getDirectChildByClass(popup, swalClasses.select);\n\n const renderOption = (parent, optionLabel, optionValue) => {\n const option = document.createElement('option');\n option.value = optionValue;\n setInnerHtml(option, optionLabel);\n option.selected = isSelected(optionValue, params.inputValue);\n parent.appendChild(option);\n };\n\n inputOptions.forEach(inputOption => {\n const optionValue = inputOption[0];\n const optionLabel = inputOption[1]; // <optgroup> spec:\n // https://www.w3.org/TR/html401/interact/forms.html#h-17.6\n // \"...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)...\"\n // check whether this is a <optgroup>\n\n if (Array.isArray(optionLabel)) {\n // if it is an array, then it is an <optgroup>\n const optgroup = document.createElement('optgroup');\n optgroup.label = optionValue;\n optgroup.disabled = false; // not configurable for now\n\n select.appendChild(optgroup);\n optionLabel.forEach(o => renderOption(optgroup, o[1], o[0]));\n } else {\n // case of <option>\n renderOption(select, optionLabel, optionValue);\n }\n });\n select.focus();\n },\n radio: (popup, inputOptions, params) => {\n const radio = getDirectChildByClass(popup, swalClasses.radio);\n inputOptions.forEach(inputOption => {\n const radioValue = inputOption[0];\n const radioLabel = inputOption[1];\n const radioInput = document.createElement('input');\n const radioLabelElement = document.createElement('label');\n radioInput.type = 'radio';\n radioInput.name = swalClasses.radio;\n radioInput.value = radioValue;\n\n if (isSelected(radioValue, params.inputValue)) {\n radioInput.checked = true;\n }\n\n const label = document.createElement('span');\n setInnerHtml(label, radioLabel);\n label.className = swalClasses.label;\n radioLabelElement.appendChild(radioInput);\n radioLabelElement.appendChild(label);\n radio.appendChild(radioLabelElement);\n });\n const radios = radio.querySelectorAll('input');\n\n if (radios.length) {\n radios[0].focus();\n }\n }\n };\n /**\n * Converts `inputOptions` into an array of `[value, label]`s\n * @param inputOptions\n */\n\n const formatInputOptions = inputOptions => {\n const result = [];\n\n if (typeof Map !== 'undefined' && inputOptions instanceof Map) {\n inputOptions.forEach((value, key) => {\n let valueFormatted = value;\n\n if (typeof valueFormatted === 'object') {\n // case of <optgroup>\n valueFormatted = formatInputOptions(valueFormatted);\n }\n\n result.push([key, valueFormatted]);\n });\n } else {\n Object.keys(inputOptions).forEach(key => {\n let valueFormatted = inputOptions[key];\n\n if (typeof valueFormatted === 'object') {\n // case of <optgroup>\n valueFormatted = formatInputOptions(valueFormatted);\n }\n\n result.push([key, valueFormatted]);\n });\n }\n\n return result;\n };\n\n const isSelected = (optionValue, inputValue) => {\n return inputValue && inputValue.toString() === optionValue.toString();\n };\n\n /**\n * Hides loader and shows back the button which was hidden by .showLoading()\n */\n\n function hideLoading() {\n // do nothing if popup is closed\n const innerParams = privateProps.innerParams.get(this);\n\n if (!innerParams) {\n return;\n }\n\n const domCache = privateProps.domCache.get(this);\n hide(domCache.loader);\n\n if (isToast()) {\n if (innerParams.icon) {\n show(getIcon());\n }\n } else {\n showRelatedButton(domCache);\n }\n\n removeClass([domCache.popup, domCache.actions], swalClasses.loading);\n domCache.popup.removeAttribute('aria-busy');\n domCache.popup.removeAttribute('data-loading');\n domCache.confirmButton.disabled = false;\n domCache.denyButton.disabled = false;\n domCache.cancelButton.disabled = false;\n }\n\n const showRelatedButton = domCache => {\n const buttonToReplace = domCache.popup.getElementsByClassName(domCache.loader.getAttribute('data-button-to-replace'));\n\n if (buttonToReplace.length) {\n show(buttonToReplace[0], 'inline-block');\n } else if (allButtonsAreHidden()) {\n hide(domCache.actions);\n }\n };\n\n /**\n * Gets the input DOM node, this method works with input parameter.\n * @returns {HTMLElement | null}\n */\n\n function getInput$1(instance) {\n const innerParams = privateProps.innerParams.get(instance || this);\n const domCache = privateProps.domCache.get(instance || this);\n\n if (!domCache) {\n return null;\n }\n\n return getInput(domCache.popup, innerParams.input);\n }\n\n /**\n * This module contains `WeakMap`s for each effectively-\"private property\" that a `Swal` has.\n * For example, to set the private property \"foo\" of `this` to \"bar\", you can `privateProps.foo.set(this, 'bar')`\n * This is the approach that Babel will probably take to implement private methods/fields\n * https://github.com/tc39/proposal-private-methods\n * https://github.com/babel/babel/pull/7555\n * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*\n * then we can use that language feature.\n */\n var privateMethods = {\n swalPromiseResolve: new WeakMap(),\n swalPromiseReject: new WeakMap()\n };\n\n /*\n * Global function to determine if SweetAlert2 popup is shown\n */\n\n const isVisible$1 = () => {\n return isVisible(getPopup());\n };\n /*\n * Global function to click 'Confirm' button\n */\n\n const clickConfirm = () => getConfirmButton() && getConfirmButton().click();\n /*\n * Global function to click 'Deny' button\n */\n\n const clickDeny = () => getDenyButton() && getDenyButton().click();\n /*\n * Global function to click 'Cancel' button\n */\n\n const clickCancel = () => getCancelButton() && getCancelButton().click();\n\n const removeKeydownHandler = globalState => {\n if (globalState.keydownTarget && globalState.keydownHandlerAdded) {\n globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, {\n capture: globalState.keydownListenerCapture\n });\n globalState.keydownHandlerAdded = false;\n }\n };\n const addKeydownHandler = (instance, globalState, innerParams, dismissWith) => {\n removeKeydownHandler(globalState);\n\n if (!innerParams.toast) {\n globalState.keydownHandler = e => keydownHandler(instance, e, dismissWith);\n\n globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup();\n globalState.keydownListenerCapture = innerParams.keydownListenerCapture;\n globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, {\n capture: globalState.keydownListenerCapture\n });\n globalState.keydownHandlerAdded = true;\n }\n }; // Focus handling\n\n const setFocus = (innerParams, index, increment) => {\n const focusableElements = getFocusableElements(); // search for visible elements and select the next possible match\n\n if (focusableElements.length) {\n index = index + increment; // rollover to first item\n\n if (index === focusableElements.length) {\n index = 0; // go to last item\n } else if (index === -1) {\n index = focusableElements.length - 1;\n }\n\n return focusableElements[index].focus();\n } // no visible focusable elements, focus the popup\n\n\n getPopup().focus();\n };\n const arrowKeysNextButton = ['ArrowRight', 'ArrowDown'];\n const arrowKeysPreviousButton = ['ArrowLeft', 'ArrowUp'];\n\n const keydownHandler = (instance, e, dismissWith) => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (!innerParams) {\n return; // This instance has already been destroyed\n } // Ignore keydown during IME composition\n // https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event#ignoring_keydown_during_ime_composition\n // https://github.com/sweetalert2/sweetalert2/issues/720\n // https://github.com/sweetalert2/sweetalert2/issues/2406\n\n\n if (e.isComposing || e.keyCode === 229) {\n return;\n }\n\n if (innerParams.stopKeydownPropagation) {\n e.stopPropagation();\n } // ENTER\n\n\n if (e.key === 'Enter') {\n handleEnter(instance, e, innerParams);\n } // TAB\n else if (e.key === 'Tab') {\n handleTab(e, innerParams);\n } // ARROWS - switch focus between buttons\n else if ([...arrowKeysNextButton, ...arrowKeysPreviousButton].includes(e.key)) {\n handleArrows(e.key);\n } // ESC\n else if (e.key === 'Escape') {\n handleEsc(e, innerParams, dismissWith);\n }\n };\n\n const handleEnter = (instance, e, innerParams) => {\n // https://github.com/sweetalert2/sweetalert2/issues/2386\n if (!callIfFunction(innerParams.allowEnterKey)) {\n return;\n }\n\n if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) {\n if (['textarea', 'file'].includes(innerParams.input)) {\n return; // do not submit\n }\n\n clickConfirm();\n e.preventDefault();\n }\n };\n\n const handleTab = (e, innerParams) => {\n const targetElement = e.target;\n const focusableElements = getFocusableElements();\n let btnIndex = -1;\n\n for (let i = 0; i < focusableElements.length; i++) {\n if (targetElement === focusableElements[i]) {\n btnIndex = i;\n break;\n }\n } // Cycle to the next button\n\n\n if (!e.shiftKey) {\n setFocus(innerParams, btnIndex, 1);\n } // Cycle to the prev button\n else {\n setFocus(innerParams, btnIndex, -1);\n }\n\n e.stopPropagation();\n e.preventDefault();\n };\n\n const handleArrows = key => {\n const confirmButton = getConfirmButton();\n const denyButton = getDenyButton();\n const cancelButton = getCancelButton();\n\n if (![confirmButton, denyButton, cancelButton].includes(document.activeElement)) {\n return;\n }\n\n const sibling = arrowKeysNextButton.includes(key) ? 'nextElementSibling' : 'previousElementSibling';\n let buttonToFocus = document.activeElement;\n\n for (let i = 0; i < getActions().children.length; i++) {\n buttonToFocus = buttonToFocus[sibling];\n\n if (!buttonToFocus) {\n return;\n }\n\n if (isVisible(buttonToFocus) && buttonToFocus instanceof HTMLButtonElement) {\n break;\n }\n }\n\n if (buttonToFocus instanceof HTMLButtonElement) {\n buttonToFocus.focus();\n }\n };\n\n const handleEsc = (e, innerParams, dismissWith) => {\n if (callIfFunction(innerParams.allowEscapeKey)) {\n e.preventDefault();\n dismissWith(DismissReason.esc);\n }\n };\n\n /*\n * Instance method to close sweetAlert\n */\n\n function removePopupAndResetState(instance, container, returnFocus, didClose) {\n if (isToast()) {\n triggerDidCloseAndDispose(instance, didClose);\n } else {\n restoreActiveElement(returnFocus).then(() => triggerDidCloseAndDispose(instance, didClose));\n removeKeydownHandler(globalState);\n }\n\n const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // workaround for #2088\n // for some reason removing the container in Safari will scroll the document to bottom\n\n if (isSafari) {\n container.setAttribute('style', 'display:none !important');\n container.removeAttribute('class');\n container.innerHTML = '';\n } else {\n container.remove();\n }\n\n if (isModal()) {\n undoScrollbar();\n undoIOSfix();\n unsetAriaHidden();\n }\n\n removeBodyClasses();\n }\n\n function removeBodyClasses() {\n removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown']]);\n }\n\n function close(resolveValue) {\n resolveValue = prepareResolveValue(resolveValue);\n const swalPromiseResolve = privateMethods.swalPromiseResolve.get(this);\n const didClose = triggerClosePopup(this);\n\n if (this.isAwaitingPromise()) {\n // A swal awaiting for a promise (after a click on Confirm or Deny) cannot be dismissed anymore #2335\n if (!resolveValue.isDismissed) {\n handleAwaitingPromise(this);\n swalPromiseResolve(resolveValue);\n }\n } else if (didClose) {\n // Resolve Swal promise\n swalPromiseResolve(resolveValue);\n }\n }\n function isAwaitingPromise() {\n return !!privateProps.awaitingPromise.get(this);\n }\n\n const triggerClosePopup = instance => {\n const popup = getPopup();\n\n if (!popup) {\n return false;\n }\n\n const innerParams = privateProps.innerParams.get(instance);\n\n if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) {\n return false;\n }\n\n removeClass(popup, innerParams.showClass.popup);\n addClass(popup, innerParams.hideClass.popup);\n const backdrop = getContainer();\n removeClass(backdrop, innerParams.showClass.backdrop);\n addClass(backdrop, innerParams.hideClass.backdrop);\n handlePopupAnimation(instance, popup, innerParams);\n return true;\n };\n\n function rejectPromise(error) {\n const rejectPromise = privateMethods.swalPromiseReject.get(this);\n handleAwaitingPromise(this);\n\n if (rejectPromise) {\n // Reject Swal promise\n rejectPromise(error);\n }\n }\n const handleAwaitingPromise = instance => {\n if (instance.isAwaitingPromise()) {\n privateProps.awaitingPromise.delete(instance); // The instance might have been previously partly destroyed, we must resume the destroy process in this case #2335\n\n if (!privateProps.innerParams.get(instance)) {\n instance._destroy();\n }\n }\n };\n\n const prepareResolveValue = resolveValue => {\n // When user calls Swal.close()\n if (typeof resolveValue === 'undefined') {\n return {\n isConfirmed: false,\n isDenied: false,\n isDismissed: true\n };\n }\n\n return Object.assign({\n isConfirmed: false,\n isDenied: false,\n isDismissed: false\n }, resolveValue);\n };\n\n const handlePopupAnimation = (instance, popup, innerParams) => {\n const container = getContainer(); // If animation is supported, animate\n\n const animationIsSupported = animationEndEvent && hasCssAnimation(popup);\n\n if (typeof innerParams.willClose === 'function') {\n innerParams.willClose(popup);\n }\n\n if (animationIsSupported) {\n animatePopup(instance, popup, container, innerParams.returnFocus, innerParams.didClose);\n } else {\n // Otherwise, remove immediately\n removePopupAndResetState(instance, container, innerParams.returnFocus, innerParams.didClose);\n }\n };\n\n const animatePopup = (instance, popup, container, returnFocus, didClose) => {\n globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, returnFocus, didClose);\n popup.addEventListener(animationEndEvent, function (e) {\n if (e.target === popup) {\n globalState.swalCloseEventFinishedCallback();\n delete globalState.swalCloseEventFinishedCallback;\n }\n });\n };\n\n const triggerDidCloseAndDispose = (instance, didClose) => {\n setTimeout(() => {\n if (typeof didClose === 'function') {\n didClose.bind(instance.params)();\n }\n\n instance._destroy();\n });\n };\n\n function setButtonsDisabled(instance, buttons, disabled) {\n const domCache = privateProps.domCache.get(instance);\n buttons.forEach(button => {\n domCache[button].disabled = disabled;\n });\n }\n\n function setInputDisabled(input, disabled) {\n if (!input) {\n return false;\n }\n\n if (input.type === 'radio') {\n const radiosContainer = input.parentNode.parentNode;\n const radios = radiosContainer.querySelectorAll('input');\n\n for (let i = 0; i < radios.length; i++) {\n radios[i].disabled = disabled;\n }\n } else {\n input.disabled = disabled;\n }\n }\n\n function enableButtons() {\n setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], false);\n }\n function disableButtons() {\n setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], true);\n }\n function enableInput() {\n return setInputDisabled(this.getInput(), false);\n }\n function disableInput() {\n return setInputDisabled(this.getInput(), true);\n }\n\n function showValidationMessage(error) {\n const domCache = privateProps.domCache.get(this);\n const params = privateProps.innerParams.get(this);\n setInnerHtml(domCache.validationMessage, error);\n domCache.validationMessage.className = swalClasses['validation-message'];\n\n if (params.customClass && params.customClass.validationMessage) {\n addClass(domCache.validationMessage, params.customClass.validationMessage);\n }\n\n show(domCache.validationMessage);\n const input = this.getInput();\n\n if (input) {\n input.setAttribute('aria-invalid', true);\n input.setAttribute('aria-describedby', swalClasses['validation-message']);\n focusInput(input);\n addClass(input, swalClasses.inputerror);\n }\n } // Hide block with validation message\n\n function resetValidationMessage$1() {\n const domCache = privateProps.domCache.get(this);\n\n if (domCache.validationMessage) {\n hide(domCache.validationMessage);\n }\n\n const input = this.getInput();\n\n if (input) {\n input.removeAttribute('aria-invalid');\n input.removeAttribute('aria-describedby');\n removeClass(input, swalClasses.inputerror);\n }\n }\n\n function getProgressSteps$1() {\n const domCache = privateProps.domCache.get(this);\n return domCache.progressSteps;\n }\n\n /**\n * Updates popup parameters.\n */\n\n function update(params) {\n const popup = getPopup();\n const innerParams = privateProps.innerParams.get(this);\n\n if (!popup || hasClass(popup, innerParams.hideClass.popup)) {\n return warn(\"You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.\");\n }\n\n const validUpdatableParams = filterValidParams(params);\n const updatedParams = Object.assign({}, innerParams, validUpdatableParams);\n render(this, updatedParams);\n privateProps.innerParams.set(this, updatedParams);\n Object.defineProperties(this, {\n params: {\n value: Object.assign({}, this.params, params),\n writable: false,\n enumerable: true\n }\n });\n }\n\n const filterValidParams = params => {\n const validUpdatableParams = {};\n Object.keys(params).forEach(param => {\n if (isUpdatableParameter(param)) {\n validUpdatableParams[param] = params[param];\n } else {\n warn(\"Invalid parameter to update: \\\"\".concat(param, \"\\\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\\n\\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md\"));\n }\n });\n return validUpdatableParams;\n };\n\n function _destroy() {\n const domCache = privateProps.domCache.get(this);\n const innerParams = privateProps.innerParams.get(this);\n\n if (!innerParams) {\n disposeWeakMaps(this); // The WeakMaps might have been partly destroyed, we must recall it to dispose any remaining WeakMaps #2335\n\n return; // This instance has already been destroyed\n } // Check if there is another Swal closing\n\n\n if (domCache.popup && globalState.swalCloseEventFinishedCallback) {\n globalState.swalCloseEventFinishedCallback();\n delete globalState.swalCloseEventFinishedCallback;\n } // Check if there is a swal disposal defer timer\n\n\n if (globalState.deferDisposalTimer) {\n clearTimeout(globalState.deferDisposalTimer);\n delete globalState.deferDisposalTimer;\n }\n\n if (typeof innerParams.didDestroy === 'function') {\n innerParams.didDestroy();\n }\n\n disposeSwal(this);\n }\n\n const disposeSwal = instance => {\n disposeWeakMaps(instance); // Unset this.params so GC will dispose it (#1569)\n\n delete instance.params; // Unset globalState props so GC will dispose globalState (#1569)\n\n delete globalState.keydownHandler;\n delete globalState.keydownTarget; // Unset currentInstance\n\n delete globalState.currentInstance;\n };\n\n const disposeWeakMaps = instance => {\n // If the current instance is awaiting a promise result, we keep the privateMethods to call them once the promise result is retrieved #2335\n if (instance.isAwaitingPromise()) {\n unsetWeakMaps(privateProps, instance);\n privateProps.awaitingPromise.set(instance, true);\n } else {\n unsetWeakMaps(privateMethods, instance);\n unsetWeakMaps(privateProps, instance);\n }\n };\n\n const unsetWeakMaps = (obj, instance) => {\n for (const i in obj) {\n obj[i].delete(instance);\n }\n };\n\n\n\n var instanceMethods = /*#__PURE__*/Object.freeze({\n hideLoading: hideLoading,\n disableLoading: hideLoading,\n getInput: getInput$1,\n close: close,\n isAwaitingPromise: isAwaitingPromise,\n rejectPromise: rejectPromise,\n handleAwaitingPromise: handleAwaitingPromise,\n closePopup: close,\n closeModal: close,\n closeToast: close,\n enableButtons: enableButtons,\n disableButtons: disableButtons,\n enableInput: enableInput,\n disableInput: disableInput,\n showValidationMessage: showValidationMessage,\n resetValidationMessage: resetValidationMessage$1,\n getProgressSteps: getProgressSteps$1,\n update: update,\n _destroy: _destroy\n });\n\n const handleConfirmButtonClick = instance => {\n const innerParams = privateProps.innerParams.get(instance);\n instance.disableButtons();\n\n if (innerParams.input) {\n handleConfirmOrDenyWithInput(instance, 'confirm');\n } else {\n confirm(instance, true);\n }\n };\n const handleDenyButtonClick = instance => {\n const innerParams = privateProps.innerParams.get(instance);\n instance.disableButtons();\n\n if (innerParams.returnInputValueOnDeny) {\n handleConfirmOrDenyWithInput(instance, 'deny');\n } else {\n deny(instance, false);\n }\n };\n const handleCancelButtonClick = (instance, dismissWith) => {\n instance.disableButtons();\n dismissWith(DismissReason.cancel);\n };\n\n const handleConfirmOrDenyWithInput = (instance, type\n /* 'confirm' | 'deny' */\n ) => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (!innerParams.input) {\n return error(\"The \\\"input\\\" parameter is needed to be set when using returnInputValueOn\".concat(capitalizeFirstLetter(type)));\n }\n\n const inputValue = getInputValue(instance, innerParams);\n\n if (innerParams.inputValidator) {\n handleInputValidator(instance, inputValue, type);\n } else if (!instance.getInput().checkValidity()) {\n instance.enableButtons();\n instance.showValidationMessage(innerParams.validationMessage);\n } else if (type === 'deny') {\n deny(instance, inputValue);\n } else {\n confirm(instance, inputValue);\n }\n };\n\n const handleInputValidator = (instance, inputValue, type\n /* 'confirm' | 'deny' */\n ) => {\n const innerParams = privateProps.innerParams.get(instance);\n instance.disableInput();\n const validationPromise = Promise.resolve().then(() => asPromise(innerParams.inputValidator(inputValue, innerParams.validationMessage)));\n validationPromise.then(validationMessage => {\n instance.enableButtons();\n instance.enableInput();\n\n if (validationMessage) {\n instance.showValidationMessage(validationMessage);\n } else if (type === 'deny') {\n deny(instance, inputValue);\n } else {\n confirm(instance, inputValue);\n }\n });\n };\n\n const deny = (instance, value) => {\n const innerParams = privateProps.innerParams.get(instance || undefined);\n\n if (innerParams.showLoaderOnDeny) {\n showLoading(getDenyButton());\n }\n\n if (innerParams.preDeny) {\n privateProps.awaitingPromise.set(instance || undefined, true); // Flagging the instance as awaiting a promise so it's own promise's reject/resolve methods doesn't get destroyed until the result from this preDeny's promise is received\n\n const preDenyPromise = Promise.resolve().then(() => asPromise(innerParams.preDeny(value, innerParams.validationMessage)));\n preDenyPromise.then(preDenyValue => {\n if (preDenyValue === false) {\n instance.hideLoading();\n handleAwaitingPromise(instance);\n } else {\n instance.closePopup({\n isDenied: true,\n value: typeof preDenyValue === 'undefined' ? value : preDenyValue\n });\n }\n }).catch(error$$1 => rejectWith(instance || undefined, error$$1));\n } else {\n instance.closePopup({\n isDenied: true,\n value\n });\n }\n };\n\n const succeedWith = (instance, value) => {\n instance.closePopup({\n isConfirmed: true,\n value\n });\n };\n\n const rejectWith = (instance, error$$1) => {\n instance.rejectPromise(error$$1);\n };\n\n const confirm = (instance, value) => {\n const innerParams = privateProps.innerParams.get(instance || undefined);\n\n if (innerParams.showLoaderOnConfirm) {\n showLoading();\n }\n\n if (innerParams.preConfirm) {\n instance.resetValidationMessage();\n privateProps.awaitingPromise.set(instance || undefined, true); // Flagging the instance as awaiting a promise so it's own promise's reject/resolve methods doesn't get destroyed until the result from this preConfirm's promise is received\n\n const preConfirmPromise = Promise.resolve().then(() => asPromise(innerParams.preConfirm(value, innerParams.validationMessage)));\n preConfirmPromise.then(preConfirmValue => {\n if (isVisible(getValidationMessage()) || preConfirmValue === false) {\n instance.hideLoading();\n handleAwaitingPromise(instance);\n } else {\n succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue);\n }\n }).catch(error$$1 => rejectWith(instance || undefined, error$$1));\n } else {\n succeedWith(instance, value);\n }\n };\n\n const handlePopupClick = (instance, domCache, dismissWith) => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (innerParams.toast) {\n handleToastClick(instance, domCache, dismissWith);\n } else {\n // Ignore click events that had mousedown on the popup but mouseup on the container\n // This can happen when the user drags a slider\n handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup\n\n handleContainerMousedown(domCache);\n handleModalClick(instance, domCache, dismissWith);\n }\n };\n\n const handleToastClick = (instance, domCache, dismissWith) => {\n // Closing toast by internal click\n domCache.popup.onclick = () => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (innerParams && (isAnyButtonShown(innerParams) || innerParams.timer || innerParams.input)) {\n return;\n }\n\n dismissWith(DismissReason.close);\n };\n };\n /**\n * @param {*} innerParams\n * @returns {boolean}\n */\n\n\n const isAnyButtonShown = innerParams => {\n return innerParams.showConfirmButton || innerParams.showDenyButton || innerParams.showCancelButton || innerParams.showCloseButton;\n };\n\n let ignoreOutsideClick = false;\n\n const handleModalMousedown = domCache => {\n domCache.popup.onmousedown = () => {\n domCache.container.onmouseup = function (e) {\n domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't\n // have any other direct children aside of the popup\n\n if (e.target === domCache.container) {\n ignoreOutsideClick = true;\n }\n };\n };\n };\n\n const handleContainerMousedown = domCache => {\n domCache.container.onmousedown = () => {\n domCache.popup.onmouseup = function (e) {\n domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup\n\n if (e.target === domCache.popup || domCache.popup.contains(e.target)) {\n ignoreOutsideClick = true;\n }\n };\n };\n };\n\n const handleModalClick = (instance, domCache, dismissWith) => {\n domCache.container.onclick = e => {\n const innerParams = privateProps.innerParams.get(instance);\n\n if (ignoreOutsideClick) {\n ignoreOutsideClick = false;\n return;\n }\n\n if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) {\n dismissWith(DismissReason.backdrop);\n }\n };\n };\n\n const isJqueryElement = elem => typeof elem === 'object' && elem.jquery;\n\n const isElement = elem => elem instanceof Element || isJqueryElement(elem);\n\n const argsToParams = args => {\n const params = {};\n\n if (typeof args[0] === 'object' && !isElement(args[0])) {\n Object.assign(params, args[0]);\n } else {\n ['title', 'html', 'icon'].forEach((name, index) => {\n const arg = args[index];\n\n if (typeof arg === 'string' || isElement(arg)) {\n params[name] = arg;\n } else if (arg !== undefined) {\n error(\"Unexpected type of \".concat(name, \"! Expected \\\"string\\\" or \\\"Element\\\", got \").concat(typeof arg));\n }\n });\n }\n\n return params;\n };\n\n function fire() {\n const Swal = this; // eslint-disable-line @typescript-eslint/no-this-alias\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return new Swal(...args);\n }\n\n /**\n * Returns an extended version of `Swal` containing `params` as defaults.\n * Useful for reusing Swal configuration.\n *\n * For example:\n *\n * Before:\n * const textPromptOptions = { input: 'text', showCancelButton: true }\n * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' })\n * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' })\n *\n * After:\n * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true })\n * const {value: firstName} = await TextPrompt('What is your first name?')\n * const {value: lastName} = await TextPrompt('What is your last name?')\n *\n * @param mixinParams\n */\n function mixin(mixinParams) {\n class MixinSwal extends this {\n _main(params, priorityMixinParams) {\n return super._main(params, Object.assign({}, mixinParams, priorityMixinParams));\n }\n\n }\n\n return MixinSwal;\n }\n\n /**\n * If `timer` parameter is set, returns number of milliseconds of timer remained.\n * Otherwise, returns undefined.\n */\n\n const getTimerLeft = () => {\n return globalState.timeout && globalState.timeout.getTimerLeft();\n };\n /**\n * Stop timer. Returns number of milliseconds of timer remained.\n * If `timer` parameter isn't set, returns undefined.\n */\n\n const stopTimer = () => {\n if (globalState.timeout) {\n stopTimerProgressBar();\n return globalState.timeout.stop();\n }\n };\n /**\n * Resume timer. Returns number of milliseconds of timer remained.\n * If `timer` parameter isn't set, returns undefined.\n */\n\n const resumeTimer = () => {\n if (globalState.timeout) {\n const remaining = globalState.timeout.start();\n animateTimerProgressBar(remaining);\n return remaining;\n }\n };\n /**\n * Resume timer. Returns number of milliseconds of timer remained.\n * If `timer` parameter isn't set, returns undefined.\n */\n\n const toggleTimer = () => {\n const timer = globalState.timeout;\n return timer && (timer.running ? stopTimer() : resumeTimer());\n };\n /**\n * Increase timer. Returns number of milliseconds of an updated timer.\n * If `timer` parameter isn't set, returns undefined.\n */\n\n const increaseTimer = n => {\n if (globalState.timeout) {\n const remaining = globalState.timeout.increase(n);\n animateTimerProgressBar(remaining, true);\n return remaining;\n }\n };\n /**\n * Check if timer is running. Returns true if timer is running\n * or false if timer is paused or stopped.\n * If `timer` parameter isn't set, returns undefined\n */\n\n const isTimerRunning = () => {\n return globalState.timeout && globalState.timeout.isRunning();\n };\n\n let bodyClickListenerAdded = false;\n const clickHandlers = {};\n function bindClickHandler() {\n let attr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'data-swal-template';\n clickHandlers[attr] = this;\n\n if (!bodyClickListenerAdded) {\n document.body.addEventListener('click', bodyClickListener);\n bodyClickListenerAdded = true;\n }\n }\n\n const bodyClickListener = event => {\n for (let el = event.target; el && el !== document; el = el.parentNode) {\n for (const attr in clickHandlers) {\n const template = el.getAttribute(attr);\n\n if (template) {\n clickHandlers[attr].fire({\n template\n });\n return;\n }\n }\n }\n };\n\n\n\n var staticMethods = /*#__PURE__*/Object.freeze({\n isValidParameter: isValidParameter,\n isUpdatableParameter: isUpdatableParameter,\n isDeprecatedParameter: isDeprecatedParameter,\n argsToParams: argsToParams,\n isVisible: isVisible$1,\n clickConfirm: clickConfirm,\n clickDeny: clickDeny,\n clickCancel: clickCancel,\n getContainer: getContainer,\n getPopup: getPopup,\n getTitle: getTitle,\n getHtmlContainer: getHtmlContainer,\n getImage: getImage,\n getIcon: getIcon,\n getInputLabel: getInputLabel,\n getCloseButton: getCloseButton,\n getActions: getActions,\n getConfirmButton: getConfirmButton,\n getDenyButton: getDenyButton,\n getCancelButton: getCancelButton,\n getLoader: getLoader,\n getFooter: getFooter,\n getTimerProgressBar: getTimerProgressBar,\n getFocusableElements: getFocusableElements,\n getValidationMessage: getValidationMessage,\n isLoading: isLoading,\n fire: fire,\n mixin: mixin,\n showLoading: showLoading,\n enableLoading: showLoading,\n getTimerLeft: getTimerLeft,\n stopTimer: stopTimer,\n resumeTimer: resumeTimer,\n toggleTimer: toggleTimer,\n increaseTimer: increaseTimer,\n isTimerRunning: isTimerRunning,\n bindClickHandler: bindClickHandler\n });\n\n let currentInstance;\n\n class SweetAlert {\n constructor() {\n // Prevent run in Node env\n if (typeof window === 'undefined') {\n return;\n }\n\n currentInstance = this; // @ts-ignore\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n const outerParams = Object.freeze(this.constructor.argsToParams(args));\n Object.defineProperties(this, {\n params: {\n value: outerParams,\n writable: false,\n enumerable: true,\n configurable: true\n }\n }); // @ts-ignore\n\n const promise = this._main(this.params);\n\n privateProps.promise.set(this, promise);\n }\n\n _main(userParams) {\n let mixinParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n showWarningsForParams(Object.assign({}, mixinParams, userParams));\n\n if (globalState.currentInstance) {\n globalState.currentInstance._destroy();\n\n if (isModal()) {\n unsetAriaHidden();\n }\n }\n\n globalState.currentInstance = this;\n const innerParams = prepareParams(userParams, mixinParams);\n setParameters(innerParams);\n Object.freeze(innerParams); // clear the previous timer\n\n if (globalState.timeout) {\n globalState.timeout.stop();\n delete globalState.timeout;\n } // clear the restore focus timeout\n\n\n clearTimeout(globalState.restoreFocusTimeout);\n const domCache = populateDomCache(this);\n render(this, innerParams);\n privateProps.innerParams.set(this, innerParams);\n return swalPromise(this, domCache, innerParams);\n } // `catch` cannot be the name of a module export, so we define our thenable methods here instead\n\n\n then(onFulfilled) {\n const promise = privateProps.promise.get(this);\n return promise.then(onFulfilled);\n }\n\n finally(onFinally) {\n const promise = privateProps.promise.get(this);\n return promise.finally(onFinally);\n }\n\n }\n\n const swalPromise = (instance, domCache, innerParams) => {\n return new Promise((resolve, reject) => {\n // functions to handle all closings/dismissals\n const dismissWith = dismiss => {\n instance.closePopup({\n isDismissed: true,\n dismiss\n });\n };\n\n privateMethods.swalPromiseResolve.set(instance, resolve);\n privateMethods.swalPromiseReject.set(instance, reject);\n\n domCache.confirmButton.onclick = () => handleConfirmButtonClick(instance);\n\n domCache.denyButton.onclick = () => handleDenyButtonClick(instance);\n\n domCache.cancelButton.onclick = () => handleCancelButtonClick(instance, dismissWith);\n\n domCache.closeButton.onclick = () => dismissWith(DismissReason.close);\n\n handlePopupClick(instance, domCache, dismissWith);\n addKeydownHandler(instance, globalState, innerParams, dismissWith);\n handleInputOptionsAndValue(instance, innerParams);\n openPopup(innerParams);\n setupTimer(globalState, innerParams, dismissWith);\n initFocus(domCache, innerParams); // Scroll container to top on open (#1247, #1946)\n\n setTimeout(() => {\n domCache.container.scrollTop = 0;\n });\n });\n };\n\n const prepareParams = (userParams, mixinParams) => {\n const templateParams = getTemplateParams(userParams);\n const params = Object.assign({}, defaultParams, mixinParams, templateParams, userParams); // precedence is described in #2131\n\n params.showClass = Object.assign({}, defaultParams.showClass, params.showClass);\n params.hideClass = Object.assign({}, defaultParams.hideClass, params.hideClass);\n return params;\n };\n\n const populateDomCache = instance => {\n const domCache = {\n popup: getPopup(),\n container: getContainer(),\n actions: getActions(),\n confirmButton: getConfirmButton(),\n denyButton: getDenyButton(),\n cancelButton: getCancelButton(),\n loader: getLoader(),\n closeButton: getCloseButton(),\n validationMessage: getValidationMessage(),\n progressSteps: getProgressSteps()\n };\n privateProps.domCache.set(instance, domCache);\n return domCache;\n };\n\n const setupTimer = (globalState$$1, innerParams, dismissWith) => {\n const timerProgressBar = getTimerProgressBar();\n hide(timerProgressBar);\n\n if (innerParams.timer) {\n globalState$$1.timeout = new Timer(() => {\n dismissWith('timer');\n delete globalState$$1.timeout;\n }, innerParams.timer);\n\n if (innerParams.timerProgressBar) {\n show(timerProgressBar);\n applyCustomClass(timerProgressBar, innerParams, 'timerProgressBar');\n setTimeout(() => {\n if (globalState$$1.timeout && globalState$$1.timeout.running) {\n // timer can be already stopped or unset at this point\n animateTimerProgressBar(innerParams.timer);\n }\n });\n }\n }\n };\n\n const initFocus = (domCache, innerParams) => {\n if (innerParams.toast) {\n return;\n }\n\n if (!callIfFunction(innerParams.allowEnterKey)) {\n return blurActiveElement();\n }\n\n if (!focusButton(domCache, innerParams)) {\n setFocus(innerParams, -1, 1);\n }\n };\n\n const focusButton = (domCache, innerParams) => {\n if (innerParams.focusDeny && isVisible(domCache.denyButton)) {\n domCache.denyButton.focus();\n return true;\n }\n\n if (innerParams.focusCancel && isVisible(domCache.cancelButton)) {\n domCache.cancelButton.focus();\n return true;\n }\n\n if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) {\n domCache.confirmButton.focus();\n return true;\n }\n\n return false;\n };\n\n const blurActiveElement = () => {\n if (document.activeElement instanceof HTMLElement && typeof document.activeElement.blur === 'function') {\n document.activeElement.blur();\n }\n }; // Assign instance methods from src/instanceMethods/*.js to prototype\n\n\n Object.assign(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor\n\n Object.assign(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility\n\n Object.keys(instanceMethods).forEach(key => {\n SweetAlert[key] = function () {\n if (currentInstance) {\n return currentInstance[key](...arguments);\n }\n };\n });\n SweetAlert.DismissReason = DismissReason;\n SweetAlert.version = '11.4.8';\n\n const Swal = SweetAlert; // @ts-ignore\n\n Swal.default = Swal;\n\n return Swal;\n\n}));\nif (typeof this !== 'undefined' && this.Sweetalert2){ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2}\n", "export class BitMatrix {\n public static createEmpty(width: number, height: number) {\n return new BitMatrix(new Uint8ClampedArray(width * height), width);\n }\n\n public width: number;\n public height: number;\n private data: Uint8ClampedArray;\n\n constructor(data: Uint8ClampedArray, width: number) {\n this.width = width;\n this.height = data.length / width;\n this.data = data;\n }\n\n public get(x: number, y: number): boolean {\n if (x < 0 || x >= this.width || y < 0 || y >= this.height) {\n return false;\n }\n return !!this.data[y * this.width + x];\n }\n\n public set(x: number, y: number, v: boolean) {\n this.data[y * this.width + x] = v ? 1 : 0;\n }\n\n public setRegion(left: number, top: number, width: number, height: number, v: boolean) {\n for (let y = top; y < top + height; y++) {\n for (let x = left; x < left + width; x++) {\n this.set(x, y, !!v);\n }\n }\n }\n}\n", "import {BitMatrix} from \"../BitMatrix\";\nimport {GreyscaleWeights} from \"../index\";\n\nconst REGION_SIZE = 8;\nconst MIN_DYNAMIC_RANGE = 24;\n\nfunction numBetween(value: number, min: number, max: number): number {\n return value < min ? min : value > max ? max : value;\n}\n\n// Like BitMatrix but accepts arbitry Uint8 values\nclass Matrix {\n private data: Uint8ClampedArray;\n private width: number;\n constructor(width: number, height: number, buffer?: Uint8ClampedArray) {\n this.width = width;\n const bufferSize = width * height;\n if (buffer && buffer.length !== bufferSize) {\n throw new Error(\"Wrong buffer size\");\n }\n this.data = buffer || new Uint8ClampedArray(bufferSize);\n }\n public get(x: number, y: number) {\n return this.data[y * this.width + x];\n }\n public set(x: number, y: number, value: number) {\n this.data[y * this.width + x] = value;\n }\n}\n\nexport function binarize(data: Uint8ClampedArray, width: number, height: number, returnInverted: boolean,\n greyscaleWeights: GreyscaleWeights, canOverwriteImage: boolean) {\n const pixelCount = width * height;\n if (data.length !== pixelCount * 4) {\n throw new Error(\"Malformed data passed to binarizer.\");\n }\n // assign the greyscale and binary image within the rgba buffer as the rgba image will not be needed after conversion\n let bufferOffset = 0;\n // Convert image to greyscale\n let greyscaleBuffer: Uint8ClampedArray;\n if (canOverwriteImage) {\n greyscaleBuffer = new Uint8ClampedArray(data.buffer, bufferOffset, pixelCount);\n bufferOffset += pixelCount;\n }\n const greyscalePixels = new Matrix(width, height, greyscaleBuffer);\n if (greyscaleWeights.useIntegerApproximation) {\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const pixelPosition = (y * width + x) * 4;\n const r = data[pixelPosition];\n const g = data[pixelPosition + 1];\n const b = data[pixelPosition + 2];\n greyscalePixels.set(x, y,\n // tslint:disable-next-line no-bitwise\n (greyscaleWeights.red * r + greyscaleWeights.green * g + greyscaleWeights.blue * b + 128) >> 8);\n }\n }\n } else {\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const pixelPosition = (y * width + x) * 4;\n const r = data[pixelPosition];\n const g = data[pixelPosition + 1];\n const b = data[pixelPosition + 2];\n greyscalePixels.set(x, y,\n greyscaleWeights.red * r + greyscaleWeights.green * g + greyscaleWeights.blue * b);\n }\n }\n }\n const horizontalRegionCount = Math.ceil(width / REGION_SIZE);\n const verticalRegionCount = Math.ceil(height / REGION_SIZE);\n const blackPointsCount = horizontalRegionCount * verticalRegionCount;\n\n let blackPointsBuffer: Uint8ClampedArray;\n if (canOverwriteImage) {\n blackPointsBuffer = new Uint8ClampedArray(data.buffer, bufferOffset, blackPointsCount);\n bufferOffset += blackPointsCount;\n }\n const blackPoints = new Matrix(horizontalRegionCount, verticalRegionCount, blackPointsBuffer);\n for (let verticalRegion = 0; verticalRegion < verticalRegionCount; verticalRegion++) {\n for (let hortizontalRegion = 0; hortizontalRegion < horizontalRegionCount; hortizontalRegion++) {\n let min = Infinity;\n let max = 0;\n for (let y = 0; y < REGION_SIZE; y++) {\n for (let x = 0; x < REGION_SIZE; x++) {\n const pixelLumosity =\n greyscalePixels.get(hortizontalRegion * REGION_SIZE + x, verticalRegion * REGION_SIZE + y);\n min = Math.min(min, pixelLumosity);\n max = Math.max(max, pixelLumosity);\n }\n }\n // We could also compute the real average of all pixels but following the assumption that the qr code consists\n // of bright and dark pixels and essentially not much in between, by (min + max)/2 we make the cut really between\n // those two classes. If using the average over all pixel in a block of mostly bright pixels and few dark pixels,\n // the avg would tend to the bright side and darker bright pixels could be interpreted as dark.\n let average = (min + max) / 2;\n // Small bias towards black by moving the threshold up. We do this, as in the finder patterns white holes tend\n // to appear which makes them undetectable.\n const blackBias = 1.11;\n average = Math.min(255, average * blackBias);\n if (max - min <= MIN_DYNAMIC_RANGE) {\n // If variation within the block is low, assume this is a block with only light or only\n // dark pixels. In that case we do not want to use the average, as it would divide this\n // low contrast area into black and white pixels, essentially creating data out of noise.\n //\n // Default the blackpoint for these blocks to be half the min - effectively white them out\n average = min / 2;\n\n if (verticalRegion > 0 && hortizontalRegion > 0) {\n // Correct the \"white background\" assumption for blocks that have neighbors by comparing\n // the pixels in this block to the previously calculated black points. This is based on\n // the fact that dark barcode symbology is always surrounded by some amount of light\n // background for which reasonable black point estimates were made. The bp estimated at\n // the boundaries is used for the interior.\n\n // The (min < bp) is arbitrary but works better than other heuristics that were tried.\n const averageNeighborBlackPoint = (\n blackPoints.get(hortizontalRegion, verticalRegion - 1) +\n (2 * blackPoints.get(hortizontalRegion - 1, verticalRegion)) +\n blackPoints.get(hortizontalRegion - 1, verticalRegion - 1)\n ) / 4;\n if (min < averageNeighborBlackPoint) {\n average = averageNeighborBlackPoint; // no need to apply black bias as already applied to neighbors\n }\n }\n }\n blackPoints.set(hortizontalRegion, verticalRegion, average);\n }\n }\n\n let binarized: BitMatrix;\n if (canOverwriteImage) {\n const binarizedBuffer = new Uint8ClampedArray(data.buffer, bufferOffset, pixelCount);\n bufferOffset += pixelCount;\n binarized = new BitMatrix(binarizedBuffer, width);\n } else {\n binarized = BitMatrix.createEmpty(width, height);\n }\n\n let inverted: BitMatrix = null;\n if (returnInverted) {\n if (canOverwriteImage) {\n const invertedBuffer = new Uint8ClampedArray(data.buffer, bufferOffset, pixelCount);\n inverted = new BitMatrix(invertedBuffer, width);\n } else {\n inverted = BitMatrix.createEmpty(width, height);\n }\n }\n\n for (let verticalRegion = 0; verticalRegion < verticalRegionCount; verticalRegion++) {\n for (let hortizontalRegion = 0; hortizontalRegion < horizontalRegionCount; hortizontalRegion++) {\n const left = numBetween(hortizontalRegion, 2, horizontalRegionCount - 3);\n const top = numBetween(verticalRegion, 2, verticalRegionCount - 3);\n let sum = 0;\n for (let xRegion = -2; xRegion <= 2; xRegion++) {\n for (let yRegion = -2; yRegion <= 2; yRegion++) {\n sum += blackPoints.get(left + xRegion, top + yRegion);\n }\n }\n const threshold = sum / 25;\n for (let xRegion = 0; xRegion < REGION_SIZE; xRegion++) {\n for (let yRegion = 0; yRegion < REGION_SIZE; yRegion++) {\n const x = hortizontalRegion * REGION_SIZE + xRegion;\n const y = verticalRegion * REGION_SIZE + yRegion;\n const lum = greyscalePixels.get(x, y);\n binarized.set(x, y, lum <= threshold);\n if (returnInverted) {\n inverted.set(x, y, !(lum <= threshold));\n }\n }\n }\n }\n }\n if (returnInverted) {\n return { binarized, inverted };\n }\n return { binarized };\n}\n", "// tslint:disable:no-bitwise\n\nexport class BitStream {\n private bytes: Uint8ClampedArray;\n private byteOffset: number = 0;\n private bitOffset: number = 0;\n\n constructor(bytes: Uint8ClampedArray) {\n this.bytes = bytes;\n }\n\n public readBits(numBits: number): number {\n if (numBits < 1 || numBits > 32 || numBits > this.available()) {\n throw new Error(\"Cannot read \" + numBits.toString() + \" bits\");\n }\n\n let result = 0;\n // First, read remainder from current byte\n if (this.bitOffset > 0) {\n const bitsLeft = 8 - this.bitOffset;\n const toRead = numBits < bitsLeft ? numBits : bitsLeft;\n const bitsToNotRead = bitsLeft - toRead;\n const mask = (0xFF >> (8 - toRead)) << bitsToNotRead;\n result = (this.bytes[this.byteOffset] & mask) >> bitsToNotRead;\n numBits -= toRead;\n this.bitOffset += toRead;\n if (this.bitOffset === 8) {\n this.bitOffset = 0;\n this.byteOffset++;\n }\n }\n\n // Next read whole bytes\n if (numBits > 0) {\n while (numBits >= 8) {\n result = (result << 8) | (this.bytes[this.byteOffset] & 0xFF);\n this.byteOffset++;\n numBits -= 8;\n }\n\n // Finally read a partial byte\n if (numBits > 0) {\n const bitsToNotRead = 8 - numBits;\n const mask = (0xFF >> bitsToNotRead) << bitsToNotRead;\n result = (result << numBits) | ((this.bytes[this.byteOffset] & mask) >> bitsToNotRead);\n this.bitOffset += numBits;\n }\n }\n return result;\n }\n\n public available(): number {\n return 8 * (this.bytes.length - this.byteOffset) - this.bitOffset;\n }\n}\n", "// tslint:disable:no-bitwise\nimport { BitStream } from \"./BitStream\";\n\nexport interface Chunk {\n type: Mode;\n text: string;\n}\n\nexport interface ByteChunk {\n type: Mode.Byte | Mode.Kanji;\n bytes: number[];\n}\n\nexport interface ECIChunk {\n type: Mode.ECI;\n assignmentNumber: number;\n}\n\nexport interface StructuredAppend {\n type: Mode.StructuredAppend;\n currentSequence: number;\n totalSequence: number;\n parity: number;\n}\n\nexport type Chunks = Array<Chunk | ByteChunk | ECIChunk | StructuredAppend>;\n\nexport interface DecodedQR {\n text: string;\n bytes: number[];\n chunks: Chunks;\n version: number;\n}\n\nexport enum Mode {\n Numeric = \"numeric\",\n Alphanumeric = \"alphanumeric\",\n Byte = \"byte\",\n Kanji = \"kanji\",\n ECI = \"eci\",\n StructuredAppend = \"structuredappend\",\n}\n\nenum ModeByte {\n Terminator = 0x0,\n Numeric = 0x1,\n Alphanumeric = 0x2,\n Byte = 0x4,\n Kanji = 0x8,\n ECI = 0x7,\n StructuredAppend = 0x3,\n // FNC1FirstPosition = 0x5,\n // FNC1SecondPosition = 0x9,\n}\n\nfunction decodeNumeric(stream: BitStream, size: number) {\n const bytes: number[] = [];\n let text = \"\";\n\n const characterCountSize = [10, 12, 14][size];\n let length = stream.readBits(characterCountSize);\n // Read digits in groups of 3\n while (length >= 3) {\n const num = stream.readBits(10);\n if (num >= 1000) {\n throw new Error(\"Invalid numeric value above 999\");\n }\n\n const a = Math.floor(num / 100);\n const b = Math.floor(num / 10) % 10;\n const c = num % 10;\n\n bytes.push(48 + a, 48 + b, 48 + c);\n text += a.toString() + b.toString() + c.toString();\n length -= 3;\n }\n\n // If the number of digits aren't a multiple of 3, the remaining digits are special cased.\n if (length === 2) {\n const num = stream.readBits(7);\n if (num >= 100) {\n throw new Error(\"Invalid numeric value above 99\");\n }\n\n const a = Math.floor(num / 10);\n const b = num % 10;\n\n bytes.push(48 + a, 48 + b);\n text += a.toString() + b.toString();\n } else if (length === 1) {\n const num = stream.readBits(4);\n if (num >= 10) {\n throw new Error(\"Invalid numeric value above 9\");\n }\n\n bytes.push(48 + num);\n text += num.toString();\n }\n\n return { bytes, text };\n}\n\nconst AlphanumericCharacterCodes = [\n \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\n \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\",\n \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\",\n \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\",\n \" \", \"$\", \"%\", \"*\", \"+\", \"-\", \".\", \"/\", \":\",\n];\n\nfunction decodeAlphanumeric(stream: BitStream, size: number) {\n const bytes: number[] = [];\n let text = \"\";\n\n const characterCountSize = [9, 11, 13][size];\n let length = stream.readBits(characterCountSize);\n while (length >= 2) {\n const v = stream.readBits(11);\n\n const a = Math.floor(v / 45);\n const b = v % 45;\n\n bytes.push(AlphanumericCharacterCodes[a].charCodeAt(0), AlphanumericCharacterCodes[b].charCodeAt(0));\n text += AlphanumericCharacterCodes[a] + AlphanumericCharacterCodes[b];\n length -= 2;\n }\n\n if (length === 1) {\n const a = stream.readBits(6);\n bytes.push(AlphanumericCharacterCodes[a].charCodeAt(0));\n text += AlphanumericCharacterCodes[a];\n }\n\n return { bytes, text };\n}\n\nfunction decodeByte(stream: BitStream, size: number) {\n const bytes: number[] = [];\n let text = \"\";\n\n const characterCountSize = [8, 16, 16][size];\n const length = stream.readBits(characterCountSize);\n for (let i = 0; i < length; i++) {\n const b = stream.readBits(8);\n bytes.push(b);\n }\n try {\n text += decodeURIComponent(bytes.map(b => `%${(\"0\" + b.toString(16)).substr(-2)}`).join(\"\"));\n } catch {\n // failed to decode\n }\n\n return { bytes, text };\n}\n\nfunction decodeKanji(stream: BitStream, size: number) {\n const bytes: number[] = [];\n\n const characterCountSize = [8, 10, 12][size];\n const length = stream.readBits(characterCountSize);\n for (let i = 0; i < length; i++) {\n const k = stream.readBits(13);\n\n let c = (Math.floor(k / 0xC0) << 8) | (k % 0xC0);\n if (c < 0x1F00) {\n c += 0x8140;\n } else {\n c += 0xC140;\n }\n\n bytes.push(c >> 8, c & 0xFF);\n }\n\n const text = new TextDecoder(\"shift-jis\").decode(Uint8Array.from(bytes));\n return { bytes, text };\n}\n\nexport function decode(data: Uint8ClampedArray, version: number): DecodedQR {\n const stream = new BitStream(data);\n\n // There are 3 'sizes' based on the version. 1-9 is small (0), 10-26 is medium (1) and 27-40 is large (2).\n const size = version <= 9 ? 0 : version <= 26 ? 1 : 2;\n\n const result: DecodedQR = {\n text: \"\",\n bytes: [],\n chunks: [],\n version,\n };\n\n while (stream.available() >= 4) {\n const mode = stream.readBits(4);\n if (mode === ModeByte.Terminator) {\n return result;\n } else if (mode === ModeByte.ECI) {\n if (stream.readBits(1) === 0) {\n result.chunks.push({\n type: Mode.ECI,\n assignmentNumber: stream.readBits(7),\n });\n } else if (stream.readBits(1) === 0) {\n result.chunks.push({\n type: Mode.ECI,\n assignmentNumber: stream.readBits(14),\n });\n } else if (stream.readBits(1) === 0) {\n result.chunks.push({\n type: Mode.ECI,\n assignmentNumber: stream.readBits(21),\n });\n } else {\n // ECI data seems corrupted\n result.chunks.push({\n type: Mode.ECI,\n assignmentNumber: -1,\n });\n }\n } else if (mode === ModeByte.Numeric) {\n const numericResult = decodeNumeric(stream, size);\n result.text += numericResult.text;\n result.bytes.push(...numericResult.bytes);\n result.chunks.push({\n type: Mode.Numeric,\n text: numericResult.text,\n });\n } else if (mode === ModeByte.Alphanumeric) {\n const alphanumericResult = decodeAlphanumeric(stream, size);\n result.text += alphanumericResult.text;\n result.bytes.push(...alphanumericResult.bytes);\n result.chunks.push({\n type: Mode.Alphanumeric,\n text: alphanumericResult.text,\n });\n } else if (mode === ModeByte.Byte) {\n const byteResult = decodeByte(stream, size);\n result.text += byteResult.text;\n result.bytes.push(...byteResult.bytes);\n result.chunks.push({\n type: Mode.Byte,\n bytes: byteResult.bytes,\n text: byteResult.text,\n });\n } else if (mode === ModeByte.Kanji) {\n const kanjiResult = decodeKanji(stream, size);\n result.text += kanjiResult.text;\n result.bytes.push(...kanjiResult.bytes);\n result.chunks.push({\n type: Mode.Kanji,\n bytes: kanjiResult.bytes,\n text: kanjiResult.text,\n });\n } else if (mode === ModeByte.StructuredAppend) {\n result.chunks.push({\n type: Mode.StructuredAppend,\n currentSequence: stream.readBits(4),\n totalSequence: stream.readBits(4),\n parity: stream.readBits(8),\n });\n }\n }\n\n // If there is no data left, or the remaining bits are all 0, then that counts as a termination marker\n if (stream.available() === 0 || stream.readBits(stream.available()) === 0) {\n return result;\n }\n}\n", "import GenericGF, { addOrSubtractGF } from \"./GenericGF\";\n\nexport default class GenericGFPoly {\n private field: GenericGF;\n private coefficients: Uint8ClampedArray;\n\n constructor(field: GenericGF, coefficients: Uint8ClampedArray) {\n if (coefficients.length === 0) {\n throw new Error(\"No coefficients.\");\n }\n this.field = field;\n const coefficientsLength = coefficients.length;\n if (coefficientsLength > 1 && coefficients[0] === 0) {\n // Leading term must be non-zero for anything except the constant polynomial \"0\"\n let firstNonZero = 1;\n while (firstNonZero < coefficientsLength && coefficients[firstNonZero] === 0) {\n firstNonZero++;\n }\n if (firstNonZero === coefficientsLength) {\n this.coefficients = field.zero.coefficients;\n } else {\n this.coefficients = new Uint8ClampedArray(coefficientsLength - firstNonZero);\n for (let i = 0; i < this.coefficients.length; i++) {\n this.coefficients[i] = coefficients[firstNonZero + i];\n }\n }\n } else {\n this.coefficients = coefficients;\n }\n }\n\n public degree() {\n return this.coefficients.length - 1;\n }\n\n public isZero() {\n return this.coefficients[0] === 0;\n }\n\n public getCoefficient(degree: number) {\n return this.coefficients[this.coefficients.length - 1 - degree];\n }\n\n public addOrSubtract(other: GenericGFPoly) {\n if (this.isZero()) {\n return other;\n }\n if (other.isZero()) {\n return this;\n }\n\n let smallerCoefficients = this.coefficients;\n let largerCoefficients = other.coefficients;\n if (smallerCoefficients.length > largerCoefficients.length) {\n [smallerCoefficients, largerCoefficients] = [largerCoefficients, smallerCoefficients];\n }\n const sumDiff = new Uint8ClampedArray(largerCoefficients.length);\n const lengthDiff = largerCoefficients.length - smallerCoefficients.length;\n for (let i = 0; i < lengthDiff; i++) {\n sumDiff[i] = largerCoefficients[i];\n }\n\n for (let i = lengthDiff; i < largerCoefficients.length; i++) {\n sumDiff[i] = addOrSubtractGF(smallerCoefficients[i - lengthDiff], largerCoefficients[i]);\n }\n\n return new GenericGFPoly(this.field, sumDiff);\n }\n\n public multiply(scalar: number) {\n if (scalar === 0) {\n return this.field.zero;\n }\n if (scalar === 1) {\n return this;\n }\n const size = this.coefficients.length;\n const product = new Uint8ClampedArray(size);\n for (let i = 0; i < size; i++) {\n product[i] = this.field.multiply(this.coefficients[i], scalar);\n }\n\n return new GenericGFPoly(this.field, product);\n }\n\n public multiplyPoly(other: GenericGFPoly): GenericGFPoly {\n if (this.isZero() || other.isZero()) {\n return this.field.zero;\n }\n const aCoefficients = this.coefficients;\n const aLength = aCoefficients.length;\n const bCoefficients = other.coefficients;\n const bLength = bCoefficients.length;\n const product = new Uint8ClampedArray(aLength + bLength - 1);\n for (let i = 0; i < aLength; i++) {\n const aCoeff = aCoefficients[i];\n for (let j = 0; j < bLength; j++) {\n product[i + j] = addOrSubtractGF(product[i + j],\n this.field.multiply(aCoeff, bCoefficients[j]));\n }\n }\n return new GenericGFPoly(this.field, product);\n }\n\n public multiplyByMonomial(degree: number, coefficient: number) {\n if (degree < 0) {\n throw new Error(\"Invalid degree less than 0\");\n }\n if (coefficient === 0) {\n return this.field.zero;\n }\n const size = this.coefficients.length;\n const product = new Uint8ClampedArray(size + degree);\n for (let i = 0; i < size; i++) {\n product[i] = this.field.multiply(this.coefficients[i], coefficient);\n }\n return new GenericGFPoly(this.field, product);\n }\n\n public evaluateAt(a: number) {\n let result = 0;\n if (a === 0) {\n // Just return the x^0 coefficient\n return this.getCoefficient(0);\n }\n const size = this.coefficients.length;\n if (a === 1) {\n // Just the sum of the coefficients\n this.coefficients.forEach((coefficient) => {\n result = addOrSubtractGF(result, coefficient);\n });\n return result;\n }\n result = this.coefficients[0];\n for (let i = 1; i < size; i++) {\n result = addOrSubtractGF(this.field.multiply(a, result), this.coefficients[i]);\n }\n return result;\n }\n}\n", "import GenericGFPoly from \"./GenericGFPoly\";\n\nexport function addOrSubtractGF(a: number, b: number) {\n return a ^ b; // tslint:disable-line:no-bitwise\n}\n\nexport default class GenericGF {\n public primitive: number;\n public size: number;\n public generatorBase: number;\n public zero: GenericGFPoly;\n public one: GenericGFPoly;\n\n private expTable: number[];\n private logTable: number[];\n\n constructor(primitive: number, size: number, genBase: number) {\n this.primitive = primitive;\n this.size = size;\n this.generatorBase = genBase;\n this.expTable = new Array(this.size);\n this.logTable = new Array(this.size);\n\n let x = 1;\n for (let i = 0; i < this.size; i++) {\n this.expTable[i] = x;\n x = x * 2;\n if (x >= this.size) {\n x = (x ^ this.primitive) & (this.size - 1); // tslint:disable-line:no-bitwise\n }\n }\n\n for (let i = 0; i < this.size - 1; i++) {\n this.logTable[this.expTable[i]] = i;\n }\n this.zero = new GenericGFPoly(this, Uint8ClampedArray.from([0]));\n this.one = new GenericGFPoly(this, Uint8ClampedArray.from([1]));\n }\n\n public multiply(a: number, b: number) {\n if (a === 0 || b === 0) {\n return 0;\n }\n return this.expTable[(this.logTable[a] + this.logTable[b]) % (this.size - 1)];\n }\n\n public inverse(a: number) {\n if (a === 0) {\n throw new Error(\"Can't invert 0\");\n }\n return this.expTable[this.size - this.logTable[a] - 1];\n }\n\n public buildMonomial(degree: number, coefficient: number): GenericGFPoly {\n if (degree < 0) {\n throw new Error(\"Invalid monomial degree less than 0\");\n }\n if (coefficient === 0) {\n return this.zero;\n }\n const coefficients = new Uint8ClampedArray(degree + 1);\n coefficients[0] = coefficient;\n return new GenericGFPoly(this, coefficients);\n }\n\n public log(a: number) {\n if (a === 0) {\n throw new Error(\"Can't take log(0)\");\n }\n return this.logTable[a];\n }\n\n public exp(a: number) {\n return this.expTable[a];\n }\n}\n", "import GenericGF, { addOrSubtractGF } from \"./GenericGF\";\nimport GenericGFPoly from \"./GenericGFPoly\";\n\nfunction runEuclideanAlgorithm(field: GenericGF, a: GenericGFPoly, b: GenericGFPoly, R: number): GenericGFPoly[] {\n // Assume a's degree is >= b's\n if (a.degree() < b.degree()) {\n [a, b] = [b, a];\n }\n\n let rLast = a;\n let r = b;\n let tLast = field.zero;\n let t = field.one;\n\n // Run Euclidean algorithm until r's degree is less than R/2\n while (r.degree() >= R / 2) {\n const rLastLast = rLast;\n const tLastLast = tLast;\n rLast = r;\n tLast = t;\n\n // Divide rLastLast by rLast, with quotient in q and remainder in r\n if (rLast.isZero()) {\n // Euclidean algorithm already terminated?\n return null;\n }\n r = rLastLast;\n let q = field.zero;\n const denominatorLeadingTerm = rLast.getCoefficient(rLast.degree());\n const dltInverse = field.inverse(denominatorLeadingTerm);\n while (r.degree() >= rLast.degree() && !r.isZero()) {\n const degreeDiff = r.degree() - rLast.degree();\n const scale = field.multiply(r.getCoefficient(r.degree()), dltInverse);\n q = q.addOrSubtract(field.buildMonomial(degreeDiff, scale));\n r = r.addOrSubtract(rLast.multiplyByMonomial(degreeDiff, scale));\n }\n\n t = q.multiplyPoly(tLast).addOrSubtract(tLastLast);\n\n if (r.degree() >= rLast.degree()) {\n return null;\n }\n }\n\n const sigmaTildeAtZero = t.getCoefficient(0);\n if (sigmaTildeAtZero === 0) {\n return null;\n }\n\n const inverse = field.inverse(sigmaTildeAtZero);\n return [t.multiply(inverse), r.multiply(inverse)];\n}\n\nfunction findErrorLocations(field: GenericGF, errorLocator: GenericGFPoly): number[] {\n // This is a direct application of Chien's search\n const numErrors = errorLocator.degree();\n if (numErrors === 1) {\n return [errorLocator.getCoefficient(1)];\n }\n const result: number[] = new Array(numErrors);\n let errorCount = 0;\n for (let i = 1; i < field.size && errorCount < numErrors; i++) {\n if (errorLocator.evaluateAt(i) === 0) {\n result[errorCount] = field.inverse(i);\n errorCount++;\n }\n }\n if (errorCount !== numErrors) {\n return null;\n }\n return result;\n}\n\nfunction findErrorMagnitudes(field: GenericGF, errorEvaluator: GenericGFPoly, errorLocations: number[]): number[] {\n // This is directly applying Forney's Formula\n const s = errorLocations.length;\n const result: number[] = new Array(s);\n for (let i = 0; i < s; i++) {\n const xiInverse = field.inverse(errorLocations[i]);\n let denominator = 1;\n for (let j = 0; j < s; j++) {\n if (i !== j) {\n denominator = field.multiply(denominator, addOrSubtractGF(1, field.multiply(errorLocations[j], xiInverse)));\n }\n }\n result[i] = field.multiply(errorEvaluator.evaluateAt(xiInverse), field.inverse(denominator));\n if (field.generatorBase !== 0) {\n result[i] = field.multiply(result[i], xiInverse);\n }\n }\n return result;\n}\n\nexport function decode(bytes: number[], twoS: number) {\n const outputBytes = new Uint8ClampedArray(bytes.length);\n outputBytes.set(bytes);\n\n const field = new GenericGF(0x011D, 256, 0); // x^8 + x^4 + x^3 + x^2 + 1\n const poly = new GenericGFPoly(field, outputBytes);\n\n const syndromeCoefficients = new Uint8ClampedArray(twoS);\n let error = false;\n for (let s = 0; s < twoS; s++) {\n const evaluation = poly.evaluateAt(field.exp(s + field.generatorBase));\n syndromeCoefficients[syndromeCoefficients.length - 1 - s] = evaluation;\n if (evaluation !== 0) {\n error = true;\n }\n }\n if (!error) {\n return outputBytes;\n }\n\n const syndrome = new GenericGFPoly(field, syndromeCoefficients);\n\n const sigmaOmega = runEuclideanAlgorithm(field, field.buildMonomial(twoS, 1), syndrome, twoS);\n if (sigmaOmega === null) {\n return null;\n }\n\n const errorLocations = findErrorLocations(field, sigmaOmega[0]);\n if (errorLocations == null) {\n return null;\n }\n\n const errorMagnitudes = findErrorMagnitudes(field, sigmaOmega[1], errorLocations);\n for (let i = 0; i < errorLocations.length; i++) {\n const position = outputBytes.length - 1 - field.log(errorLocations[i]);\n if (position < 0) {\n return null;\n }\n outputBytes[position] = addOrSubtractGF(outputBytes[position], errorMagnitudes[i]);\n }\n\n return outputBytes;\n}\n", "export interface Version {\n infoBits: number;\n versionNumber: number;\n alignmentPatternCenters: number[];\n errorCorrectionLevels: Array<{\n ecCodewordsPerBlock: number;\n ecBlocks: Array<{\n numBlocks: number;\n dataCodewordsPerBlock: number;\n }>\n }>;\n}\n\nexport const VERSIONS: Version[] = [\n {\n infoBits: null,\n versionNumber: 1,\n alignmentPatternCenters: [],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 7,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 19 }],\n },\n {\n ecCodewordsPerBlock: 10,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 16 }],\n },\n {\n ecCodewordsPerBlock: 13,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 13 }],\n },\n {\n ecCodewordsPerBlock: 17,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 9 }],\n },\n ],\n },\n {\n infoBits: null,\n versionNumber: 2,\n alignmentPatternCenters: [6, 18],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 10,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 34 }],\n },\n {\n ecCodewordsPerBlock: 16,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 28 }],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 22 }],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 16 }],\n },\n ],\n },\n {\n infoBits: null,\n versionNumber: 3,\n alignmentPatternCenters: [6, 22],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 15,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 55 }],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 44 }],\n },\n {\n ecCodewordsPerBlock: 18,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 17 }],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 13 }],\n },\n ],\n },\n {\n infoBits: null,\n versionNumber: 4,\n alignmentPatternCenters: [6, 26],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 20,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 80 }],\n },\n {\n ecCodewordsPerBlock: 18,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 32 }],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 24 }],\n },\n {\n ecCodewordsPerBlock: 16,\n ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 9 }],\n },\n ],\n },\n {\n infoBits: null,\n versionNumber: 5,\n alignmentPatternCenters: [6, 30],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [{ numBlocks: 1, dataCodewordsPerBlock: 108 }],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 43 }],\n },\n {\n ecCodewordsPerBlock: 18,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 15 },\n { numBlocks: 2, dataCodewordsPerBlock: 16 },\n ],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 11 },\n { numBlocks: 2, dataCodewordsPerBlock: 12 },\n ],\n },\n ],\n },\n {\n infoBits: null,\n versionNumber: 6,\n alignmentPatternCenters: [6, 34],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 18,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 68 }],\n },\n {\n ecCodewordsPerBlock: 16,\n ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 27 }],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 19 }],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 15 }],\n },\n ],\n },\n {\n infoBits: 0x07C94,\n versionNumber: 7,\n alignmentPatternCenters: [6, 22, 38],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 20,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 78 }],\n },\n {\n ecCodewordsPerBlock: 18,\n ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 31 }],\n },\n {\n ecCodewordsPerBlock: 18,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 14 },\n { numBlocks: 4, dataCodewordsPerBlock: 15 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 13 },\n { numBlocks: 1, dataCodewordsPerBlock: 14 },\n ],\n },\n ],\n },\n {\n infoBits: 0x085BC,\n versionNumber: 8,\n alignmentPatternCenters: [6, 24, 42],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 97 }],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 38 },\n { numBlocks: 2, dataCodewordsPerBlock: 39 },\n ],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 18 },\n { numBlocks: 2, dataCodewordsPerBlock: 19 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 14 },\n { numBlocks: 2, dataCodewordsPerBlock: 15 },\n ],\n },\n ],\n },\n {\n infoBits: 0x09A99,\n versionNumber: 9,\n alignmentPatternCenters: [6, 26, 46],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [{ numBlocks: 2, dataCodewordsPerBlock: 116 }],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 36 },\n { numBlocks: 2, dataCodewordsPerBlock: 37 },\n ],\n },\n {\n ecCodewordsPerBlock: 20,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 16 },\n { numBlocks: 4, dataCodewordsPerBlock: 17 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 12 },\n { numBlocks: 4, dataCodewordsPerBlock: 13 },\n ],\n },\n ],\n },\n {\n infoBits: 0x0A4D3,\n versionNumber: 10,\n alignmentPatternCenters: [6, 28, 50],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 18,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 68 },\n { numBlocks: 2, dataCodewordsPerBlock: 69 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 43 },\n { numBlocks: 1, dataCodewordsPerBlock: 44 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 6, dataCodewordsPerBlock: 19 },\n { numBlocks: 2, dataCodewordsPerBlock: 20 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 6, dataCodewordsPerBlock: 15 },\n { numBlocks: 2, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x0BBF6,\n versionNumber: 11,\n alignmentPatternCenters: [6, 30, 54],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 20,\n ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 81 }],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 1, dataCodewordsPerBlock: 50 },\n { numBlocks: 4, dataCodewordsPerBlock: 51 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 22 },\n { numBlocks: 4, dataCodewordsPerBlock: 23 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 12 },\n { numBlocks: 8, dataCodewordsPerBlock: 13 },\n ],\n },\n ],\n },\n {\n infoBits: 0x0C762,\n versionNumber: 12,\n alignmentPatternCenters: [6, 32, 58],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 92 },\n { numBlocks: 2, dataCodewordsPerBlock: 93 },\n ],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [\n { numBlocks: 6, dataCodewordsPerBlock: 36 },\n { numBlocks: 2, dataCodewordsPerBlock: 37 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 20 },\n { numBlocks: 6, dataCodewordsPerBlock: 21 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 7, dataCodewordsPerBlock: 14 },\n { numBlocks: 4, dataCodewordsPerBlock: 15 },\n ],\n },\n ],\n },\n {\n infoBits: 0x0D847,\n versionNumber: 13,\n alignmentPatternCenters: [6, 34, 62],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [{ numBlocks: 4, dataCodewordsPerBlock: 107 }],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [\n { numBlocks: 8, dataCodewordsPerBlock: 37 },\n { numBlocks: 1, dataCodewordsPerBlock: 38 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 8, dataCodewordsPerBlock: 20 },\n { numBlocks: 4, dataCodewordsPerBlock: 21 },\n ],\n },\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [\n { numBlocks: 12, dataCodewordsPerBlock: 11 },\n { numBlocks: 4, dataCodewordsPerBlock: 12 },\n ],\n },\n ],\n },\n {\n infoBits: 0x0E60D,\n versionNumber: 14,\n alignmentPatternCenters: [6, 26, 46, 66],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 115 },\n { numBlocks: 1, dataCodewordsPerBlock: 116 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 40 },\n { numBlocks: 5, dataCodewordsPerBlock: 41 },\n ],\n },\n {\n ecCodewordsPerBlock: 20,\n ecBlocks: [\n { numBlocks: 11, dataCodewordsPerBlock: 16 },\n { numBlocks: 5, dataCodewordsPerBlock: 17 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 11, dataCodewordsPerBlock: 12 },\n { numBlocks: 5, dataCodewordsPerBlock: 13 },\n ],\n },\n ],\n },\n {\n infoBits: 0x0F928,\n versionNumber: 15,\n alignmentPatternCenters: [6, 26, 48, 70],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 22,\n ecBlocks: [\n { numBlocks: 5, dataCodewordsPerBlock: 87 },\n { numBlocks: 1, dataCodewordsPerBlock: 88 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 5, dataCodewordsPerBlock: 41 },\n { numBlocks: 5, dataCodewordsPerBlock: 42 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 5, dataCodewordsPerBlock: 24 },\n { numBlocks: 7, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 11, dataCodewordsPerBlock: 12 },\n { numBlocks: 7, dataCodewordsPerBlock: 13 },\n ],\n },\n ],\n },\n {\n infoBits: 0x10B78,\n versionNumber: 16,\n alignmentPatternCenters: [6, 26, 50, 74],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 5, dataCodewordsPerBlock: 98 },\n { numBlocks: 1, dataCodewordsPerBlock: 99 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 7, dataCodewordsPerBlock: 45 },\n { numBlocks: 3, dataCodewordsPerBlock: 46 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [\n { numBlocks: 15, dataCodewordsPerBlock: 19 },\n { numBlocks: 2, dataCodewordsPerBlock: 20 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 15 },\n { numBlocks: 13, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x1145D,\n versionNumber: 17,\n alignmentPatternCenters: [6, 30, 54, 78],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 1, dataCodewordsPerBlock: 107 },\n { numBlocks: 5, dataCodewordsPerBlock: 108 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 10, dataCodewordsPerBlock: 46 },\n { numBlocks: 1, dataCodewordsPerBlock: 47 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 1, dataCodewordsPerBlock: 22 },\n { numBlocks: 15, dataCodewordsPerBlock: 23 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 14 },\n { numBlocks: 17, dataCodewordsPerBlock: 15 },\n ],\n },\n ],\n },\n {\n infoBits: 0x12A17,\n versionNumber: 18,\n alignmentPatternCenters: [6, 30, 56, 82],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 5, dataCodewordsPerBlock: 120 },\n { numBlocks: 1, dataCodewordsPerBlock: 121 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 9, dataCodewordsPerBlock: 43 },\n { numBlocks: 4, dataCodewordsPerBlock: 44 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 17, dataCodewordsPerBlock: 22 },\n { numBlocks: 1, dataCodewordsPerBlock: 23 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 14 },\n { numBlocks: 19, dataCodewordsPerBlock: 15 },\n ],\n },\n ],\n },\n {\n infoBits: 0x13532,\n versionNumber: 19,\n alignmentPatternCenters: [6, 30, 58, 86],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 113 },\n { numBlocks: 4, dataCodewordsPerBlock: 114 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 44 },\n { numBlocks: 11, dataCodewordsPerBlock: 45 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 17, dataCodewordsPerBlock: 21 },\n { numBlocks: 4, dataCodewordsPerBlock: 22 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 9, dataCodewordsPerBlock: 13 },\n { numBlocks: 16, dataCodewordsPerBlock: 14 },\n ],\n },\n ],\n },\n {\n infoBits: 0x149A6,\n versionNumber: 20,\n alignmentPatternCenters: [6, 34, 62, 90],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 107 },\n { numBlocks: 5, dataCodewordsPerBlock: 108 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 41 },\n { numBlocks: 13, dataCodewordsPerBlock: 42 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 15, dataCodewordsPerBlock: 24 },\n { numBlocks: 5, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 15, dataCodewordsPerBlock: 15 },\n { numBlocks: 10, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x15683,\n versionNumber: 21,\n alignmentPatternCenters: [6, 28, 50, 72, 94],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 116 },\n { numBlocks: 4, dataCodewordsPerBlock: 117 },\n ],\n },\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [{ numBlocks: 17, dataCodewordsPerBlock: 42 }],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 17, dataCodewordsPerBlock: 22 },\n { numBlocks: 6, dataCodewordsPerBlock: 23 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 19, dataCodewordsPerBlock: 16 },\n { numBlocks: 6, dataCodewordsPerBlock: 17 },\n ],\n },\n ],\n },\n {\n infoBits: 0x168C9,\n versionNumber: 22,\n alignmentPatternCenters: [6, 26, 50, 74, 98],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 111 },\n { numBlocks: 7, dataCodewordsPerBlock: 112 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [{ numBlocks: 17, dataCodewordsPerBlock: 46 }],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 7, dataCodewordsPerBlock: 24 },\n { numBlocks: 16, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 24,\n ecBlocks: [{ numBlocks: 34, dataCodewordsPerBlock: 13 }],\n },\n ],\n },\n {\n infoBits: 0x177EC,\n versionNumber: 23,\n alignmentPatternCenters: [6, 30, 54, 74, 102],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 121 },\n { numBlocks: 5, dataCodewordsPerBlock: 122 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 47 },\n { numBlocks: 14, dataCodewordsPerBlock: 48 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 11, dataCodewordsPerBlock: 24 },\n { numBlocks: 14, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 16, dataCodewordsPerBlock: 15 },\n { numBlocks: 14, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x18EC4,\n versionNumber: 24,\n alignmentPatternCenters: [6, 28, 54, 80, 106],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 6, dataCodewordsPerBlock: 117 },\n { numBlocks: 4, dataCodewordsPerBlock: 118 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 6, dataCodewordsPerBlock: 45 },\n { numBlocks: 14, dataCodewordsPerBlock: 46 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 11, dataCodewordsPerBlock: 24 },\n { numBlocks: 16, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 30, dataCodewordsPerBlock: 16 },\n { numBlocks: 2, dataCodewordsPerBlock: 17 },\n ],\n },\n ],\n },\n {\n infoBits: 0x191E1,\n versionNumber: 25,\n alignmentPatternCenters: [6, 32, 58, 84, 110],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 26,\n ecBlocks: [\n { numBlocks: 8, dataCodewordsPerBlock: 106 },\n { numBlocks: 4, dataCodewordsPerBlock: 107 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 8, dataCodewordsPerBlock: 47 },\n { numBlocks: 13, dataCodewordsPerBlock: 48 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 7, dataCodewordsPerBlock: 24 },\n { numBlocks: 22, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 22, dataCodewordsPerBlock: 15 },\n { numBlocks: 13, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x1AFAB,\n versionNumber: 26,\n alignmentPatternCenters: [6, 30, 58, 86, 114],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 10, dataCodewordsPerBlock: 114 },\n { numBlocks: 2, dataCodewordsPerBlock: 115 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 19, dataCodewordsPerBlock: 46 },\n { numBlocks: 4, dataCodewordsPerBlock: 47 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 28, dataCodewordsPerBlock: 22 },\n { numBlocks: 6, dataCodewordsPerBlock: 23 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 33, dataCodewordsPerBlock: 16 },\n { numBlocks: 4, dataCodewordsPerBlock: 17 },\n ],\n },\n ],\n },\n {\n infoBits: 0x1B08E,\n versionNumber: 27,\n alignmentPatternCenters: [6, 34, 62, 90, 118],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 8, dataCodewordsPerBlock: 122 },\n { numBlocks: 4, dataCodewordsPerBlock: 123 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 22, dataCodewordsPerBlock: 45 },\n { numBlocks: 3, dataCodewordsPerBlock: 46 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 8, dataCodewordsPerBlock: 23 },\n { numBlocks: 26, dataCodewordsPerBlock: 24 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 12, dataCodewordsPerBlock: 15 },\n { numBlocks: 28, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x1CC1A,\n versionNumber: 28,\n alignmentPatternCenters: [6, 26, 50, 74, 98, 122],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 117 },\n { numBlocks: 10, dataCodewordsPerBlock: 118 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 3, dataCodewordsPerBlock: 45 },\n { numBlocks: 23, dataCodewordsPerBlock: 46 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 24 },\n { numBlocks: 31, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 11, dataCodewordsPerBlock: 15 },\n { numBlocks: 31, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x1D33F,\n versionNumber: 29,\n alignmentPatternCenters: [6, 30, 54, 78, 102, 126],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 7, dataCodewordsPerBlock: 116 },\n { numBlocks: 7, dataCodewordsPerBlock: 117 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 21, dataCodewordsPerBlock: 45 },\n { numBlocks: 7, dataCodewordsPerBlock: 46 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 1, dataCodewordsPerBlock: 23 },\n { numBlocks: 37, dataCodewordsPerBlock: 24 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 19, dataCodewordsPerBlock: 15 },\n { numBlocks: 26, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x1ED75,\n versionNumber: 30,\n alignmentPatternCenters: [6, 26, 52, 78, 104, 130],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 5, dataCodewordsPerBlock: 115 },\n { numBlocks: 10, dataCodewordsPerBlock: 116 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 19, dataCodewordsPerBlock: 47 },\n { numBlocks: 10, dataCodewordsPerBlock: 48 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 15, dataCodewordsPerBlock: 24 },\n { numBlocks: 25, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 23, dataCodewordsPerBlock: 15 },\n { numBlocks: 25, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x1F250,\n versionNumber: 31,\n alignmentPatternCenters: [6, 30, 56, 82, 108, 134],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 13, dataCodewordsPerBlock: 115 },\n { numBlocks: 3, dataCodewordsPerBlock: 116 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 46 },\n { numBlocks: 29, dataCodewordsPerBlock: 47 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 42, dataCodewordsPerBlock: 24 },\n { numBlocks: 1, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 23, dataCodewordsPerBlock: 15 },\n { numBlocks: 28, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x209D5,\n versionNumber: 32,\n alignmentPatternCenters: [6, 34, 60, 86, 112, 138],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [{ numBlocks: 17, dataCodewordsPerBlock: 115 }],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 10, dataCodewordsPerBlock: 46 },\n { numBlocks: 23, dataCodewordsPerBlock: 47 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 10, dataCodewordsPerBlock: 24 },\n { numBlocks: 35, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 19, dataCodewordsPerBlock: 15 },\n { numBlocks: 35, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x216F0,\n versionNumber: 33,\n alignmentPatternCenters: [6, 30, 58, 86, 114, 142],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 17, dataCodewordsPerBlock: 115 },\n { numBlocks: 1, dataCodewordsPerBlock: 116 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 14, dataCodewordsPerBlock: 46 },\n { numBlocks: 21, dataCodewordsPerBlock: 47 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 29, dataCodewordsPerBlock: 24 },\n { numBlocks: 19, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 11, dataCodewordsPerBlock: 15 },\n { numBlocks: 46, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x228BA,\n versionNumber: 34,\n alignmentPatternCenters: [6, 34, 62, 90, 118, 146],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 13, dataCodewordsPerBlock: 115 },\n { numBlocks: 6, dataCodewordsPerBlock: 116 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 14, dataCodewordsPerBlock: 46 },\n { numBlocks: 23, dataCodewordsPerBlock: 47 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 44, dataCodewordsPerBlock: 24 },\n { numBlocks: 7, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 59, dataCodewordsPerBlock: 16 },\n { numBlocks: 1, dataCodewordsPerBlock: 17 },\n ],\n },\n ],\n },\n {\n infoBits: 0x2379F,\n versionNumber: 35,\n alignmentPatternCenters: [6, 30, 54, 78, 102, 126, 150],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 12, dataCodewordsPerBlock: 121 },\n { numBlocks: 7, dataCodewordsPerBlock: 122 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 12, dataCodewordsPerBlock: 47 },\n { numBlocks: 26, dataCodewordsPerBlock: 48 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 39, dataCodewordsPerBlock: 24 },\n { numBlocks: 14, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 22, dataCodewordsPerBlock: 15 },\n { numBlocks: 41, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x24B0B,\n versionNumber: 36,\n alignmentPatternCenters: [ 6, 24, 50, 76, 102, 128, 154 ],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 6, dataCodewordsPerBlock: 121 },\n { numBlocks: 14, dataCodewordsPerBlock: 122 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 6, dataCodewordsPerBlock: 47 },\n { numBlocks: 34, dataCodewordsPerBlock: 48 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 46, dataCodewordsPerBlock: 24 },\n { numBlocks: 10, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 2, dataCodewordsPerBlock: 15 },\n { numBlocks: 64, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x2542E,\n versionNumber: 37,\n alignmentPatternCenters: [ 6, 28, 54, 80, 106, 132, 158 ],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 17, dataCodewordsPerBlock: 122 },\n { numBlocks: 4, dataCodewordsPerBlock: 123 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 29, dataCodewordsPerBlock: 46 },\n { numBlocks: 14, dataCodewordsPerBlock: 47 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 49, dataCodewordsPerBlock: 24 },\n { numBlocks: 10, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 24, dataCodewordsPerBlock: 15 },\n { numBlocks: 46, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x26A64,\n versionNumber: 38,\n alignmentPatternCenters: [ 6, 32, 58, 84, 110, 136, 162 ],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 4, dataCodewordsPerBlock: 122 },\n { numBlocks: 18, dataCodewordsPerBlock: 123 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 13, dataCodewordsPerBlock: 46 },\n { numBlocks: 32, dataCodewordsPerBlock: 47 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 48, dataCodewordsPerBlock: 24 },\n { numBlocks: 14, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 42, dataCodewordsPerBlock: 15 },\n { numBlocks: 32, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x27541,\n versionNumber: 39,\n alignmentPatternCenters: [ 6, 26, 54, 82, 110, 138, 166 ],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 20, dataCodewordsPerBlock: 117 },\n { numBlocks: 4, dataCodewordsPerBlock: 118 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 40, dataCodewordsPerBlock: 47 },\n { numBlocks: 7, dataCodewordsPerBlock: 48 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 43, dataCodewordsPerBlock: 24 },\n { numBlocks: 22, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 10, dataCodewordsPerBlock: 15 },\n { numBlocks: 67, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n {\n infoBits: 0x28C69,\n versionNumber: 40,\n alignmentPatternCenters: [ 6, 30, 58, 86, 114, 142, 170 ],\n errorCorrectionLevels: [\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 19, dataCodewordsPerBlock: 118 },\n { numBlocks: 6, dataCodewordsPerBlock: 119 },\n ],\n },\n {\n ecCodewordsPerBlock: 28,\n ecBlocks: [\n { numBlocks: 18, dataCodewordsPerBlock: 47 },\n { numBlocks: 31, dataCodewordsPerBlock: 48 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 34, dataCodewordsPerBlock: 24 },\n { numBlocks: 34, dataCodewordsPerBlock: 25 },\n ],\n },\n {\n ecCodewordsPerBlock: 30,\n ecBlocks: [\n { numBlocks: 20, dataCodewordsPerBlock: 15 },\n { numBlocks: 61, dataCodewordsPerBlock: 16 },\n ],\n },\n ],\n },\n];\n", "import { BitMatrix } from \"../BitMatrix\";\nimport { Point } from \"../Point\";\nimport { decode as decodeData, DecodedQR } from \"./decodeData\";\nimport { decode as rsDecode } from \"./reedsolomon\";\nimport { Version, VERSIONS } from \"./version\";\n\n// tslint:disable:no-bitwise\nfunction numBitsDiffering(x: number, y: number) {\n let z = x ^ y;\n let bitCount = 0;\n while (z) {\n bitCount++;\n z &= z - 1;\n }\n return bitCount;\n}\n\nfunction pushBit(bit: any, byte: number) {\n return (byte << 1) | bit;\n}\n// tslint:enable:no-bitwise\n\nconst FORMAT_INFO_TABLE = [\n { bits: 0x5412, formatInfo: { errorCorrectionLevel: 1, dataMask: 0 } },\n { bits: 0x5125, formatInfo: { errorCorrectionLevel: 1, dataMask: 1 } },\n { bits: 0x5E7C, formatInfo: { errorCorrectionLevel: 1, dataMask: 2 } },\n { bits: 0x5B4B, formatInfo: { errorCorrectionLevel: 1, dataMask: 3 } },\n { bits: 0x45F9, formatInfo: { errorCorrectionLevel: 1, dataMask: 4 } },\n { bits: 0x40CE, formatInfo: { errorCorrectionLevel: 1, dataMask: 5 } },\n { bits: 0x4F97, formatInfo: { errorCorrectionLevel: 1, dataMask: 6 } },\n { bits: 0x4AA0, formatInfo: { errorCorrectionLevel: 1, dataMask: 7 } },\n { bits: 0x77C4, formatInfo: { errorCorrectionLevel: 0, dataMask: 0 } },\n { bits: 0x72F3, formatInfo: { errorCorrectionLevel: 0, dataMask: 1 } },\n { bits: 0x7DAA, formatInfo: { errorCorrectionLevel: 0, dataMask: 2 } },\n { bits: 0x789D, formatInfo: { errorCorrectionLevel: 0, dataMask: 3 } },\n { bits: 0x662F, formatInfo: { errorCorrectionLevel: 0, dataMask: 4 } },\n { bits: 0x6318, formatInfo: { errorCorrectionLevel: 0, dataMask: 5 } },\n { bits: 0x6C41, formatInfo: { errorCorrectionLevel: 0, dataMask: 6 } },\n { bits: 0x6976, formatInfo: { errorCorrectionLevel: 0, dataMask: 7 } },\n { bits: 0x1689, formatInfo: { errorCorrectionLevel: 3, dataMask: 0 } },\n { bits: 0x13BE, formatInfo: { errorCorrectionLevel: 3, dataMask: 1 } },\n { bits: 0x1CE7, formatInfo: { errorCorrectionLevel: 3, dataMask: 2 } },\n { bits: 0x19D0, formatInfo: { errorCorrectionLevel: 3, dataMask: 3 } },\n { bits: 0x0762, formatInfo: { errorCorrectionLevel: 3, dataMask: 4 } },\n { bits: 0x0255, formatInfo: { errorCorrectionLevel: 3, dataMask: 5 } },\n { bits: 0x0D0C, formatInfo: { errorCorrectionLevel: 3, dataMask: 6 } },\n { bits: 0x083B, formatInfo: { errorCorrectionLevel: 3, dataMask: 7 } },\n { bits: 0x355F, formatInfo: { errorCorrectionLevel: 2, dataMask: 0 } },\n { bits: 0x3068, formatInfo: { errorCorrectionLevel: 2, dataMask: 1 } },\n { bits: 0x3F31, formatInfo: { errorCorrectionLevel: 2, dataMask: 2 } },\n { bits: 0x3A06, formatInfo: { errorCorrectionLevel: 2, dataMask: 3 } },\n { bits: 0x24B4, formatInfo: { errorCorrectionLevel: 2, dataMask: 4 } },\n { bits: 0x2183, formatInfo: { errorCorrectionLevel: 2, dataMask: 5 } },\n { bits: 0x2EDA, formatInfo: { errorCorrectionLevel: 2, dataMask: 6 } },\n { bits: 0x2BED, formatInfo: { errorCorrectionLevel: 2, dataMask: 7 } },\n];\n\nconst DATA_MASKS = [\n (p: Point) => ((p.y + p.x) % 2) === 0,\n (p: Point) => (p.y % 2) === 0,\n (p: Point) => p.x % 3 === 0,\n (p: Point) => (p.y + p.x) % 3 === 0,\n (p: Point) => (Math.floor(p.y / 2) + Math.floor(p.x / 3)) % 2 === 0,\n (p: Point) => ((p.x * p.y) % 2) + ((p.x * p.y) % 3) === 0,\n (p: Point) => ((((p.y * p.x) % 2) + (p.y * p.x) % 3) % 2) === 0,\n (p: Point) => ((((p.y + p.x) % 2) + (p.y * p.x) % 3) % 2) === 0,\n];\n\ninterface FormatInformation {\n errorCorrectionLevel: number;\n dataMask: number;\n}\n\nfunction buildFunctionPatternMask(version: Version): BitMatrix {\n const dimension = 17 + 4 * version.versionNumber;\n const matrix = BitMatrix.createEmpty(dimension, dimension);\n\n matrix.setRegion(0, 0, 9, 9, true); // Top left finder pattern + separator + format\n matrix.setRegion(dimension - 8, 0, 8, 9, true); // Top right finder pattern + separator + format\n matrix.setRegion(0, dimension - 8, 9, 8, true); // Bottom left finder pattern + separator + format\n\n // Alignment patterns\n for (const x of version.alignmentPatternCenters) {\n for (const y of version.alignmentPatternCenters) {\n if (!(x === 6 && y === 6 || x === 6 && y === dimension - 7 || x === dimension - 7 && y === 6)) {\n matrix.setRegion(x - 2, y - 2, 5, 5, true);\n }\n }\n }\n\n matrix.setRegion(6, 9, 1, dimension - 17, true); // Vertical timing pattern\n matrix.setRegion(9, 6, dimension - 17, 1, true); // Horizontal timing pattern\n\n if (version.versionNumber > 6) {\n matrix.setRegion(dimension - 11, 0, 3, 6, true); // Version info, top right\n matrix.setRegion(0, dimension - 11, 6, 3, true); // Version info, bottom left\n }\n\n return matrix;\n}\n\nfunction readCodewords(matrix: BitMatrix, version: Version, formatInfo: FormatInformation) {\n const dataMask = DATA_MASKS[formatInfo.dataMask];\n const dimension = matrix.height;\n\n const functionPatternMask = buildFunctionPatternMask(version);\n\n const codewords: number[] = [];\n let currentByte = 0;\n let bitsRead = 0;\n\n // Read columns in pairs, from right to left\n let readingUp = true;\n for (let columnIndex = dimension - 1; columnIndex > 0; columnIndex -= 2) {\n if (columnIndex === 6) { // Skip whole column with vertical alignment pattern;\n columnIndex--;\n }\n for (let i = 0; i < dimension; i++) {\n const y = readingUp ? dimension - 1 - i : i;\n for (let columnOffset = 0; columnOffset < 2; columnOffset++) {\n const x = columnIndex - columnOffset;\n if (!functionPatternMask.get(x, y)) {\n bitsRead++;\n let bit = matrix.get(x, y);\n if (dataMask({y, x})) {\n bit = !bit;\n }\n currentByte = pushBit(bit, currentByte);\n if (bitsRead === 8) { // Whole bytes\n codewords.push(currentByte);\n bitsRead = 0;\n currentByte = 0;\n }\n }\n }\n }\n readingUp = !readingUp;\n }\n return codewords;\n}\n\nfunction readVersion(matrix: BitMatrix): Version {\n const dimension = matrix.height;\n\n const provisionalVersion = Math.floor((dimension - 17) / 4);\n if (provisionalVersion <= 6) { // 6 and under dont have version info in the QR code\n return VERSIONS[provisionalVersion - 1];\n }\n\n let topRightVersionBits = 0;\n for (let y = 5; y >= 0; y--) {\n for (let x = dimension - 9; x >= dimension - 11; x--) {\n topRightVersionBits = pushBit(matrix.get(x, y), topRightVersionBits);\n }\n }\n\n let bottomLeftVersionBits = 0;\n for (let x = 5; x >= 0; x--) {\n for (let y = dimension - 9; y >= dimension - 11; y--) {\n bottomLeftVersionBits = pushBit(matrix.get(x, y), bottomLeftVersionBits);\n }\n }\n\n let bestDifference = Infinity;\n let bestVersion: Version;\n for (const version of VERSIONS) {\n if (version.infoBits === topRightVersionBits || version.infoBits === bottomLeftVersionBits) {\n return version;\n }\n\n let difference = numBitsDiffering(topRightVersionBits, version.infoBits);\n if (difference < bestDifference) {\n bestVersion = version;\n bestDifference = difference;\n }\n\n difference = numBitsDiffering(bottomLeftVersionBits, version.infoBits);\n if (difference < bestDifference) {\n bestVersion = version;\n bestDifference = difference;\n }\n }\n // We can tolerate up to 3 bits of error since no two version info codewords will\n // differ in less than 8 bits.\n if (bestDifference <= 3) {\n return bestVersion;\n }\n}\n\nfunction readFormatInformation(matrix: BitMatrix) {\n let topLeftFormatInfoBits = 0;\n for (let x = 0; x <= 8; x++) {\n if (x !== 6) { // Skip timing pattern bit\n topLeftFormatInfoBits = pushBit(matrix.get(x, 8), topLeftFormatInfoBits);\n }\n }\n for (let y = 7; y >= 0; y--) {\n if (y !== 6) { // Skip timing pattern bit\n topLeftFormatInfoBits = pushBit(matrix.get(8, y), topLeftFormatInfoBits);\n }\n }\n\n const dimension = matrix.height;\n let topRightBottomRightFormatInfoBits = 0;\n for (let y = dimension - 1; y >= dimension - 7; y--) { // bottom left\n topRightBottomRightFormatInfoBits = pushBit(matrix.get(8, y), topRightBottomRightFormatInfoBits);\n }\n for (let x = dimension - 8; x < dimension; x++) { // top right\n topRightBottomRightFormatInfoBits = pushBit(matrix.get(x, 8), topRightBottomRightFormatInfoBits);\n }\n\n let bestDifference = Infinity;\n let bestFormatInfo = null;\n for (const {bits, formatInfo} of FORMAT_INFO_TABLE) {\n if (bits === topLeftFormatInfoBits || bits === topRightBottomRightFormatInfoBits) {\n return formatInfo;\n }\n let difference = numBitsDiffering(topLeftFormatInfoBits, bits);\n if (difference < bestDifference) {\n bestFormatInfo = formatInfo;\n bestDifference = difference;\n }\n if (topLeftFormatInfoBits !== topRightBottomRightFormatInfoBits) { // also try the other option\n difference = numBitsDiffering(topRightBottomRightFormatInfoBits, bits);\n if (difference < bestDifference) {\n bestFormatInfo = formatInfo;\n bestDifference = difference;\n }\n }\n }\n // Hamming distance of the 32 masked codes is 7, by construction, so <= 3 bits differing means we found a match\n if (bestDifference <= 3) {\n return bestFormatInfo;\n }\n return null;\n}\n\nfunction getDataBlocks(codewords: number[], version: Version, ecLevel: number) {\n const ecInfo = version.errorCorrectionLevels[ecLevel];\n const dataBlocks: Array<{\n numDataCodewords: number;\n codewords: number[];\n }> = [];\n\n let totalCodewords = 0;\n ecInfo.ecBlocks.forEach(block => {\n for (let i = 0; i < block.numBlocks; i++) {\n dataBlocks.push({ numDataCodewords: block.dataCodewordsPerBlock, codewords: [] });\n totalCodewords += block.dataCodewordsPerBlock + ecInfo.ecCodewordsPerBlock;\n }\n });\n\n // In some cases the QR code will be malformed enough that we pull off more or less than we should.\n // If we pull off less there's nothing we can do.\n // If we pull off more we can safely truncate\n if (codewords.length < totalCodewords) {\n return null;\n }\n codewords = codewords.slice(0, totalCodewords);\n\n const shortBlockSize = ecInfo.ecBlocks[0].dataCodewordsPerBlock;\n // Pull codewords to fill the blocks up to the minimum size\n for (let i = 0; i < shortBlockSize; i++) {\n for (const dataBlock of dataBlocks) {\n dataBlock.codewords.push(codewords.shift());\n }\n }\n\n // If there are any large blocks, pull codewords to fill the last element of those\n if (ecInfo.ecBlocks.length > 1) {\n const smallBlockCount = ecInfo.ecBlocks[0].numBlocks;\n const largeBlockCount = ecInfo.ecBlocks[1].numBlocks;\n for (let i = 0; i < largeBlockCount; i++) {\n dataBlocks[smallBlockCount + i].codewords.push(codewords.shift());\n }\n }\n\n // Add the rest of the codewords to the blocks. These are the error correction codewords.\n while (codewords.length > 0) {\n for (const dataBlock of dataBlocks) {\n dataBlock.codewords.push(codewords.shift());\n }\n }\n\n return dataBlocks;\n}\n\nfunction decodeMatrix(matrix: BitMatrix) {\n const version = readVersion(matrix);\n if (!version) {\n return null;\n }\n\n const formatInfo = readFormatInformation(matrix);\n if (!formatInfo) {\n return null;\n }\n\n const codewords = readCodewords(matrix, version, formatInfo);\n const dataBlocks = getDataBlocks(codewords, version, formatInfo.errorCorrectionLevel);\n if (!dataBlocks) {\n return null;\n }\n\n // Count total number of data bytes\n const totalBytes = dataBlocks.reduce((a, b) => a + b.numDataCodewords, 0);\n const resultBytes = new Uint8ClampedArray(totalBytes);\n\n let resultIndex = 0;\n for (const dataBlock of dataBlocks) {\n const correctedBytes = rsDecode(dataBlock.codewords, dataBlock.codewords.length - dataBlock.numDataCodewords);\n if (!correctedBytes) {\n return null;\n }\n for (let i = 0; i < dataBlock.numDataCodewords; i++) {\n resultBytes[resultIndex++] = correctedBytes[i];\n }\n }\n\n try {\n return decodeData(resultBytes, version.versionNumber);\n } catch {\n return null;\n }\n}\n\nexport function decode(matrix: BitMatrix): DecodedQR {\n if (matrix == null) {\n return null;\n }\n const result = decodeMatrix(matrix);\n if (result) {\n return result;\n }\n // Decoding didn't work, try mirroring the QR across the topLeft -> bottomRight line.\n for (let x = 0; x < matrix.width; x++) {\n for (let y = x + 1; y < matrix.height; y++) {\n if (matrix.get(x, y) !== matrix.get(y, x)) {\n matrix.set(x, y, !matrix.get(x, y));\n matrix.set(y, x, !matrix.get(y, x));\n }\n }\n }\n return decodeMatrix(matrix);\n}\n", "import {BitMatrix} from \"../BitMatrix\";\nimport {Point, QRLocation} from \"../locator\";\n\ninterface PerspectiveTransform {\n a11: number;\n a21: number;\n a31: number;\n a12: number;\n a22: number;\n a32: number;\n a13: number;\n a23: number;\n a33: number;\n}\n\nfunction squareToQuadrilateral(p1: Point, p2: Point, p3: Point, p4: Point): PerspectiveTransform {\n const dx3 = p1.x - p2.x + p3.x - p4.x;\n const dy3 = p1.y - p2.y + p3.y - p4.y;\n if (dx3 === 0 && dy3 === 0) { // Affine\n return {\n a11: p2.x - p1.x,\n a12: p2.y - p1.y,\n a13: 0,\n a21: p3.x - p2.x,\n a22: p3.y - p2.y,\n a23: 0,\n a31: p1.x,\n a32: p1.y,\n a33: 1,\n };\n } else {\n const dx1 = p2.x - p3.x;\n const dx2 = p4.x - p3.x;\n const dy1 = p2.y - p3.y;\n const dy2 = p4.y - p3.y;\n const denominator = dx1 * dy2 - dx2 * dy1;\n const a13 = (dx3 * dy2 - dx2 * dy3) / denominator;\n const a23 = (dx1 * dy3 - dx3 * dy1) / denominator;\n return {\n a11: p2.x - p1.x + a13 * p2.x,\n a12: p2.y - p1.y + a13 * p2.y,\n a13,\n a21: p4.x - p1.x + a23 * p4.x,\n a22: p4.y - p1.y + a23 * p4.y,\n a23,\n a31: p1.x,\n a32: p1.y,\n a33: 1,\n };\n }\n}\n\nfunction quadrilateralToSquare(p1: Point, p2: Point, p3: Point, p4: Point): PerspectiveTransform {\n // Here, the adjoint serves as the inverse:\n const sToQ = squareToQuadrilateral(p1, p2, p3, p4);\n return {\n a11: sToQ.a22 * sToQ.a33 - sToQ.a23 * sToQ.a32,\n a12: sToQ.a13 * sToQ.a32 - sToQ.a12 * sToQ.a33,\n a13: sToQ.a12 * sToQ.a23 - sToQ.a13 * sToQ.a22,\n a21: sToQ.a23 * sToQ.a31 - sToQ.a21 * sToQ.a33,\n a22: sToQ.a11 * sToQ.a33 - sToQ.a13 * sToQ.a31,\n a23: sToQ.a13 * sToQ.a21 - sToQ.a11 * sToQ.a23,\n a31: sToQ.a21 * sToQ.a32 - sToQ.a22 * sToQ.a31,\n a32: sToQ.a12 * sToQ.a31 - sToQ.a11 * sToQ.a32,\n a33: sToQ.a11 * sToQ.a22 - sToQ.a12 * sToQ.a21,\n };\n}\n\nfunction times(a: PerspectiveTransform, b: PerspectiveTransform): PerspectiveTransform {\n return {\n a11: a.a11 * b.a11 + a.a21 * b.a12 + a.a31 * b.a13,\n a12: a.a12 * b.a11 + a.a22 * b.a12 + a.a32 * b.a13,\n a13: a.a13 * b.a11 + a.a23 * b.a12 + a.a33 * b.a13,\n a21: a.a11 * b.a21 + a.a21 * b.a22 + a.a31 * b.a23,\n a22: a.a12 * b.a21 + a.a22 * b.a22 + a.a32 * b.a23,\n a23: a.a13 * b.a21 + a.a23 * b.a22 + a.a33 * b.a23,\n a31: a.a11 * b.a31 + a.a21 * b.a32 + a.a31 * b.a33,\n a32: a.a12 * b.a31 + a.a22 * b.a32 + a.a32 * b.a33,\n a33: a.a13 * b.a31 + a.a23 * b.a32 + a.a33 * b.a33,\n };\n}\n\nexport function extract(image: BitMatrix, location: QRLocation) {\n const qToS = quadrilateralToSquare(\n {x: 3.5, y: 3.5},\n {x: location.dimension - 3.5, y: 3.5},\n {x: location.dimension - 6.5, y: location.dimension - 6.5},\n {x: 3.5, y: location.dimension - 3.5},\n );\n const sToQ = squareToQuadrilateral(location.topLeft, location.topRight, location.alignmentPattern, location.bottomLeft);\n const transform = times(sToQ, qToS);\n\n const matrix = BitMatrix.createEmpty(location.dimension, location.dimension);\n const mappingFunction = (x: number, y: number) => {\n const denominator = transform.a13 * x + transform.a23 * y + transform.a33;\n return {\n x: (transform.a11 * x + transform.a21 * y + transform.a31) / denominator,\n y: (transform.a12 * x + transform.a22 * y + transform.a32) / denominator,\n };\n };\n\n for (let y = 0; y < location.dimension; y++) {\n for (let x = 0; x < location.dimension; x++) {\n const xValue = x + 0.5;\n const yValue = y + 0.5;\n const sourcePixel = mappingFunction(xValue, yValue);\n matrix.set(x, y, image.get(Math.floor(sourcePixel.x), Math.floor(sourcePixel.y)));\n }\n }\n\n return {\n matrix,\n mappingFunction,\n };\n}\n", "import { BitMatrix } from \"../BitMatrix\";\n\nconst MAX_FINDERPATTERNS_TO_SEARCH = 5;\nconst MIN_QUAD_RATIO = 0.5;\nconst MAX_QUAD_RATIO = 1.5;\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface QRLocation {\n topRight: Point;\n bottomLeft: Point;\n topLeft: Point;\n alignmentPattern: Point;\n dimension: number;\n}\n\nconst distance = (a: Point, b: Point) => Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2);\n\nfunction sum(values: number[]) {\n return values.reduce((a, b) => a + b);\n}\n\n// Takes three finder patterns and organizes them into topLeft, topRight, etc\nfunction reorderFinderPatterns(pattern1: Point, pattern2: Point, pattern3: Point) {\n // Find distances between pattern centers\n const oneTwoDistance = distance(pattern1, pattern2);\n const twoThreeDistance = distance(pattern2, pattern3);\n const oneThreeDistance = distance(pattern1, pattern3);\n\n let bottomLeft: Point;\n let topLeft: Point;\n let topRight: Point;\n\n // Assume one closest to other two is B; A and C will just be guesses at first\n if (twoThreeDistance >= oneTwoDistance && twoThreeDistance >= oneThreeDistance) {\n [bottomLeft, topLeft, topRight] = [pattern2, pattern1, pattern3];\n } else if (oneThreeDistance >= twoThreeDistance && oneThreeDistance >= oneTwoDistance) {\n [bottomLeft, topLeft, topRight] = [pattern1, pattern2, pattern3];\n } else {\n [bottomLeft, topLeft, topRight] = [pattern1, pattern3, pattern2];\n }\n\n // Use cross product to figure out whether bottomLeft (A) and topRight (C) are correct or flipped in relation to topLeft (B)\n // This asks whether BC x BA has a positive z component, which is the arrangement we want. If it's negative, then\n // we've got it flipped around and should swap topRight and bottomLeft.\n if (((topRight.x - topLeft.x) * (bottomLeft.y - topLeft.y)) - ((topRight.y - topLeft.y) * (bottomLeft.x - topLeft.x)) < 0) {\n [bottomLeft, topRight] = [topRight, bottomLeft];\n }\n\n return { bottomLeft, topLeft, topRight };\n}\n\n// Computes the dimension (number of modules on a side) of the QR Code based on the position of the finder patterns\nfunction computeDimension(topLeft: Point, topRight: Point, bottomLeft: Point, matrix: BitMatrix) {\n const moduleSize = (\n sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1\n sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(bottomLeft, topLeft, matrix, 5)) / 7 +\n sum(countBlackWhiteRun(topRight, topLeft, matrix, 5)) / 7\n ) / 4;\n\n if (moduleSize < 1) {\n throw new Error(\"Invalid module size\");\n }\n\n const topDimension = Math.round(distance(topLeft, topRight) / moduleSize);\n const sideDimension = Math.round(distance(topLeft, bottomLeft) / moduleSize);\n let dimension = Math.floor((topDimension + sideDimension) / 2) + 7;\n switch (dimension % 4) {\n case 0:\n dimension++;\n break;\n case 2:\n dimension--;\n break;\n }\n return { dimension, moduleSize };\n}\n\n// Takes an origin point and an end point and counts the sizes of the black white run from the origin towards the end point.\n// Returns an array of elements, representing the pixel size of the black white run.\n// Uses a variant of http://en.wikipedia.org/wiki/Bresenham's_line_algorithm\nfunction countBlackWhiteRunTowardsPoint(origin: Point, end: Point, matrix: BitMatrix, length: number) {\n const switchPoints: Point[] = [{x: Math.floor(origin.x), y: Math.floor(origin.y)}];\n const steep = Math.abs(end.y - origin.y) > Math.abs(end.x - origin.x);\n\n let fromX: number;\n let fromY: number;\n let toX: number;\n let toY: number;\n if (steep) {\n fromX = Math.floor(origin.y);\n fromY = Math.floor(origin.x);\n toX = Math.floor(end.y);\n toY = Math.floor(end.x);\n } else {\n fromX = Math.floor(origin.x);\n fromY = Math.floor(origin.y);\n toX = Math.floor(end.x);\n toY = Math.floor(end.y);\n }\n\n const dx = Math.abs(toX - fromX);\n const dy = Math.abs(toY - fromY);\n let error = Math.floor(-dx / 2);\n const xStep = fromX < toX ? 1 : -1;\n const yStep = fromY < toY ? 1 : -1;\n\n let currentPixel = true;\n // Loop up until x == toX, but not beyond\n for (let x = fromX, y = fromY; x !== toX + xStep; x += xStep) {\n // Does current pixel mean we have moved white to black or vice versa?\n // Scanning black in state 0,2 and white in state 1, so if we find the wrong\n // color, advance to next state or end if we are in state 2 already\n const realX = steep ? y : x;\n const realY = steep ? x : y;\n if (matrix.get(realX, realY) !== currentPixel) {\n currentPixel = !currentPixel;\n switchPoints.push({x: realX, y: realY});\n if (switchPoints.length === length + 1) {\n break;\n }\n }\n error += dy;\n if (error > 0) {\n if (y === toY) {\n break;\n }\n y += yStep;\n error -= dx;\n }\n }\n const distances: number[] = [];\n for (let i = 0; i < length; i++) {\n if (switchPoints[i] && switchPoints[i + 1]) {\n distances.push(distance(switchPoints[i], switchPoints[i + 1]));\n } else {\n distances.push(0);\n }\n }\n return distances;\n}\n\n// Takes an origin point and an end point and counts the sizes of the black white run in the origin point\n// along the line that intersects with the end point. Returns an array of elements, representing the pixel sizes\n// of the black white run. Takes a length which represents the number of switches from black to white to look for.\nfunction countBlackWhiteRun(origin: Point, end: Point, matrix: BitMatrix, length: number) {\n const rise = end.y - origin.y;\n const run = end.x - origin.x;\n\n const towardsEnd = countBlackWhiteRunTowardsPoint(origin, end, matrix, Math.ceil(length / 2));\n const awayFromEnd = countBlackWhiteRunTowardsPoint(origin, {x: origin.x - run, y: origin.y - rise}, matrix, Math.ceil(length / 2));\n\n const middleValue = towardsEnd.shift() + awayFromEnd.shift() - 1; // Substract one so we don't double count a pixel\n return awayFromEnd.concat(middleValue).concat(...towardsEnd);\n}\n\n// Takes in a black white run and an array of expected ratios. Returns the average size of the run as well as the \"error\" -\n// that is the amount the run diverges from the expected ratio\nfunction scoreBlackWhiteRun(sequence: number[], ratios: number[]) {\n const averageSize = sum(sequence) / sum(ratios);\n let error = 0;\n ratios.forEach((ratio, i) => {\n error += (sequence[i] - ratio * averageSize) ** 2;\n });\n\n return { averageSize, error };\n}\n\n// Takes an X,Y point and an array of sizes and scores the point against those ratios.\n// For example for a finder pattern takes the ratio list of 1:1:3:1:1 and checks horizontal, vertical and diagonal ratios\n// against that.\nfunction scorePattern(point: Point, ratios: number[], matrix: BitMatrix) {\n try {\n const horizontalRun = countBlackWhiteRun(point, {x: -1, y: point.y}, matrix, ratios.length);\n const verticalRun = countBlackWhiteRun(point, {x: point.x, y: -1}, matrix, ratios.length);\n\n const topLeftPoint = {\n x: Math.max(0, point.x - point.y) - 1,\n y: Math.max(0, point.y - point.x) - 1,\n };\n const topLeftBottomRightRun = countBlackWhiteRun(point, topLeftPoint, matrix, ratios.length);\n\n const bottomLeftPoint = {\n x: Math.min(matrix.width, point.x + point.y) + 1,\n y: Math.min(matrix.height, point.y + point.x) + 1,\n };\n const bottomLeftTopRightRun = countBlackWhiteRun(point, bottomLeftPoint, matrix, ratios.length);\n\n const horzError = scoreBlackWhiteRun(horizontalRun, ratios);\n const vertError = scoreBlackWhiteRun(verticalRun, ratios);\n const diagDownError = scoreBlackWhiteRun(topLeftBottomRightRun, ratios);\n const diagUpError = scoreBlackWhiteRun(bottomLeftTopRightRun, ratios);\n\n const ratioError = Math.sqrt(horzError.error * horzError.error +\n vertError.error * vertError.error +\n diagDownError.error * diagDownError.error +\n diagUpError.error * diagUpError.error);\n\n const avgSize = (horzError.averageSize + vertError.averageSize + diagDownError.averageSize + diagUpError.averageSize) / 4;\n\n const sizeError = ((horzError.averageSize - avgSize) ** 2 +\n (vertError.averageSize - avgSize) ** 2 +\n (diagDownError.averageSize - avgSize) ** 2 +\n (diagUpError.averageSize - avgSize) ** 2) / avgSize;\n return ratioError + sizeError;\n } catch {\n return Infinity;\n }\n}\n\nfunction recenterLocation(matrix: BitMatrix, p: Point): Point {\n let leftX = Math.round(p.x);\n while (matrix.get(leftX, Math.round(p.y))) {\n leftX--;\n }\n let rightX = Math.round(p.x);\n while (matrix.get(rightX, Math.round(p.y))) {\n rightX++;\n }\n const x = (leftX + rightX) / 2;\n\n let topY = Math.round(p.y);\n while (matrix.get(Math.round(x), topY)) {\n topY--;\n }\n let bottomY = Math.round(p.y);\n while (matrix.get(Math.round(x), bottomY)) {\n bottomY++;\n }\n const y = (topY + bottomY) / 2;\n\n return { x, y };\n}\n\ninterface Quad {\n top: {\n startX: number;\n endX: number;\n y: number;\n };\n bottom: {\n startX: number;\n endX: number;\n y: number;\n };\n}\n\nexport function locate(matrix: BitMatrix): QRLocation[] {\n const finderPatternQuads: Quad[] = [];\n let activeFinderPatternQuads: Quad[] = [];\n const alignmentPatternQuads: Quad[] = [];\n let activeAlignmentPatternQuads: Quad[] = [];\n\n for (let y = 0; y <= matrix.height; y++) {\n let length = 0;\n let lastBit = false;\n let scans = [0, 0, 0, 0, 0];\n\n for (let x = -1; x <= matrix.width; x++) {\n const v = matrix.get(x, y);\n if (v === lastBit) {\n length++;\n } else {\n scans = [scans[1], scans[2], scans[3], scans[4], length];\n length = 1;\n lastBit = v;\n\n // Do the last 5 color changes ~ match the expected ratio for a finder pattern? 1:1:3:1:1 of b:w:b:w:b\n const averageFinderPatternBlocksize = sum(scans) / 7;\n const validFinderPattern =\n Math.abs(scans[0] - averageFinderPatternBlocksize) < averageFinderPatternBlocksize &&\n Math.abs(scans[1] - averageFinderPatternBlocksize) < averageFinderPatternBlocksize &&\n Math.abs(scans[2] - 3 * averageFinderPatternBlocksize) < 3 * averageFinderPatternBlocksize &&\n Math.abs(scans[3] - averageFinderPatternBlocksize) < averageFinderPatternBlocksize &&\n Math.abs(scans[4] - averageFinderPatternBlocksize) < averageFinderPatternBlocksize &&\n !v; // And make sure the current pixel is white since finder patterns are bordered in white\n\n // Do the last 3 color changes ~ match the expected ratio for an alignment pattern? 1:1:1 of w:b:w\n const averageAlignmentPatternBlocksize = sum(scans.slice(-3)) / 3;\n const validAlignmentPattern =\n Math.abs(scans[2] - averageAlignmentPatternBlocksize) < averageAlignmentPatternBlocksize &&\n Math.abs(scans[3] - averageAlignmentPatternBlocksize) < averageAlignmentPatternBlocksize &&\n Math.abs(scans[4] - averageAlignmentPatternBlocksize) < averageAlignmentPatternBlocksize &&\n v; // Is the current pixel black since alignment patterns are bordered in black\n\n if (validFinderPattern) {\n // Compute the start and end x values of the large center black square\n const endX = x - scans[3] - scans[4];\n const startX = endX - scans[2];\n\n const line = { startX, endX, y };\n // Is there a quad directly above the current spot? If so, extend it with the new line. Otherwise, create a new quad with\n // that line as the starting point.\n const matchingQuads = activeFinderPatternQuads.filter(q =>\n (startX >= q.bottom.startX && startX <= q.bottom.endX) ||\n (endX >= q.bottom.startX && startX <= q.bottom.endX) ||\n (startX <= q.bottom.startX && endX >= q.bottom.endX && (\n (scans[2] / (q.bottom.endX - q.bottom.startX)) < MAX_QUAD_RATIO &&\n (scans[2] / (q.bottom.endX - q.bottom.startX)) > MIN_QUAD_RATIO\n )),\n );\n if (matchingQuads.length > 0) {\n matchingQuads[0].bottom = line;\n } else {\n activeFinderPatternQuads.push({ top: line, bottom: line });\n }\n }\n if (validAlignmentPattern) {\n // Compute the start and end x values of the center black square\n const endX = x - scans[4];\n const startX = endX - scans[3];\n\n const line = { startX, y, endX };\n // Is there a quad directly above the current spot? If so, extend it with the new line. Otherwise, create a new quad with\n // that line as the starting point.\n const matchingQuads = activeAlignmentPatternQuads.filter(q =>\n (startX >= q.bottom.startX && startX <= q.bottom.endX) ||\n (endX >= q.bottom.startX && startX <= q.bottom.endX) ||\n (startX <= q.bottom.startX && endX >= q.bottom.endX && (\n (scans[2] / (q.bottom.endX - q.bottom.startX)) < MAX_QUAD_RATIO &&\n (scans[2] / (q.bottom.endX - q.bottom.startX)) > MIN_QUAD_RATIO\n )),\n );\n if (matchingQuads.length > 0) {\n matchingQuads[0].bottom = line;\n } else {\n activeAlignmentPatternQuads.push({ top: line, bottom: line });\n }\n }\n }\n }\n finderPatternQuads.push(...activeFinderPatternQuads.filter(q => q.bottom.y !== y && q.bottom.y - q.top.y >= 2));\n activeFinderPatternQuads = activeFinderPatternQuads.filter(q => q.bottom.y === y);\n\n alignmentPatternQuads.push(...activeAlignmentPatternQuads.filter(q => q.bottom.y !== y));\n activeAlignmentPatternQuads = activeAlignmentPatternQuads.filter(q => q.bottom.y === y);\n\n }\n\n finderPatternQuads.push(...activeFinderPatternQuads.filter(q => q.bottom.y - q.top.y >= 2));\n alignmentPatternQuads.push(...activeAlignmentPatternQuads);\n\n // Refactored from cozmo/jsQR to (hopefully) circumvent an issue in Safari 13+ on both Mac and iOS (also including\n // iOS Chrome and other Safari iOS derivatives). Safari was very occasionally and apparently not deterministically\n // throwing a \"RangeError: Array size is not a small enough positive integer.\" exception seemingly within the second\n // .map of the original code (here the second for-loop). This second .map contained a nested .map call over the same\n // array instance which was the chained result from previous calls to .map, .filter and .sort which potentially caused\n // this bug in Safari?\n // Also see https://github.com/cozmo/jsQR/issues/157 and https://bugs.webkit.org/show_bug.cgi?id=211619#c3\n const scoredFinderPatternPositions: Array<Point & { size: number, score: number }> = [];\n for (const quad of finderPatternQuads) {\n if (quad.bottom.y - quad.top.y < 2) {\n // All quads must be at least 2px tall since the center square is larger than a block\n continue;\n }\n\n // calculate quad center\n const x = (quad.top.startX + quad.top.endX + quad.bottom.startX + quad.bottom.endX) / 4;\n const y = (quad.top.y + quad.bottom.y + 1) / 2;\n if (!matrix.get(Math.round(x), Math.round(y))) {\n continue;\n }\n\n const lengths = [quad.top.endX - quad.top.startX, quad.bottom.endX - quad.bottom.startX, quad.bottom.y - quad.top.y + 1];\n const size = sum(lengths) / lengths.length;\n // Initial scoring of finder pattern quads by looking at their ratios, not taking into account position\n const score = scorePattern({x: Math.round(x), y: Math.round(y)}, [1, 1, 3, 1, 1], matrix);\n scoredFinderPatternPositions.push({ score, x, y, size });\n }\n if (scoredFinderPatternPositions.length < 3) {\n // A QR code has 3 finder patterns, therefore we need at least 3 candidates.\n return null;\n }\n scoredFinderPatternPositions.sort((a, b) => a.score - b.score);\n\n // Now take the top finder pattern options and try to find 2 other options with a similar size.\n const finderPatternGroups: Array<{ points: [Point, Point, Point], score: number }> = [];\n for (let i = 0; i < Math.min(scoredFinderPatternPositions.length, MAX_FINDERPATTERNS_TO_SEARCH); ++i) {\n const point = scoredFinderPatternPositions[i];\n const otherPoints: typeof scoredFinderPatternPositions = [];\n\n for (const otherPoint of scoredFinderPatternPositions) {\n if (otherPoint === point) {\n continue;\n }\n otherPoints.push({\n ...otherPoint,\n score: otherPoint.score + ((otherPoint.size - point.size) ** 2) / point.size, // score similarity of sizes\n });\n }\n otherPoints.sort((a, b) => a.score - b.score);\n\n finderPatternGroups.push({\n points: [point, otherPoints[0], otherPoints[1]], // note that otherPoints.length >= 2 as scoredFinderPatternPositions.length >= 3\n score: point.score + otherPoints[0].score + otherPoints[1].score, // total combined score of the three points in the group\n });\n }\n finderPatternGroups.sort((a, b) => a.score - b.score);\n const bestFinderPatternGroup = finderPatternGroups[0];\n\n const { topRight, topLeft, bottomLeft } = reorderFinderPatterns(...bestFinderPatternGroup.points);\n const alignment = findAlignmentPattern(matrix, alignmentPatternQuads, topRight, topLeft, bottomLeft);\n const result: QRLocation[] = [];\n if (alignment) {\n result.push({\n alignmentPattern: { x: alignment.alignmentPattern.x, y: alignment.alignmentPattern.y },\n bottomLeft: {x: bottomLeft.x, y: bottomLeft.y },\n dimension: alignment.dimension,\n topLeft: {x: topLeft.x, y: topLeft.y },\n topRight: {x: topRight.x, y: topRight.y },\n });\n }\n\n // We normally use the center of the quads as the location of the tracking points, which is optimal for most cases and will account\n // for a skew in the image. However, In some cases, a slight skew might not be real and instead be caused by image compression\n // errors and/or low resolution. For those cases, we'd be better off centering the point exactly in the middle of the black area. We\n // compute and return the location data for the naively centered points as it is little additional work and allows for multiple\n // attempts at decoding harder images.\n const midTopRight = recenterLocation(matrix, topRight);\n const midTopLeft = recenterLocation(matrix, topLeft);\n const midBottomLeft = recenterLocation(matrix, bottomLeft);\n const centeredAlignment = findAlignmentPattern(matrix, alignmentPatternQuads, midTopRight, midTopLeft, midBottomLeft);\n if (centeredAlignment) {\n result.push({\n alignmentPattern: { x: centeredAlignment.alignmentPattern.x, y: centeredAlignment.alignmentPattern.y },\n bottomLeft: { x: midBottomLeft.x, y: midBottomLeft. y },\n topLeft: { x: midTopLeft.x, y: midTopLeft. y },\n topRight: { x: midTopRight.x, y: midTopRight. y },\n dimension: centeredAlignment.dimension,\n });\n }\n\n if (result.length === 0) {\n return null;\n }\n\n return result;\n}\n\nfunction findAlignmentPattern(matrix: BitMatrix, alignmentPatternQuads: Quad[], topRight: Point, topLeft: Point, bottomLeft: Point) {\n // Now that we've found the three finder patterns we can determine the blockSize and the size of the QR code.\n // We'll use these to help find the alignment pattern but also later when we do the extraction.\n let dimension: number;\n let moduleSize: number;\n try {\n ({ dimension, moduleSize } = computeDimension(topLeft, topRight, bottomLeft, matrix));\n } catch (e) {\n return null;\n }\n\n // Now find the alignment pattern\n const bottomRightFinderPattern = { // Best guess at where a bottomRight finder pattern would be\n x: topRight.x - topLeft.x + bottomLeft.x,\n y: topRight.y - topLeft.y + bottomLeft.y,\n };\n const modulesBetweenFinderPatterns = ((distance(topLeft, bottomLeft) + distance(topLeft, topRight)) / 2 / moduleSize);\n const correctionToTopLeft = 1 - (3 / modulesBetweenFinderPatterns);\n const expectedAlignmentPattern = {\n x: topLeft.x + correctionToTopLeft * (bottomRightFinderPattern.x - topLeft.x),\n y: topLeft.y + correctionToTopLeft * (bottomRightFinderPattern.y - topLeft.y),\n };\n\n const alignmentPatterns = alignmentPatternQuads\n .map(q => {\n const x = (q.top.startX + q.top.endX + q.bottom.startX + q.bottom.endX) / 4;\n const y = (q.top.y + q.bottom.y + 1) / 2;\n if (!matrix.get(Math.floor(x), Math.floor(y))) {\n return;\n }\n\n const sizeScore = scorePattern({x: Math.floor(x), y: Math.floor(y)}, [1, 1, 1], matrix);\n const score = sizeScore + distance({x, y}, expectedAlignmentPattern);\n return { x, y, score };\n })\n .filter(v => !!v)\n .sort((a, b) => a.score - b.score);\n\n // If there are less than 15 modules between finder patterns it's a version 1 QR code and as such has no alignmemnt pattern\n // so we can only use our best guess.\n const alignmentPattern = modulesBetweenFinderPatterns >= 15 && alignmentPatterns.length ? alignmentPatterns[0] : expectedAlignmentPattern;\n\n return { alignmentPattern, dimension };\n}\n", "import {binarize} from \"./binarizer\";\nimport {BitMatrix} from \"./BitMatrix\";\nimport {Chunks} from \"./decoder/decodeData\";\nimport {decode} from \"./decoder/decoder\";\nimport { Version } from \"./decoder/version\";\nimport {extract} from \"./extractor\";\nimport {locate, Point} from \"./locator\";\n\nexport interface QRCode {\n binaryData: number[];\n data: string;\n chunks: Chunks;\n version: number;\n location: {\n topRightCorner: Point;\n topLeftCorner: Point;\n bottomRightCorner: Point;\n bottomLeftCorner: Point;\n\n topRightFinderPattern: Point;\n topLeftFinderPattern: Point;\n bottomLeftFinderPattern: Point;\n\n bottomRightAlignmentPattern?: Point;\n };\n matrix: BitMatrix;\n}\n\nfunction scan(matrix: BitMatrix): QRCode | null {\n const locations = locate(matrix);\n if (!locations) {\n return null;\n }\n\n for (const location of locations) {\n const extracted = extract(matrix, location);\n const decoded = decode(extracted.matrix);\n if (decoded) {\n return {\n binaryData: decoded.bytes,\n data: decoded.text,\n chunks: decoded.chunks,\n version: decoded.version,\n location: {\n topRightCorner: extracted.mappingFunction(location.dimension, 0),\n topLeftCorner: extracted.mappingFunction(0, 0),\n bottomRightCorner: extracted.mappingFunction(location.dimension, location.dimension),\n bottomLeftCorner: extracted.mappingFunction(0, location.dimension),\n\n topRightFinderPattern: location.topRight,\n topLeftFinderPattern: location.topLeft,\n bottomLeftFinderPattern: location.bottomLeft,\n\n bottomRightAlignmentPattern: location.alignmentPattern,\n },\n matrix: extracted.matrix,\n };\n }\n }\n return null;\n}\n\nexport interface Options {\n inversionAttempts?: \"dontInvert\" | \"onlyInvert\" | \"attemptBoth\" | \"invertFirst\";\n greyScaleWeights?: GreyscaleWeights;\n canOverwriteImage?: boolean;\n}\n\nexport interface GreyscaleWeights {\n red: number;\n green: number;\n blue: number;\n useIntegerApproximation?: boolean;\n}\n\nconst defaultOptions: Options = {\n inversionAttempts: \"attemptBoth\",\n greyScaleWeights: {\n red: 0.2126,\n green: 0.7152,\n blue: 0.0722,\n useIntegerApproximation: false,\n },\n canOverwriteImage: true,\n};\n\nfunction mergeObject(target: any, src: any) {\n Object.keys(src).forEach(opt => { // Sad implementation of Object.assign since we target es5 not es6\n target[opt] = src[opt];\n });\n}\n\nfunction jsQR(data: Uint8ClampedArray, width: number, height: number, providedOptions: Options = {}): QRCode | null {\n const options = Object.create(null);\n mergeObject(options, defaultOptions);\n mergeObject(options, providedOptions);\n\n const tryInvertedFirst = options.inversionAttempts === \"onlyInvert\" || options.inversionAttempts === \"invertFirst\";\n const shouldInvert = options.inversionAttempts === \"attemptBoth\" || tryInvertedFirst;\n const {binarized, inverted} = binarize(data, width, height, shouldInvert, options.greyScaleWeights,\n options.canOverwriteImage);\n let result = scan(tryInvertedFirst ? inverted : binarized);\n if (!result && (options.inversionAttempts === \"attemptBoth\" || options.inversionAttempts === \"invertFirst\")) {\n result = scan(tryInvertedFirst ? binarized : inverted);\n }\n return result;\n}\n\n(jsQR as any).default = jsQR;\nexport default jsQR;\n", "// @ts-ignore jsqr-es6 does not provide types currently\nimport jsQR from '../node_modules/jsqr-es6/dist/jsQR.js';\n\ntype GrayscaleWeights = {\n red: number,\n green: number,\n blue: number,\n useIntegerApproximation: boolean,\n};\n\nlet inversionAttempts: 'dontInvert' | 'onlyInvert' | 'attemptBoth' = 'dontInvert';\nlet grayscaleWeights: GrayscaleWeights = {\n // weights for quick luma integer approximation (https://en.wikipedia.org/wiki/YUV#Full_swing_for_BT.601)\n red: 77,\n green: 150,\n blue: 29,\n useIntegerApproximation: true,\n};\n\nself.onmessage = event => {\n const id = event['data']['id'];\n const type = event['data']['type'];\n const data = event['data']['data'];\n\n switch (type) {\n case 'decode':\n decode(data, id);\n break;\n case 'grayscaleWeights':\n setGrayscaleWeights(data);\n break;\n case 'inversionMode':\n setInversionMode(data);\n break;\n case 'close':\n // close after earlier messages in the event loop finished processing\n self.close();\n break;\n }\n};\n\nfunction decode(data: { data: Uint8ClampedArray, width: number, height: number }, requestId: number): void {\n const rgbaData = data['data'];\n const width = data['width'];\n const height = data['height'];\n const result = jsQR(rgbaData, width, height, {\n inversionAttempts: inversionAttempts,\n greyScaleWeights: grayscaleWeights,\n });\n if (!result) {\n (self as unknown as Worker).postMessage({\n id: requestId,\n type: 'qrResult',\n data: null,\n });\n return;\n }\n\n (self as unknown as Worker).postMessage({\n id: requestId,\n type: 'qrResult',\n data: result.data,\n // equivalent to cornerPoints of native BarcodeDetector\n cornerPoints: [\n result.location.topLeftCorner,\n result.location.topRightCorner,\n result.location.bottomRightCorner,\n result.location.bottomLeftCorner,\n ],\n });\n}\n\nfunction setGrayscaleWeights(data: GrayscaleWeights) {\n // update grayscaleWeights in a closure compiler compatible fashion\n grayscaleWeights.red = data['red'];\n grayscaleWeights.green = data['green'];\n grayscaleWeights.blue = data['blue'];\n grayscaleWeights.useIntegerApproximation = data['useIntegerApproximation'];\n}\n\nfunction setInversionMode(inversionMode: 'original' | 'invert' | 'both') {\n switch (inversionMode) {\n case 'original':\n inversionAttempts = 'dontInvert';\n break;\n case 'invert':\n inversionAttempts = 'onlyInvert';\n break;\n case 'both':\n inversionAttempts = 'attemptBoth';\n break;\n default:\n throw new Error('Invalid inversion mode');\n }\n}\n", "class QrScanner {\n static readonly DEFAULT_CANVAS_SIZE = 400;\n static readonly NO_QR_CODE_FOUND = 'No QR code found';\n private static _disableBarcodeDetector = false;\n private static _workerMessageId = 0;\n\n /** @deprecated */\n static set WORKER_PATH(workerPath: string) {\n console.warn('Setting QrScanner.WORKER_PATH is not required and not supported anymore. '\n + 'Have a look at the README for new setup instructions.');\n }\n\n static async hasCamera(): Promise<boolean> {\n try {\n return !!(await QrScanner.listCameras(false)).length;\n } catch (e) {\n return false;\n }\n }\n\n static async listCameras(requestLabels = false): Promise<Array<QrScanner.Camera>> {\n if (!navigator.mediaDevices) return [];\n\n const enumerateCameras = async (): Promise<Array<MediaDeviceInfo>> =>\n (await navigator.mediaDevices.enumerateDevices()).filter((device) => device.kind === 'videoinput');\n\n // Note that enumerateDevices can always be called and does not prompt the user for permission.\n // However, enumerateDevices only includes device labels if served via https and an active media stream exists\n // or permission to access the camera was given. Therefore, if we're not getting labels but labels are requested\n // ask for camera permission by opening a stream.\n let openedStream: MediaStream | undefined;\n try {\n if (requestLabels && (await enumerateCameras()).every((camera) => !camera.label)) {\n openedStream = await navigator.mediaDevices.getUserMedia({ audio: false, video: true });\n }\n } catch (e) {\n // Fail gracefully, especially if the device has no camera or on mobile when the camera is already in use\n // and some browsers disallow a second stream.\n }\n\n try {\n return (await enumerateCameras()).map((camera, i) => ({\n id: camera.deviceId,\n label: camera.label || (i === 0 ? 'Default Camera' : `Camera ${i + 1}`),\n }));\n } finally {\n // close the stream we just opened for getting camera access for listing the device labels\n if (openedStream) {\n console.warn('Call listCameras after successfully starting a QR scanner to avoid creating '\n + 'a temporary video stream');\n QrScanner._stopVideoStream(openedStream);\n }\n }\n }\n\n readonly $video: HTMLVideoElement;\n readonly $canvas: HTMLCanvasElement;\n readonly $overlay?: HTMLDivElement;\n private readonly $codeOutlineHighlight?: SVGSVGElement;\n private readonly _onDecode?: (result: QrScanner.ScanResult) => void;\n private readonly _legacyOnDecode?: (result: string) => void;\n private readonly _legacyCanvasSize: number = QrScanner.DEFAULT_CANVAS_SIZE;\n private _preferredCamera: QrScanner.FacingMode | QrScanner.DeviceId = 'environment';\n private readonly _maxScansPerSecond: number = 25;\n private _lastScanTimestamp: number = -1;\n private _scanRegion: QrScanner.ScanRegion;\n private _codeOutlineHighlightRemovalTimeout?: number;\n private _qrEnginePromise: Promise<Worker | BarcodeDetector>\n private _active: boolean = false;\n private _paused: boolean = false;\n private _flashOn: boolean = false;\n private _destroyed: boolean = false;\n\n constructor(\n video: HTMLVideoElement,\n onDecode: (result: QrScanner.ScanResult) => void,\n options: {\n onDecodeError?: (error: Error | string) => void,\n calculateScanRegion?: (video: HTMLVideoElement) => QrScanner.ScanRegion,\n preferredCamera?: QrScanner.FacingMode | QrScanner.DeviceId,\n maxScansPerSecond?: number;\n highlightScanRegion?: boolean,\n highlightCodeOutline?: boolean,\n overlay?: HTMLDivElement,\n /** just a temporary flag until we switch entirely to the new api */\n returnDetailedScanResult?: true,\n },\n );\n /** @deprecated */\n constructor(\n video: HTMLVideoElement,\n onDecode: (result: string) => void,\n onDecodeError?: (error: Error | string) => void,\n calculateScanRegion?: (video: HTMLVideoElement) => QrScanner.ScanRegion,\n preferredCamera?: QrScanner.FacingMode | QrScanner.DeviceId,\n );\n /** @deprecated */\n constructor(\n video: HTMLVideoElement,\n onDecode: (result: string) => void,\n onDecodeError?: (error: Error | string) => void,\n canvasSize?: number,\n preferredCamera?: QrScanner.FacingMode | QrScanner.DeviceId,\n );\n /** @deprecated */\n constructor(video: HTMLVideoElement, onDecode: (result: string) => void, canvasSize?: number);\n constructor(\n video: HTMLVideoElement,\n onDecode: ((result: QrScanner.ScanResult) => void) | ((result: string) => void),\n canvasSizeOrOnDecodeErrorOrOptions?: number | ((error: Error | string) => void) | {\n onDecodeError?: (error: Error | string) => void,\n calculateScanRegion?: (video: HTMLVideoElement) => QrScanner.ScanRegion,\n preferredCamera?: QrScanner.FacingMode | QrScanner.DeviceId,\n maxScansPerSecond?: number;\n highlightScanRegion?: boolean,\n highlightCodeOutline?: boolean,\n overlay?: HTMLDivElement,\n /** just a temporary flag until we switch entirely to the new api */\n returnDetailedScanResult?: true,\n },\n canvasSizeOrCalculateScanRegion?: number | ((video: HTMLVideoElement) => QrScanner.ScanRegion),\n preferredCamera?: QrScanner.FacingMode | QrScanner.DeviceId,\n ) {\n this.$video = video;\n this.$canvas = document.createElement('canvas');\n\n if (canvasSizeOrOnDecodeErrorOrOptions && typeof canvasSizeOrOnDecodeErrorOrOptions === 'object') {\n // we got an options object using the new api\n this._onDecode = onDecode as QrScanner['_onDecode'];\n } else {\n if (canvasSizeOrOnDecodeErrorOrOptions || canvasSizeOrCalculateScanRegion || preferredCamera) {\n console.warn('You\\'re using a deprecated version of the QrScanner constructor which will be removed in '\n + 'the future');\n } else {\n // Only video and onDecode were specified and we can't distinguish between new or old api usage. For\n // backwards compatibility we have to assume the old api for now. The options object is marked as non-\n // optional in the parameter list above to make clear that ScanResult instead of string is only passed\n // if an options object was provided. However, in the future once legacy support is removed, the options\n // object should become optional.\n console.warn('Note that the type of the scan result passed to onDecode will change in the future. '\n + 'To already switch to the new api today, you can pass returnDetailedScanResult: true.');\n }\n this._legacyOnDecode = onDecode as QrScanner['_legacyOnDecode'];\n }\n\n const options = typeof canvasSizeOrOnDecodeErrorOrOptions === 'object'\n ? canvasSizeOrOnDecodeErrorOrOptions\n : {};\n this._onDecodeError = options.onDecodeError || (typeof canvasSizeOrOnDecodeErrorOrOptions === 'function'\n ? canvasSizeOrOnDecodeErrorOrOptions\n : this._onDecodeError);\n this._calculateScanRegion = options.calculateScanRegion || (typeof canvasSizeOrCalculateScanRegion==='function'\n ? canvasSizeOrCalculateScanRegion\n : this._calculateScanRegion);\n this._preferredCamera = options.preferredCamera || preferredCamera || this._preferredCamera;\n this._legacyCanvasSize = typeof canvasSizeOrOnDecodeErrorOrOptions === 'number'\n ? canvasSizeOrOnDecodeErrorOrOptions\n : typeof canvasSizeOrCalculateScanRegion === 'number'\n ? canvasSizeOrCalculateScanRegion\n : this._legacyCanvasSize;\n this._maxScansPerSecond = options.maxScansPerSecond || this._maxScansPerSecond;\n\n this._onPlay = this._onPlay.bind(this);\n this._onLoadedMetaData = this._onLoadedMetaData.bind(this);\n this._onVisibilityChange = this._onVisibilityChange.bind(this);\n this._updateOverlay = this._updateOverlay.bind(this);\n\n // @ts-ignore\n video.disablePictureInPicture = true;\n // Allow inline playback on iPhone instead of requiring full screen playback,\n // see https://webkit.org/blog/6784/new-video-policies-for-ios/\n // @ts-ignore\n video.playsInline = true;\n // Allow play() on iPhone without requiring a user gesture. Should not really be needed as camera stream\n // includes no audio, but just to be safe.\n video.muted = true;\n\n // Avoid Safari stopping the video stream on a hidden video.\n // See https://github.com/cozmo/jsQR/issues/185\n let shouldHideVideo = false;\n if (video.hidden) {\n video.hidden = false;\n shouldHideVideo = true;\n }\n if (!document.body.contains(video)) {\n document.body.appendChild(video);\n shouldHideVideo = true;\n }\n const videoContainer = video.parentElement!;\n\n if (options.highlightScanRegion || options.highlightCodeOutline) {\n const gotExternalOverlay = !!options.overlay;\n this.$overlay = options.overlay || document.createElement('div');\n const overlayStyle = this.$overlay.style;\n overlayStyle.position = 'absolute';\n overlayStyle.display = 'none';\n overlayStyle.pointerEvents = 'none';\n this.$overlay.classList.add('scan-region-highlight');\n if (!gotExternalOverlay && options.highlightScanRegion) {\n // default style; can be overwritten via css, e.g. by changing the svg's stroke color, hiding the\n // .scan-region-highlight-svg, setting a border, outline, background, etc.\n this.$overlay.innerHTML = '<svg class=\"scan-region-highlight-svg\" viewBox=\"0 0 238 238\" '\n + 'preserveAspectRatio=\"none\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;'\n + 'fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round\">'\n + '<path d=\"M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 '\n + '0H10a8 8 0 0 1-8-8v-21\"/></svg>';\n try {\n this.$overlay.firstElementChild!.animate({ transform: ['scale(.98)', 'scale(1.01)'] }, {\n duration: 400,\n iterations: Infinity,\n direction: 'alternate',\n easing: 'ease-in-out',\n });\n } catch (e) {}\n videoContainer.insertBefore(this.$overlay, this.$video.nextSibling);\n }\n if (options.highlightCodeOutline) {\n // default style; can be overwritten via css\n this.$overlay.insertAdjacentHTML(\n 'beforeend',\n '<svg class=\"code-outline-highlight\" preserveAspectRatio=\"none\" style=\"display:none;width:100%;'\n + 'height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;'\n + 'stroke-linecap:round;stroke-linejoin:round\"><polygon/></svg>',\n );\n this.$codeOutlineHighlight = this.$overlay.lastElementChild as SVGSVGElement;\n }\n }\n this._scanRegion = this._calculateScanRegion(video);\n\n requestAnimationFrame(() => {\n // Checking in requestAnimationFrame which should avoid a potential additional re-flow for getComputedStyle.\n const videoStyle = window.getComputedStyle(video);\n if (videoStyle.display === 'none') {\n video.style.setProperty('display', 'block', 'important');\n shouldHideVideo = true;\n }\n if (videoStyle.visibility !== 'visible') {\n video.style.setProperty('visibility', 'visible', 'important');\n shouldHideVideo = true;\n }\n if (shouldHideVideo) {\n // Hide the video in a way that doesn't cause Safari to stop the playback.\n console.warn('QrScanner has overwritten the video hiding style to avoid Safari stopping the playback.');\n video.style.opacity = '0';\n video.style.width = '0';\n video.style.height = '0';\n if (this.$overlay && this.$overlay.parentElement) {\n this.$overlay.parentElement.removeChild(this.$overlay);\n }\n // @ts-ignore\n delete this.$overlay!;\n // @ts-ignore\n delete this.$codeOutlineHighlight!;\n }\n\n if (this.$overlay) {\n this._updateOverlay();\n }\n });\n\n video.addEventListener('play', this._onPlay);\n video.addEventListener('loadedmetadata', this._onLoadedMetaData);\n document.addEventListener('visibilitychange', this._onVisibilityChange);\n window.addEventListener('resize', this._updateOverlay);\n\n this._qrEnginePromise = QrScanner.createQrEngine();\n }\n\n async hasFlash(): Promise<boolean> {\n let stream: MediaStream | undefined;\n try {\n if (this.$video.srcObject) {\n if (!(this.$video.srcObject instanceof MediaStream)) return false; // srcObject is not a camera stream\n stream = this.$video.srcObject;\n } else {\n stream = (await this._getCameraStream()).stream;\n }\n return 'torch' in stream.getVideoTracks()[0].getSettings();\n } catch (e) {\n return false;\n } finally {\n // close the stream we just opened for detecting whether it supports flash\n if (stream && stream !== this.$video.srcObject) {\n console.warn('Call hasFlash after successfully starting the scanner to avoid creating '\n + 'a temporary video stream');\n QrScanner._stopVideoStream(stream);\n }\n }\n }\n\n isFlashOn(): boolean {\n return this._flashOn;\n }\n\n async toggleFlash(): Promise<void> {\n if (this._flashOn) {\n await this.turnFlashOff();\n } else {\n await this.turnFlashOn();\n }\n }\n\n async turnFlashOn(): Promise<void> {\n if (this._flashOn || this._destroyed) return;\n this._flashOn = true;\n if (!this._active || this._paused) return; // flash will be turned on later on .start()\n try {\n if (!await this.hasFlash()) throw 'No flash available';\n // Note that the video track is guaranteed to exist and to be a MediaStream due to the check in hasFlash\n await (this.$video.srcObject as MediaStream).getVideoTracks()[0].applyConstraints({\n // @ts-ignore: constraint 'torch' is unknown to ts\n advanced: [{ torch: true }],\n });\n } catch (e) {\n this._flashOn = false;\n throw e;\n }\n }\n\n async turnFlashOff(): Promise<void> {\n if (!this._flashOn) return;\n // applyConstraints with torch: false does not work to turn the flashlight off, as a stream's torch stays\n // continuously on, see https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#torch. Therefore,\n // we have to stop the stream to turn the flashlight off.\n this._flashOn = false;\n await this._restartVideoStream();\n }\n\n destroy(): void {\n this.$video.removeEventListener('loadedmetadata', this._onLoadedMetaData);\n this.$video.removeEventListener('play', this._onPlay);\n document.removeEventListener('visibilitychange', this._onVisibilityChange);\n window.removeEventListener('resize', this._updateOverlay);\n\n this._destroyed = true;\n this._flashOn = false;\n this.stop(); // sets this._paused = true and this._active = false\n QrScanner._postWorkerMessage(this._qrEnginePromise, 'close');\n }\n\n async start(): Promise<void> {\n if (this._destroyed) throw new Error('The QR scanner can not be started as it had been destroyed.');\n if (this._active && !this._paused) return;\n\n if (window.location.protocol !== 'https:') {\n // warn but try starting the camera anyways\n console.warn('The camera stream is only accessible if the page is transferred via https.');\n }\n\n this._active = true;\n if (document.hidden) return; // camera will be started as soon as tab is in foreground\n this._paused = false;\n if (this.$video.srcObject) {\n // camera stream already/still set\n await this.$video.play();\n return;\n }\n\n try {\n const { stream, facingMode } = await this._getCameraStream();\n if (!this._active || this._paused) {\n // was stopped in the meantime\n QrScanner._stopVideoStream(stream);\n return;\n }\n this._setVideoMirror(facingMode);\n this.$video.srcObject = stream;\n await this.$video.play();\n\n // Restart the flash if it was previously on\n if (this._flashOn) {\n this._flashOn = false; // force turnFlashOn to restart the flash\n this.turnFlashOn().catch(() => {});\n }\n } catch (e) {\n if (this._paused) return;\n this._active = false;\n throw e;\n }\n }\n\n stop(): void {\n this.pause();\n this._active = false;\n }\n\n async pause(stopStreamImmediately = false): Promise<boolean> {\n this._paused = true;\n if (!this._active) return true;\n this.$video.pause();\n\n if (this.$overlay) {\n this.$overlay.style.display = 'none';\n }\n\n const stopStream = () => {\n if (this.$video.srcObject instanceof MediaStream) {\n // revoke srcObject only if it's a stream which was likely set by us\n QrScanner._stopVideoStream(this.$video.srcObject);\n this.$video.srcObject = null;\n }\n };\n\n if (stopStreamImmediately) {\n stopStream();\n return true;\n }\n\n await new Promise((resolve) => setTimeout(resolve, 300));\n if (!this._paused) return false;\n stopStream();\n return true;\n }\n\n async setCamera(facingModeOrDeviceId: QrScanner.FacingMode | QrScanner.DeviceId): Promise<void> {\n if (facingModeOrDeviceId === this._preferredCamera) return;\n this._preferredCamera = facingModeOrDeviceId;\n // Restart the scanner with the new camera which will also update the video mirror and the scan region.\n await this._restartVideoStream();\n }\n\n static async scanImage(\n imageOrFileOrBlobOrUrl: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap\n | SVGImageElement | File | Blob | URL | String,\n options: {\n scanRegion?: QrScanner.ScanRegion | null,\n qrEngine?: Worker | BarcodeDetector | Promise<Worker | BarcodeDetector> | null,\n canvas?: HTMLCanvasElement | null,\n disallowCanvasResizing?: boolean,\n alsoTryWithoutScanRegion?: boolean,\n /** just a temporary flag until we switch entirely to the new api */\n returnDetailedScanResult?: true,\n },\n ): Promise<QrScanner.ScanResult>;\n /** @deprecated */\n static async scanImage(\n imageOrFileOrBlobOrUrl: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap\n | SVGImageElement | File | Blob | URL | String,\n scanRegion?: QrScanner.ScanRegion | null,\n qrEngine?: Worker | BarcodeDetector | Promise<Worker | BarcodeDetector> | null,\n canvas?: HTMLCanvasElement | null,\n disallowCanvasResizing?: boolean,\n alsoTryWithoutScanRegion?: boolean,\n ): Promise<string>;\n static async scanImage(\n imageOrFileOrBlobOrUrl: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap\n | SVGImageElement | File | Blob | URL | String,\n scanRegionOrOptions?: QrScanner.ScanRegion | {\n scanRegion?: QrScanner.ScanRegion | null,\n qrEngine?: Worker | BarcodeDetector | Promise<Worker | BarcodeDetector> | null,\n canvas?: HTMLCanvasElement | null,\n disallowCanvasResizing?: boolean,\n alsoTryWithoutScanRegion?: boolean,\n /** just a temporary flag until we switch entirely to the new api */\n returnDetailedScanResult?: true,\n } | null,\n qrEngine?: Worker | BarcodeDetector | Promise<Worker | BarcodeDetector> | null,\n canvas?: HTMLCanvasElement | null,\n disallowCanvasResizing: boolean = false,\n alsoTryWithoutScanRegion: boolean = false,\n ): Promise<string | QrScanner.ScanResult> {\n let scanRegion: QrScanner.ScanRegion | null | undefined;\n let returnDetailedScanResult = false;\n if (scanRegionOrOptions && (\n 'scanRegion' in scanRegionOrOptions\n || 'qrEngine' in scanRegionOrOptions\n || 'canvas' in scanRegionOrOptions\n || 'disallowCanvasResizing' in scanRegionOrOptions\n || 'alsoTryWithoutScanRegion' in scanRegionOrOptions\n || 'returnDetailedScanResult' in scanRegionOrOptions\n )) {\n // we got an options object using the new api\n scanRegion = scanRegionOrOptions.scanRegion;\n qrEngine = scanRegionOrOptions.qrEngine;\n canvas = scanRegionOrOptions.canvas;\n disallowCanvasResizing = scanRegionOrOptions.disallowCanvasResizing || false;\n alsoTryWithoutScanRegion = scanRegionOrOptions.alsoTryWithoutScanRegion || false;\n returnDetailedScanResult = true;\n } else if (scanRegionOrOptions || qrEngine || canvas || disallowCanvasResizing || alsoTryWithoutScanRegion) {\n console.warn('You\\'re using a deprecated api for scanImage which will be removed in the future.');\n } else {\n // Only imageOrFileOrBlobOrUrl was specified and we can't distinguish between new or old api usage. For\n // backwards compatibility we have to assume the old api for now. The options object is marked as non-\n // optional in the parameter list above to make clear that ScanResult instead of string is only returned if\n // an options object was provided. However, in the future once legacy support is removed, the options object\n // should become optional.\n console.warn('Note that the return type of scanImage will change in the future. To already switch to the '\n + 'new api today, you can pass returnDetailedScanResult: true.');\n }\n\n const gotExternalEngine = !!qrEngine;\n\n try {\n let image: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap\n | SVGImageElement;\n let canvasContext: CanvasRenderingContext2D;\n [qrEngine, image] = await Promise.all([\n qrEngine || QrScanner.createQrEngine(),\n QrScanner._loadImage(imageOrFileOrBlobOrUrl),\n ]);\n [canvas, canvasContext] = QrScanner._drawToCanvas(image, scanRegion, canvas, disallowCanvasResizing);\n let detailedScanResult: QrScanner.ScanResult;\n\n if (qrEngine instanceof Worker) {\n const qrEngineWorker = qrEngine; // for ts to know that it's still a worker later in the event listeners\n if (!gotExternalEngine) {\n // Enable scanning of inverted color qr codes.\n QrScanner._postWorkerMessageSync(qrEngineWorker, 'inversionMode', 'both');\n }\n detailedScanResult = await new Promise((resolve, reject) => {\n let timeout: number;\n let onMessage: (event: MessageEvent) => void;\n let onError: (error: ErrorEvent | string) => void;\n let expectedResponseId = -1;\n onMessage = (event: MessageEvent) => {\n if (event.data.id !== expectedResponseId) {\n return;\n }\n qrEngineWorker.removeEventListener('message', onMessage);\n qrEngineWorker.removeEventListener('error', onError);\n clearTimeout(timeout);\n if (event.data.data !== null) {\n resolve({\n data: event.data.data,\n cornerPoints: QrScanner._convertPoints(event.data.cornerPoints, scanRegion),\n });\n } else {\n reject(QrScanner.NO_QR_CODE_FOUND);\n }\n };\n onError = (error: ErrorEvent | string) => {\n qrEngineWorker.removeEventListener('message', onMessage);\n qrEngineWorker.removeEventListener('error', onError);\n clearTimeout(timeout);\n const errorMessage = !error ? 'Unknown Error' : ((error as ErrorEvent).message || error);\n reject('Scanner error: ' + errorMessage);\n };\n qrEngineWorker.addEventListener('message', onMessage);\n qrEngineWorker.addEventListener('error', onError);\n timeout = setTimeout(() => onError('timeout'), 10000);\n const imageData = canvasContext.getImageData(0, 0, canvas!.width, canvas!.height);\n expectedResponseId = QrScanner._postWorkerMessageSync(\n qrEngineWorker,\n 'decode',\n imageData,\n [imageData.data.buffer],\n );\n });\n } else {\n detailedScanResult = await Promise.race([\n new Promise<QrScanner.ScanResult>((resolve, reject) => window.setTimeout(\n () => reject('Scanner error: timeout'),\n 10000,\n )),\n (async (): Promise<QrScanner.ScanResult> => {\n try {\n const [scanResult] = await qrEngine.detect(canvas!);\n if (!scanResult) throw QrScanner.NO_QR_CODE_FOUND;\n return {\n data: scanResult.rawValue,\n cornerPoints: QrScanner._convertPoints(scanResult.cornerPoints, scanRegion),\n };\n } catch (e) {\n const errorMessage = (e as Error).message || e as string;\n if (/not implemented|service unavailable/.test(errorMessage)) {\n // Not implemented can apparently for some reason happen even though getSupportedFormats\n // in createQrScanner reported that it's supported, see issue #98.\n // Service unavailable can happen after some time when the BarcodeDetector crashed and\n // can theoretically be recovered from by creating a new BarcodeDetector. However, in\n // newer browsers this issue does not seem to be present anymore and therefore we do not\n // apply this optimization anymore but just set _disableBarcodeDetector in both cases.\n // Also note that if we got an external qrEngine that crashed, we should possibly notify\n // the caller about it, but we also don't do this here, as it's such an unlikely case.\n QrScanner._disableBarcodeDetector = true;\n // retry without passing the broken BarcodeScanner instance\n return QrScanner.scanImage(imageOrFileOrBlobOrUrl, {\n scanRegion,\n canvas,\n disallowCanvasResizing,\n alsoTryWithoutScanRegion,\n });\n }\n throw `Scanner error: ${errorMessage}`;\n }\n })(),\n ]);\n }\n return returnDetailedScanResult ? detailedScanResult : detailedScanResult.data;\n } catch (e) {\n if (!scanRegion || !alsoTryWithoutScanRegion) throw e;\n const detailedScanResult = await QrScanner.scanImage(\n imageOrFileOrBlobOrUrl,\n { qrEngine, canvas, disallowCanvasResizing },\n );\n return returnDetailedScanResult ? detailedScanResult : detailedScanResult.data;\n } finally {\n if (!gotExternalEngine) {\n QrScanner._postWorkerMessage(qrEngine!, 'close');\n }\n }\n }\n\n setGrayscaleWeights(red: number, green: number, blue: number, useIntegerApproximation: boolean = true): void {\n // Note that for the native BarcodeDecoder or if the worker was destroyed, this is a no-op. However, the native\n // implementations work also well with colored qr codes.\n QrScanner._postWorkerMessage(\n this._qrEnginePromise,\n 'grayscaleWeights',\n { red, green, blue, useIntegerApproximation }\n );\n }\n\n setInversionMode(inversionMode: QrScanner.InversionMode): void {\n // Note that for the native BarcodeDecoder or if the worker was destroyed, this is a no-op. However, the native\n // implementations scan normal and inverted qr codes by default\n QrScanner._postWorkerMessage(this._qrEnginePromise, 'inversionMode', inversionMode);\n }\n\n static async createQrEngine(): Promise<Worker | BarcodeDetector>;\n /** @deprecated */\n static async createQrEngine(workerPath: string): Promise<Worker | BarcodeDetector>;\n static async createQrEngine(workerPath?: string): Promise<Worker | BarcodeDetector> {\n if (workerPath) {\n console.warn('Specifying a worker path is not required and not supported anymore.');\n }\n\n // @ts-ignore no types defined for import\n const createWorker = () => (import('./qr-scanner-worker.min.js') as Promise<{ createWorker: () => Worker }>)\n .then((module) => module.createWorker());\n\n const useBarcodeDetector = !QrScanner._disableBarcodeDetector\n && 'BarcodeDetector' in window\n && BarcodeDetector.getSupportedFormats\n && (await BarcodeDetector.getSupportedFormats()).includes('qr_code');\n\n if (!useBarcodeDetector) return createWorker();\n\n // On Macs with an M1/M2 processor and macOS Ventura (macOS version 13), the BarcodeDetector is broken in\n // Chromium based browsers, regardless of the version. For that constellation, the BarcodeDetector does not\n // error but does not detect QR codes. Macs without an M1/M2 or before Ventura are fine.\n // See issue #209 and https://bugs.chromium.org/p/chromium/issues/detail?id=1382442\n // TODO update this once the issue in macOS is fixed\n const userAgentData = navigator.userAgentData;\n const isChromiumOnMacWithArmVentura = userAgentData // all Chromium browsers support userAgentData\n && userAgentData.brands.some(({ brand }) => /Chromium/i.test(brand))\n && /mac ?OS/i.test(userAgentData.platform)\n // Does it have an ARM chip (e.g. M1/M2) and Ventura? Check this last as getHighEntropyValues can\n // theoretically trigger a browser prompt, although no browser currently does seem to show one.\n // If browser or user refused to return the requested values, assume broken ARM Ventura, to be safe.\n && await userAgentData.getHighEntropyValues(['architecture', 'platformVersion'])\n .then(({ architecture, platformVersion }) =>\n /arm/i.test(architecture || 'arm') && parseInt(platformVersion || '13') >= /* Ventura */ 13)\n .catch(() => true);\n if (isChromiumOnMacWithArmVentura) return createWorker();\n\n return new BarcodeDetector({ formats: ['qr_code'] });\n }\n\n private _onPlay(): void {\n this._scanRegion = this._calculateScanRegion(this.$video);\n this._updateOverlay();\n if (this.$overlay) {\n this.$overlay.style.display = '';\n }\n this._scanFrame();\n }\n\n private _onLoadedMetaData(): void {\n this._scanRegion = this._calculateScanRegion(this.$video);\n this._updateOverlay();\n }\n\n private _onVisibilityChange(): void {\n if (document.hidden) {\n this.pause();\n } else if (this._active) {\n this.start();\n }\n }\n\n private _calculateScanRegion(video: HTMLVideoElement): QrScanner.ScanRegion {\n // Default scan region calculation. Note that this can be overwritten in the constructor.\n const smallestDimension = Math.min(video.videoWidth, video.videoHeight);\n const scanRegionSize = Math.round(2 / 3 * smallestDimension);\n return {\n x: Math.round((video.videoWidth - scanRegionSize) / 2),\n y: Math.round((video.videoHeight - scanRegionSize) / 2),\n width: scanRegionSize,\n height: scanRegionSize,\n downScaledWidth: this._legacyCanvasSize,\n downScaledHeight: this._legacyCanvasSize,\n };\n }\n\n private _updateOverlay(): void {\n requestAnimationFrame(() => {\n // Running in requestAnimationFrame which should avoid a potential additional re-flow for getComputedStyle\n // and offsetWidth, offsetHeight, offsetLeft, offsetTop.\n if (!this.$overlay) return;\n const video = this.$video;\n const videoWidth = video.videoWidth;\n const videoHeight = video.videoHeight;\n const elementWidth = video.offsetWidth;\n const elementHeight = video.offsetHeight;\n const elementX = video.offsetLeft;\n const elementY = video.offsetTop;\n\n const videoStyle = window.getComputedStyle(video);\n const videoObjectFit = videoStyle.objectFit;\n const videoAspectRatio = videoWidth / videoHeight;\n const elementAspectRatio = elementWidth / elementHeight;\n let videoScaledWidth: number;\n let videoScaledHeight: number;\n switch (videoObjectFit) {\n case 'none':\n videoScaledWidth = videoWidth;\n videoScaledHeight = videoHeight;\n break;\n case 'fill':\n videoScaledWidth = elementWidth;\n videoScaledHeight = elementHeight;\n break;\n default: // 'cover', 'contains', 'scale-down'\n if (videoObjectFit === 'cover'\n ? videoAspectRatio > elementAspectRatio\n : videoAspectRatio < elementAspectRatio) {\n // The scaled height is the element height\n // - for 'cover' if the video aspect ratio is wider than the element aspect ratio\n // (scaled height matches element height and scaled width overflows element width)\n // - for 'contains'/'scale-down' if element aspect ratio is wider than the video aspect ratio\n // (scaled height matched element height and element width overflows scaled width)\n videoScaledHeight = elementHeight;\n videoScaledWidth = videoScaledHeight * videoAspectRatio;\n } else {\n videoScaledWidth = elementWidth;\n videoScaledHeight = videoScaledWidth / videoAspectRatio;\n }\n if (videoObjectFit === 'scale-down') {\n // for 'scale-down' the dimensions are the minimum of 'contains' and 'none'\n videoScaledWidth = Math.min(videoScaledWidth, videoWidth);\n videoScaledHeight = Math.min(videoScaledHeight, videoHeight);\n }\n }\n\n // getComputedStyle is so nice to convert keywords (left, center, right, top, bottom) to percent and makes\n // sure to set the default of 50% if only one or no component was provided, therefore we can be sure that\n // both components are set. Additionally, it converts units other than px (e.g. rem) to px.\n const [videoX, videoY] = videoStyle.objectPosition.split(' ').map((length, i) => {\n const lengthValue = parseFloat(length);\n return length.endsWith('%')\n ? (!i ? elementWidth - videoScaledWidth : elementHeight - videoScaledHeight) * lengthValue / 100\n : lengthValue;\n });\n\n const regionWidth = this._scanRegion.width || videoWidth;\n const regionHeight = this._scanRegion.height || videoHeight;\n const regionX = this._scanRegion.x || 0;\n const regionY = this._scanRegion.y || 0;\n\n const overlayStyle = this.$overlay.style;\n overlayStyle.width = `${regionWidth / videoWidth * videoScaledWidth}px`;\n overlayStyle.height = `${regionHeight / videoHeight * videoScaledHeight}px`;\n overlayStyle.top = `${elementY + videoY + regionY / videoHeight * videoScaledHeight}px`;\n const isVideoMirrored = /scaleX\\(-1\\)/.test(video.style.transform!);\n overlayStyle.left = `${elementX\n + (isVideoMirrored ? elementWidth - videoX - videoScaledWidth : videoX)\n + (isVideoMirrored ? videoWidth - regionX - regionWidth : regionX) / videoWidth * videoScaledWidth}px`;\n // apply same mirror as on video\n overlayStyle.transform = video.style.transform;\n });\n }\n\n private static _convertPoints(\n points: QrScanner.Point[],\n scanRegion?: QrScanner.ScanRegion | null,\n ): QrScanner.Point[] {\n if (!scanRegion) return points;\n const offsetX = scanRegion.x || 0;\n const offsetY = scanRegion.y || 0;\n const scaleFactorX = scanRegion.width && scanRegion.downScaledWidth\n ? scanRegion.width / scanRegion.downScaledWidth\n : 1;\n const scaleFactorY = scanRegion.height && scanRegion.downScaledHeight\n ? scanRegion.height / scanRegion.downScaledHeight\n : 1;\n for (const point of points) {\n point.x = point.x * scaleFactorX + offsetX;\n point.y = point.y * scaleFactorY + offsetY;\n }\n return points;\n }\n\n private _scanFrame(): void {\n if (!this._active || this.$video.paused || this.$video.ended) return;\n // If requestVideoFrameCallback is available use that to avoid unnecessary scans on the same frame as the\n // camera's framerate can be lower than the screen refresh rate and this._maxScansPerSecond, especially in dark\n // settings where the exposure time is longer. Both, requestVideoFrameCallback and requestAnimationFrame are not\n // being fired if the tab is in the background, which is what we want.\n const requestFrame = 'requestVideoFrameCallback' in this.$video\n // @ts-ignore\n ? this.$video.requestVideoFrameCallback.bind(this.$video)\n : requestAnimationFrame;\n requestFrame(async () => {\n if (this.$video.readyState <= 1) {\n // Skip scans until the video is ready as drawImage() only works correctly on a video with readyState\n // > 1, see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage#Notes.\n // This also avoids false positives for videos paused after a successful scan which remains visible on\n // the canvas until the video is started again and ready.\n this._scanFrame();\n return;\n }\n\n const timeSinceLastScan = Date.now() - this._lastScanTimestamp;\n const minimumTimeBetweenScans = 1000 / this._maxScansPerSecond;\n if (timeSinceLastScan < minimumTimeBetweenScans) {\n await new Promise((resolve) => setTimeout(resolve, minimumTimeBetweenScans - timeSinceLastScan));\n }\n // console.log('Scan rate:', Math.round(1000 / (Date.now() - this._lastScanTimestamp)));\n this._lastScanTimestamp = Date.now();\n\n let result: QrScanner.ScanResult | undefined;\n try {\n result = await QrScanner.scanImage(this.$video, {\n scanRegion: this._scanRegion,\n qrEngine: this._qrEnginePromise,\n canvas: this.$canvas,\n });\n } catch (error) {\n if (!this._active) return;\n this._onDecodeError(error as Error | string);\n }\n\n if (QrScanner._disableBarcodeDetector && !(await this._qrEnginePromise instanceof Worker)) {\n // replace the disabled BarcodeDetector\n this._qrEnginePromise = QrScanner.createQrEngine();\n }\n\n if (result) {\n if (this._onDecode) {\n this._onDecode(result);\n } else if (this._legacyOnDecode) {\n this._legacyOnDecode(result.data);\n }\n\n if (this.$codeOutlineHighlight) {\n clearTimeout(this._codeOutlineHighlightRemovalTimeout);\n this._codeOutlineHighlightRemovalTimeout = undefined;\n this.$codeOutlineHighlight.setAttribute(\n 'viewBox',\n `${this._scanRegion.x || 0} `\n + `${this._scanRegion.y || 0} `\n + `${this._scanRegion.width || this.$video.videoWidth} `\n + `${this._scanRegion.height || this.$video.videoHeight}`,\n );\n const polygon = this.$codeOutlineHighlight.firstElementChild!;\n polygon.setAttribute('points', result.cornerPoints.map(({x, y}) => `${x},${y}`).join(' '));\n this.$codeOutlineHighlight.style.display = '';\n }\n } else if (this.$codeOutlineHighlight && !this._codeOutlineHighlightRemovalTimeout) {\n // hide after timeout to make it flash less when on some frames the QR code is detected and on some not\n this._codeOutlineHighlightRemovalTimeout = setTimeout(\n () => this.$codeOutlineHighlight!.style.display = 'none',\n 100,\n );\n }\n\n this._scanFrame();\n });\n }\n\n private _onDecodeError(error: Error | string): void {\n // default error handler; can be overwritten in the constructor\n if (error === QrScanner.NO_QR_CODE_FOUND) return;\n console.log(error);\n }\n\n private async _getCameraStream(): Promise<{ stream: MediaStream, facingMode: QrScanner.FacingMode }> {\n if (!navigator.mediaDevices) throw 'Camera not found.';\n\n const preferenceType = /^(environment|user)$/.test(this._preferredCamera)\n ? 'facingMode'\n : 'deviceId';\n const constraintsWithoutCamera: Array<MediaTrackConstraints> = [{\n width: { min: 1024 }\n }, {\n width: { min: 768 }\n }, {}];\n const constraintsWithCamera = constraintsWithoutCamera.map((constraint) => Object.assign({}, constraint, {\n [preferenceType]: { exact: this._preferredCamera },\n }));\n\n for (const constraints of [...constraintsWithCamera, ...constraintsWithoutCamera]) {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: constraints, audio: false });\n // Try to determine the facing mode from the stream, otherwise use a guess or 'environment' as\n // default. Note that the guess is not always accurate as Safari returns cameras of different facing\n // mode, even for exact facingMode constraints.\n const facingMode = this._getFacingMode(stream)\n || (constraints.facingMode\n ? this._preferredCamera as QrScanner.FacingMode // a facing mode we were able to fulfill\n : (this._preferredCamera === 'environment'\n ? 'user' // switch as _preferredCamera was environment but we are not able to fulfill it\n : 'environment' // switch from unfulfilled user facingMode or default to environment\n )\n );\n return { stream, facingMode };\n } catch (e) {}\n }\n\n throw 'Camera not found.';\n }\n\n private async _restartVideoStream(): Promise<void> {\n // Note that we always pause the stream and not only if !this._paused as even if this._paused === true, the\n // stream might still be running, as it's by default only stopped after a delay of 300ms.\n const wasPaused = this._paused;\n const paused = await this.pause(true);\n if (!paused || wasPaused || !this._active) return;\n await this.start();\n }\n\n private static _stopVideoStream(stream : MediaStream): void {\n for (const track of stream.getTracks()) {\n track.stop(); // note that this will also automatically turn the flashlight off\n stream.removeTrack(track);\n }\n }\n\n private _setVideoMirror(facingMode: QrScanner.FacingMode): void {\n // in user facing mode mirror the video to make it easier for the user to position the QR code\n const scaleFactor = facingMode === 'user'? -1 : 1;\n this.$video.style.transform = 'scaleX(' + scaleFactor + ')';\n }\n\n private _getFacingMode(videoStream: MediaStream): QrScanner.FacingMode | null {\n const videoTrack = videoStream.getVideoTracks()[0];\n if (!videoTrack) return null; // unknown\n // inspired by https://github.com/JodusNodus/react-qr-reader/blob/master/src/getDeviceId.js#L13\n return /rear|back|environment/i.test(videoTrack.label)\n ? 'environment'\n : /front|user|face/i.test(videoTrack.label)\n ? 'user'\n : null; // unknown\n }\n\n private static _drawToCanvas(\n image: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap\n | SVGImageElement,\n scanRegion?: QrScanner.ScanRegion | null,\n canvas?: HTMLCanvasElement | null,\n disallowCanvasResizing= false,\n ): [HTMLCanvasElement, CanvasRenderingContext2D] {\n canvas = canvas || document.createElement('canvas');\n const scanRegionX = scanRegion && scanRegion.x ? scanRegion.x : 0;\n const scanRegionY = scanRegion && scanRegion.y ? scanRegion.y : 0;\n const scanRegionWidth = scanRegion && scanRegion.width\n ? scanRegion.width\n : (image as HTMLVideoElement).videoWidth || image.width as number;\n const scanRegionHeight = scanRegion && scanRegion.height\n ? scanRegion.height\n : (image as HTMLVideoElement).videoHeight || image.height as number;\n\n if (!disallowCanvasResizing) {\n const canvasWidth = scanRegion && scanRegion.downScaledWidth\n ? scanRegion.downScaledWidth\n : scanRegionWidth;\n const canvasHeight = scanRegion && scanRegion.downScaledHeight\n ? scanRegion.downScaledHeight\n : scanRegionHeight;\n // Setting the canvas width or height clears the canvas, even if the values didn't change, therefore only\n // set them if they actually changed.\n if (canvas.width !== canvasWidth) {\n canvas.width = canvasWidth;\n }\n if (canvas.height !== canvasHeight) {\n canvas.height = canvasHeight;\n }\n }\n\n const context = canvas.getContext('2d', { alpha: false })!;\n context.imageSmoothingEnabled = false; // gives less blurry images\n context.drawImage(\n image,\n scanRegionX, scanRegionY, scanRegionWidth, scanRegionHeight,\n 0, 0, canvas.width, canvas.height,\n );\n return [canvas, context];\n }\n\n private static async _loadImage(\n imageOrFileOrBlobOrUrl: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap\n | SVGImageElement | File | Blob | URL | String,\n ): Promise<HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap\n | SVGImageElement > {\n if (imageOrFileOrBlobOrUrl instanceof Image) {\n await QrScanner._awaitImageLoad(imageOrFileOrBlobOrUrl);\n return imageOrFileOrBlobOrUrl;\n } else if (imageOrFileOrBlobOrUrl instanceof HTMLVideoElement\n || imageOrFileOrBlobOrUrl instanceof HTMLCanvasElement\n || imageOrFileOrBlobOrUrl instanceof SVGImageElement\n || 'OffscreenCanvas' in window && imageOrFileOrBlobOrUrl instanceof OffscreenCanvas\n || 'ImageBitmap' in window && imageOrFileOrBlobOrUrl instanceof ImageBitmap) {\n return imageOrFileOrBlobOrUrl;\n } else if (imageOrFileOrBlobOrUrl instanceof File || imageOrFileOrBlobOrUrl instanceof Blob\n || imageOrFileOrBlobOrUrl instanceof URL || typeof imageOrFileOrBlobOrUrl === 'string') {\n const image = new Image();\n if (imageOrFileOrBlobOrUrl instanceof File || imageOrFileOrBlobOrUrl instanceof Blob) {\n image.src = URL.createObjectURL(imageOrFileOrBlobOrUrl);\n } else {\n image.src = imageOrFileOrBlobOrUrl.toString();\n }\n try {\n await QrScanner._awaitImageLoad(image);\n return image;\n } finally {\n if (imageOrFileOrBlobOrUrl instanceof File || imageOrFileOrBlobOrUrl instanceof Blob) {\n URL.revokeObjectURL(image.src);\n }\n }\n } else {\n throw 'Unsupported image type.';\n }\n }\n\n private static async _awaitImageLoad(image: HTMLImageElement): Promise<void> {\n if (image.complete && image.naturalWidth !== 0) return; // already loaded\n await new Promise<void>((resolve, reject) => {\n const listener = (event: ErrorEvent | Event) => {\n image.removeEventListener('load', listener);\n image.removeEventListener('error', listener);\n if (event instanceof ErrorEvent) {\n reject('Image load error');\n } else {\n resolve();\n }\n };\n image.addEventListener('load', listener);\n image.addEventListener('error', listener);\n });\n }\n\n private static async _postWorkerMessage(\n qrEngineOrQrEnginePromise: Worker | BarcodeDetector | Promise<Worker | BarcodeDetector>,\n type: string,\n data?: any,\n transfer?: Transferable[],\n ): Promise<number> {\n return QrScanner._postWorkerMessageSync(await qrEngineOrQrEnginePromise, type, data, transfer);\n }\n\n // sync version of _postWorkerMessage without performance overhead of async functions\n private static _postWorkerMessageSync(\n qrEngine: Worker | BarcodeDetector,\n type: string,\n data?: any,\n transfer?: Transferable[],\n ): number {\n if (!(qrEngine instanceof Worker)) return -1;\n const id = QrScanner._workerMessageId++;\n qrEngine.postMessage({\n id,\n type,\n data,\n }, transfer);\n return id;\n }\n}\n\ndeclare namespace QrScanner {\n export interface ScanRegion {\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n downScaledWidth?: number;\n downScaledHeight?: number;\n }\n\n export type FacingMode = 'environment' | 'user';\n export type DeviceId = string;\n\n export interface Camera {\n id: DeviceId;\n label: string;\n }\n\n export type InversionMode = 'original' | 'invert' | 'both';\n\n export interface Point {\n x: number;\n y: number;\n }\n\n export interface ScanResult {\n data: string;\n // In clockwise order, starting at top left, but this might not be guaranteed in the future.\n cornerPoints: QrScanner.Point[];\n }\n}\n\n// simplified from https://wicg.github.io/shape-detection-api/#barcode-detection-api\ndeclare class BarcodeDetector {\n constructor(options?: { formats: string[] });\n static getSupportedFormats(): Promise<string[]>;\n detect(image: ImageBitmapSource): Promise<Array<{ rawValue: string, cornerPoints: QrScanner.Point[] }>>;\n}\n\n// simplified from https://github.com/lukewarlow/user-agent-data-types/blob/master/index.d.ts\ndeclare global {\n interface Navigator {\n readonly userAgentData?: {\n readonly platform: string;\n readonly brands: Array<{\n readonly brand: string;\n readonly version: string;\n }>;\n getHighEntropyValues(hints: string[]): Promise<{\n readonly architecture?: string;\n readonly platformVersion?: string;\n }>;\n };\n }\n}\n\nexport default QrScanner;\n", "'use strict';\n\nvar ms = {};\n\nfunction getItem (key) {\n return key in ms ? ms[key] : null;\n}\n\nfunction setItem (key, value) {\n ms[key] = value;\n return true;\n}\n\nfunction removeItem (key) {\n var found = key in ms;\n if (found) {\n return delete ms[key];\n }\n return false;\n}\n\nfunction clear () {\n ms = {};\n return true;\n}\n\nmodule.exports = {\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear\n};\n", "'use strict';\n\nfunction parse (rawValue) {\n const parsed = parseValue(rawValue);\n\n if (parsed === undefined) {\n return null;\n }\n\n return parsed;\n}\n\nfunction parseValue (rawValue) {\n try {\n return JSON.parse(rawValue);\n } catch (err) {\n return rawValue;\n }\n}\n\nmodule.exports = parse;\n", "'use strict';\n\nvar parse = require('./parse');\nvar listeners = {};\nvar listening = false;\n\nfunction listen () {\n if (global.addEventListener) {\n global.addEventListener('storage', change, false);\n } else if (global.attachEvent) {\n global.attachEvent('onstorage', change);\n } else {\n global.onstorage = change;\n }\n}\n\nfunction change (e) {\n if (!e) {\n e = global.event;\n }\n var all = listeners[e.key];\n if (all) {\n all.forEach(fire);\n }\n\n function fire (listener) {\n listener(parse(e.newValue), parse(e.oldValue), e.url || e.uri);\n }\n}\n\nfunction on (key, fn) {\n if (listeners[key]) {\n listeners[key].push(fn);\n } else {\n listeners[key] = [fn];\n }\n if (listening === false) {\n listen();\n }\n}\n\nfunction off (key, fn) {\n var ns = listeners[key];\n if (ns.length > 1) {\n ns.splice(ns.indexOf(fn), 1);\n } else {\n listeners[key] = [];\n }\n}\n\nmodule.exports = {\n on: on,\n off: off\n};\n", "'use strict';\n\nvar stub = require('./stub');\nvar parse = require('./parse');\nvar tracking = require('./tracking');\nvar ls = 'localStorage' in global && global.localStorage ? global.localStorage : stub;\n\nfunction accessor (key, value) {\n if (arguments.length === 1) {\n return get(key);\n }\n return set(key, value);\n}\n\nfunction get (key) {\n const raw = ls.getItem(key);\n const parsed = parse(raw);\n return parsed;\n}\n\nfunction set (key, value) {\n try {\n ls.setItem(key, JSON.stringify(value));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction remove (key) {\n return ls.removeItem(key);\n}\n\nfunction clear () {\n return ls.clear();\n}\n\nfunction backend (store) {\n store && (ls = store);\n\n return ls;\n}\n\naccessor.set = set;\naccessor.get = get;\naccessor.remove = remove;\naccessor.clear = clear;\naccessor.backend = backend;\naccessor.on = tracking.on;\naccessor.off = tracking.off;\n\nmodule.exports = accessor;\n", "// THIS FILE IS GENERATED - DO NOT EDIT!\n/*!mobile-detect v1.4.5 2021-03-13*/\n/*global module:false, define:false*/\n/*jshint latedef:false*/\n/*!@license Copyright 2013, Heinrich Goebl, License: MIT, see https://github.com/hgoebl/mobile-detect.js*/\n(function (define, undefined) {\ndefine(function () {\n 'use strict';\n\n var impl = {};\n\n impl.mobileDetectRules = {\n \"phones\": {\n \"iPhone\": \"\\\\biPhone\\\\b|\\\\biPod\\\\b\",\n \"BlackBerry\": \"BlackBerry|\\\\bBB10\\\\b|rim[0-9]+|\\\\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\\\\b-[0-9]+\",\n \"Pixel\": \"; \\\\bPixel\\\\b\",\n \"HTC\": \"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\\\bEVO\\\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel\",\n \"Nexus\": \"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 5X|Nexus 6\",\n \"Dell\": \"Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\\\b001DL\\\\b|\\\\b101DL\\\\b|\\\\bGS01\\\\b\",\n \"Motorola\": \"Motorola|DROIDX|DROID BIONIC|\\\\bDroid\\\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\\\bMoto E\\\\b|XT1068|XT1092|XT1052\",\n \"Samsung\": \"\\\\bSamsung\\\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F|SM-G610F|SM-G981B|SM-G892A|SM-A530F\",\n \"LG\": \"\\\\bLG\\\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710\",\n \"Sony\": \"SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533|SOV34|601SO|F8332\",\n \"Asus\": \"Asus.*Galaxy|PadFone.*Mobile\",\n \"Xiaomi\": \"^(?!.*\\\\bx11\\\\b).*xiaomi.*$|POCOPHONE F1|MI 8|Redmi Note 9S|Redmi Note 5A Prime|N2G47H|M2001J2G|M2001J2I|M1805E10A|M2004J11G|M1902F1G|M2002J9G|M2004J19G|M2003J6A1G\",\n \"NokiaLumia\": \"Lumia [0-9]{3,4}\",\n \"Micromax\": \"Micromax.*\\\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\\\b\",\n \"Palm\": \"PalmSource|Palm\",\n \"Vertu\": \"Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature\",\n \"Pantech\": \"PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790\",\n \"Fly\": \"IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250\",\n \"Wiko\": \"KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM\",\n \"iMobile\": \"i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)\",\n \"SimValley\": \"\\\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\\\b\",\n \"Wolfgang\": \"AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q\",\n \"Alcatel\": \"Alcatel\",\n \"Nintendo\": \"Nintendo (3DS|Switch)\",\n \"Amoi\": \"Amoi\",\n \"INQ\": \"INQ\",\n \"OnePlus\": \"ONEPLUS\",\n \"GenericPhone\": \"Tapatalk|PDA;|SAGEM|\\\\bmmp\\\\b|pocket|\\\\bpsp\\\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\\\bwap\\\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser\"\n },\n \"tablets\": {\n \"iPad\": \"iPad|iPad.*Mobile\",\n \"NexusTablet\": \"Android.*Nexus[\\\\s]+(7|9|10)\",\n \"GoogleTablet\": \"Android.*Pixel C\",\n \"SamsungTablet\": \"SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835|SM-T830|SM-T837V|SM-T720|SM-T510|SM-T387V|SM-P610|SM-T290|SM-T515|SM-T590|SM-T595|SM-T725|SM-T817P|SM-P585N0|SM-T395|SM-T295|SM-T865|SM-P610N|SM-P615|SM-T970|SM-T380|SM-T5950|SM-T905|SM-T231|SM-T500|SM-T860\",\n \"Kindle\": \"Kindle|Silk.*Accelerated|Android.*\\\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\\\b|Android.*Silk\\/[0-9.]+ like Chrome\\/[0-9.]+ (?!Mobile)\",\n \"SurfaceTablet\": \"Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)\",\n \"HPTablet\": \"HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10\",\n \"AsusTablet\": \"^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\\\bK00F\\\\b|\\\\bK00C\\\\b|\\\\bK00E\\\\b|\\\\bK00L\\\\b|TX201LA|ME176C|ME102A|\\\\bM80TA\\\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\\\bME70C\\\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\\\bP027\\\\b|\\\\bP024\\\\b|\\\\bP00C\\\\b\",\n \"BlackBerryTablet\": \"PlayBook|RIM Tablet\",\n \"HTCtablet\": \"HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410\",\n \"MotorolaTablet\": \"xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617\",\n \"NookTablet\": \"Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2\",\n \"AcerTablet\": \"Android.*; \\\\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\\\b|W3-810|\\\\bA3-A10\\\\b|\\\\bA3-A11\\\\b|\\\\bA3-A20\\\\b|\\\\bA3-A30|A3-A40\",\n \"ToshibaTablet\": \"Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO\",\n \"LGTablet\": \"\\\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\\\b\",\n \"FujitsuTablet\": \"Android.*\\\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\\\b\",\n \"PrestigioTablet\": \"PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002\",\n \"LenovoTablet\": \"Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304X|TB-X304F|TB-X304L|TB-X505F|TB-X505L|TB-X505X|TB-X605F|TB-X605L|TB-8703F|TB-8703X|TB-8703N|TB-8704N|TB-8704F|TB-8704X|TB-8704V|TB-7304F|TB-7304I|TB-7304X|Tab2A7-10F|Tab2A7-20F|TB2-X30L|YT3-X50L|YT3-X50F|YT3-X50M|YT-X705F|YT-X703F|YT-X703L|YT-X705L|YT-X705X|TB2-X30F|TB2-X30L|TB2-X30M|A2107A-F|A2107A-H|TB3-730F|TB3-730M|TB3-730X|TB-7504F|TB-7504X|TB-X704F|TB-X104F|TB3-X70F|TB-X705F|TB-8504F|TB3-X70L|TB3-710F|TB-X704L\",\n \"DellTablet\": \"Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7\",\n \"YarvikTablet\": \"Android.*\\\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\\\b\",\n \"MedionTablet\": \"Android.*\\\\bOYO\\\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB\",\n \"ArnovaTablet\": \"97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2\",\n \"IntensoTablet\": \"INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004\",\n \"IRUTablet\": \"M702pro\",\n \"MegafonTablet\": \"MegaFon V9|\\\\bZTE V9\\\\b|Android.*\\\\bMT7A\\\\b\",\n \"EbodaTablet\": \"E-Boda (Supreme|Impresspeed|Izzycomm|Essential)\",\n \"AllViewTablet\": \"Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)\",\n \"ArchosTablet\": \"\\\\b(101G9|80G9|A101IT)\\\\b|Qilive 97R|Archos5|\\\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\\\b\",\n \"AinolTablet\": \"NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark\",\n \"NokiaLumiaTablet\": \"Lumia 2520\",\n \"SonyTablet\": \"Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|SGP612|SGP712\",\n \"PhilipsTablet\": \"\\\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\\\b\",\n \"CubeTablet\": \"Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT\",\n \"CobyTablet\": \"MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010\",\n \"MIDTablet\": \"M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10\",\n \"MSITablet\": \"MSI \\\\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\\\b\",\n \"SMiTTablet\": \"Android.*(\\\\bMID\\\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)\",\n \"RockChipTablet\": \"Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A\",\n \"FlyTablet\": \"IQ310|Fly Vision\",\n \"bqTablet\": \"Android.*(bq)?.*\\\\b(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))\\\\b|Maxwell.*Lite|Maxwell.*Plus\",\n \"HuaweiTablet\": \"MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09|AGS-L09|CMR-AL19\",\n \"NecTablet\": \"\\\\bN-06D|\\\\bN-08D\",\n \"PantechTablet\": \"Pantech.*P4100\",\n \"BronchoTablet\": \"Broncho.*(N701|N708|N802|a710)\",\n \"VersusTablet\": \"TOUCHPAD.*[78910]|\\\\bTOUCHTAB\\\\b\",\n \"ZyncTablet\": \"z1000|Z99 2G|z930|z990|z909|Z919|z900\",\n \"PositivoTablet\": \"TB07STA|TB10STA|TB07FTA|TB10FTA\",\n \"NabiTablet\": \"Android.*\\\\bNabi\",\n \"KoboTablet\": \"Kobo Touch|\\\\bK080\\\\b|\\\\bVox\\\\b Build|\\\\bArc\\\\b Build\",\n \"DanewTablet\": \"DSlide.*\\\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\\\b\",\n \"TexetTablet\": \"NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE\",\n \"PlaystationTablet\": \"Playstation.*(Portable|Vita)\",\n \"TrekstorTablet\": \"ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab\",\n \"PyleAudioTablet\": \"\\\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\\\b\",\n \"AdvanTablet\": \"Android.* \\\\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\\\b \",\n \"DanyTechTablet\": \"Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1\",\n \"GalapadTablet\": \"Android [0-9.]+; [a-z-]+; \\\\bG1\\\\b\",\n \"MicromaxTablet\": \"Funbook|Micromax.*\\\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\\\b\",\n \"KarbonnTablet\": \"Android.*\\\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\\\b\",\n \"AllFineTablet\": \"Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide\",\n \"PROSCANTablet\": \"\\\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\\\b\",\n \"YONESTablet\": \"BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026\",\n \"ChangJiaTablet\": \"TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503\",\n \"GUTablet\": \"TX-A1301|TX-M9002|Q702|kf026\",\n \"PointOfViewTablet\": \"TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10\",\n \"OvermaxTablet\": \"OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027\",\n \"HCLTablet\": \"HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync\",\n \"DPSTablet\": \"DPS Dream 9|DPS Dual 7\",\n \"VistureTablet\": \"V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10\",\n \"CrestaTablet\": \"CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989\",\n \"MediatekTablet\": \"\\\\bMT8125|MT8389|MT8135|MT8377\\\\b\",\n \"ConcordeTablet\": \"Concorde([ ]+)?Tab|ConCorde ReadMan\",\n \"GoCleverTablet\": \"GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042\",\n \"ModecomTablet\": \"FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003\",\n \"VoninoTablet\": \"\\\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\\\bQ8\\\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\\\b\",\n \"ECSTablet\": \"V07OT2|TM105A|S10OT1|TR10CS1\",\n \"StorexTablet\": \"eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab\",\n \"VodafoneTablet\": \"SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497|VFD 1400\",\n \"EssentielBTablet\": \"Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2\",\n \"RossMoorTablet\": \"RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711\",\n \"iMobileTablet\": \"i-mobile i-note\",\n \"TolinoTablet\": \"tolino tab [0-9.]+|tolino shine\",\n \"AudioSonicTablet\": \"\\\\bC-22Q|T7-QC|T-17B|T-17P\\\\b\",\n \"AMPETablet\": \"Android.* A78 \",\n \"SkkTablet\": \"Android.* (SKYPAD|PHOENIX|CYCLOPS)\",\n \"TecnoTablet\": \"TECNO P9|TECNO DP8D\",\n \"JXDTablet\": \"Android.* \\\\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\\\b\",\n \"iJoyTablet\": \"Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)\",\n \"FX2Tablet\": \"FX2 PAD7|FX2 PAD10\",\n \"XoroTablet\": \"KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151\",\n \"ViewsonicTablet\": \"ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a\",\n \"VerizonTablet\": \"QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1\",\n \"OdysTablet\": \"LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\\\bXELIO\\\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10\",\n \"CaptivaTablet\": \"CAPTIVA PAD\",\n \"IconbitTablet\": \"NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S\",\n \"TeclastTablet\": \"T98 4G|\\\\bP80\\\\b|\\\\bX90HD\\\\b|X98 Air|X98 Air 3G|\\\\bX89\\\\b|P80 3G|\\\\bX80h\\\\b|P98 Air|\\\\bX89HD\\\\b|P98 3G|\\\\bP90HD\\\\b|P89 3G|X98 3G|\\\\bP70h\\\\b|P79HD 3G|G18d 3G|\\\\bP79HD\\\\b|\\\\bP89s\\\\b|\\\\bA88\\\\b|\\\\bP10HD\\\\b|\\\\bP19HD\\\\b|G18 3G|\\\\bP78HD\\\\b|\\\\bA78\\\\b|\\\\bP75\\\\b|G17s 3G|G17h 3G|\\\\bP85t\\\\b|\\\\bP90\\\\b|\\\\bP11\\\\b|\\\\bP98t\\\\b|\\\\bP98HD\\\\b|\\\\bG18d\\\\b|\\\\bP85s\\\\b|\\\\bP11HD\\\\b|\\\\bP88s\\\\b|\\\\bA80HD\\\\b|\\\\bA80se\\\\b|\\\\bA10h\\\\b|\\\\bP89\\\\b|\\\\bP78s\\\\b|\\\\bG18\\\\b|\\\\bP85\\\\b|\\\\bA70h\\\\b|\\\\bA70\\\\b|\\\\bG17\\\\b|\\\\bP18\\\\b|\\\\bA80s\\\\b|\\\\bA11s\\\\b|\\\\bP88HD\\\\b|\\\\bA80h\\\\b|\\\\bP76s\\\\b|\\\\bP76h\\\\b|\\\\bP98\\\\b|\\\\bA10HD\\\\b|\\\\bP78\\\\b|\\\\bP88\\\\b|\\\\bA11\\\\b|\\\\bA10t\\\\b|\\\\bP76a\\\\b|\\\\bP76t\\\\b|\\\\bP76e\\\\b|\\\\bP85HD\\\\b|\\\\bP85a\\\\b|\\\\bP86\\\\b|\\\\bP75HD\\\\b|\\\\bP76v\\\\b|\\\\bA12\\\\b|\\\\bP75a\\\\b|\\\\bA15\\\\b|\\\\bP76Ti\\\\b|\\\\bP81HD\\\\b|\\\\bA10\\\\b|\\\\bT760VE\\\\b|\\\\bT720HD\\\\b|\\\\bP76\\\\b|\\\\bP73\\\\b|\\\\bP71\\\\b|\\\\bP72\\\\b|\\\\bT720SE\\\\b|\\\\bC520Ti\\\\b|\\\\bT760\\\\b|\\\\bT720VE\\\\b|T720-3GE|T720-WiFi\",\n \"OndaTablet\": \"\\\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\\\b[\\\\s]+|V10 \\\\b4G\\\\b\",\n \"JaytechTablet\": \"TPC-PA762\",\n \"BlaupunktTablet\": \"Endeavour 800NG|Endeavour 1010\",\n \"DigmaTablet\": \"\\\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\\\b\",\n \"EvolioTablet\": \"ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\\\bEvotab\\\\b|\\\\bNeura\\\\b\",\n \"LavaTablet\": \"QPAD E704|\\\\bIvoryS\\\\b|E-TAB IVORY|\\\\bE-TAB\\\\b\",\n \"AocTablet\": \"MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712\",\n \"MpmanTablet\": \"MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\\\bMPG7\\\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010\",\n \"CelkonTablet\": \"CT695|CT888|CT[\\\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\\\bCT-1\\\\b\",\n \"WolderTablet\": \"miTab \\\\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\\\b\",\n \"MediacomTablet\": \"M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA\",\n \"MiTablet\": \"\\\\bMI PAD\\\\b|\\\\bHM NOTE 1W\\\\b\",\n \"NibiruTablet\": \"Nibiru M1|Nibiru Jupiter One\",\n \"NexoTablet\": \"NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI\",\n \"LeaderTablet\": \"TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100\",\n \"UbislateTablet\": \"UbiSlate[\\\\s]?7C\",\n \"PocketBookTablet\": \"Pocketbook\",\n \"KocasoTablet\": \"\\\\b(TB-1207)\\\\b\",\n \"HisenseTablet\": \"\\\\b(F5281|E2371)\\\\b\",\n \"Hudl\": \"Hudl HT7S3|Hudl 2\",\n \"TelstraTablet\": \"T-Hub2\",\n \"GenericTablet\": \"Android.*\\\\b97D\\\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\\\bA7EB\\\\b|CatNova8|A1_07|CT704|CT1002|\\\\bM721\\\\b|rk30sdk|\\\\bEVOTAB\\\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\\\bM6pro\\\\b|CT1020W|arc 10HD|\\\\bTP750\\\\b|\\\\bQTAQZ3\\\\b|WVT101|TM1088|KT107\"\n },\n \"oss\": {\n \"AndroidOS\": \"Android\",\n \"BlackBerryOS\": \"blackberry|\\\\bBB10\\\\b|rim tablet os\",\n \"PalmOS\": \"PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino\",\n \"SymbianOS\": \"Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\\\bS60\\\\b\",\n \"WindowsMobileOS\": \"Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Windows Mobile|Windows Phone [0-9.]+|WCE;\",\n \"WindowsPhoneOS\": \"Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;\",\n \"iOS\": \"\\\\biPhone.*Mobile|\\\\biPod|\\\\biPad|AppleCoreMedia\",\n \"iPadOS\": \"CPU OS 13\",\n \"SailfishOS\": \"Sailfish\",\n \"MeeGoOS\": \"MeeGo\",\n \"MaemoOS\": \"Maemo\",\n \"JavaOS\": \"J2ME\\/|\\\\bMIDP\\\\b|\\\\bCLDC\\\\b\",\n \"webOS\": \"webOS|hpwOS\",\n \"badaOS\": \"\\\\bBada\\\\b\",\n \"BREWOS\": \"BREW\"\n },\n \"uas\": {\n \"Chrome\": \"\\\\bCrMo\\\\b|CriOS|Android.*Chrome\\/[.0-9]* (Mobile)?\",\n \"Dolfin\": \"\\\\bDolfin\\\\b\",\n \"Opera\": \"Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\\/[0-9.]+$|Coast\\/[0-9.]+\",\n \"Skyfire\": \"Skyfire\",\n \"Edge\": \"\\\\bEdgiOS\\\\b|Mobile Safari\\/[.0-9]* Edge\",\n \"IE\": \"IEMobile|MSIEMobile\",\n \"Firefox\": \"fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS\",\n \"Bolt\": \"bolt\",\n \"TeaShark\": \"teashark\",\n \"Blazer\": \"Blazer\",\n \"Safari\": \"Version((?!\\\\bEdgiOS\\\\b).)*Mobile.*Safari|Safari.*Mobile|MobileSafari\",\n \"WeChat\": \"\\\\bMicroMessenger\\\\b\",\n \"UCBrowser\": \"UC.*Browser|UCWEB\",\n \"baiduboxapp\": \"baiduboxapp\",\n \"baidubrowser\": \"baidubrowser\",\n \"DiigoBrowser\": \"DiigoBrowser\",\n \"Mercury\": \"\\\\bMercury\\\\b\",\n \"ObigoBrowser\": \"Obigo\",\n \"NetFront\": \"NF-Browser\",\n \"GenericBrowser\": \"NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger\",\n \"PaleMoon\": \"Android.*PaleMoon|Mobile.*PaleMoon\"\n },\n \"props\": {\n \"Mobile\": \"Mobile\\/[VER]\",\n \"Build\": \"Build\\/[VER]\",\n \"Version\": \"Version\\/[VER]\",\n \"VendorID\": \"VendorID\\/[VER]\",\n \"iPad\": \"iPad.*CPU[a-z ]+[VER]\",\n \"iPhone\": \"iPhone.*CPU[a-z ]+[VER]\",\n \"iPod\": \"iPod.*CPU[a-z ]+[VER]\",\n \"Kindle\": \"Kindle\\/[VER]\",\n \"Chrome\": [\n \"Chrome\\/[VER]\",\n \"CriOS\\/[VER]\",\n \"CrMo\\/[VER]\"\n ],\n \"Coast\": [\n \"Coast\\/[VER]\"\n ],\n \"Dolfin\": \"Dolfin\\/[VER]\",\n \"Firefox\": [\n \"Firefox\\/[VER]\",\n \"FxiOS\\/[VER]\"\n ],\n \"Fennec\": \"Fennec\\/[VER]\",\n \"Edge\": \"Edge\\/[VER]\",\n \"IE\": [\n \"IEMobile\\/[VER];\",\n \"IEMobile [VER]\",\n \"MSIE [VER];\",\n \"Trident\\/[0-9.]+;.*rv:[VER]\"\n ],\n \"NetFront\": \"NetFront\\/[VER]\",\n \"NokiaBrowser\": \"NokiaBrowser\\/[VER]\",\n \"Opera\": [\n \" OPR\\/[VER]\",\n \"Opera Mini\\/[VER]\",\n \"Version\\/[VER]\"\n ],\n \"Opera Mini\": \"Opera Mini\\/[VER]\",\n \"Opera Mobi\": \"Version\\/[VER]\",\n \"UCBrowser\": [\n \"UCWEB[VER]\",\n \"UC.*Browser\\/[VER]\"\n ],\n \"MQQBrowser\": \"MQQBrowser\\/[VER]\",\n \"MicroMessenger\": \"MicroMessenger\\/[VER]\",\n \"baiduboxapp\": \"baiduboxapp\\/[VER]\",\n \"baidubrowser\": \"baidubrowser\\/[VER]\",\n \"SamsungBrowser\": \"SamsungBrowser\\/[VER]\",\n \"Iron\": \"Iron\\/[VER]\",\n \"Safari\": [\n \"Version\\/[VER]\",\n \"Safari\\/[VER]\"\n ],\n \"Skyfire\": \"Skyfire\\/[VER]\",\n \"Tizen\": \"Tizen\\/[VER]\",\n \"Webkit\": \"webkit[ \\/][VER]\",\n \"PaleMoon\": \"PaleMoon\\/[VER]\",\n \"SailfishBrowser\": \"SailfishBrowser\\/[VER]\",\n \"Gecko\": \"Gecko\\/[VER]\",\n \"Trident\": \"Trident\\/[VER]\",\n \"Presto\": \"Presto\\/[VER]\",\n \"Goanna\": \"Goanna\\/[VER]\",\n \"iOS\": \" \\\\bi?OS\\\\b [VER][ ;]{1}\",\n \"Android\": \"Android [VER]\",\n \"Sailfish\": \"Sailfish [VER]\",\n \"BlackBerry\": [\n \"BlackBerry[\\\\w]+\\/[VER]\",\n \"BlackBerry.*Version\\/[VER]\",\n \"Version\\/[VER]\"\n ],\n \"BREW\": \"BREW [VER]\",\n \"Java\": \"Java\\/[VER]\",\n \"Windows Phone OS\": [\n \"Windows Phone OS [VER]\",\n \"Windows Phone [VER]\"\n ],\n \"Windows Phone\": \"Windows Phone [VER]\",\n \"Windows CE\": \"Windows CE\\/[VER]\",\n \"Windows NT\": \"Windows NT [VER]\",\n \"Symbian\": [\n \"SymbianOS\\/[VER]\",\n \"Symbian\\/[VER]\"\n ],\n \"webOS\": [\n \"webOS\\/[VER]\",\n \"hpwOS\\/[VER];\"\n ]\n },\n \"utils\": {\n \"Bot\": \"Googlebot|facebookexternalhit|Google-AMPHTML|s~amp-validator|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom|contentkingapp|AspiegelBot\",\n \"MobileBot\": \"Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\\/M1A1-R2D2\",\n \"DesktopMode\": \"WPDesktop\",\n \"TV\": \"SonyDTV|HbbTV\",\n \"WebKit\": \"(webkit)[ \\/]([\\\\w.]+)\",\n \"Console\": \"\\\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|Nintendo Switch|PLAYSTATION|Xbox)\\\\b\",\n \"Watch\": \"SM-V700\"\n }\n};\n\n // following patterns come from http://detectmobilebrowsers.com/\n impl.detectMobileBrowsers = {\n fullPattern: /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,\n shortPattern: /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i,\n tabletPattern: /android|ipad|playbook|silk/i\n };\n\n var hasOwnProp = Object.prototype.hasOwnProperty,\n isArray;\n\n impl.FALLBACK_PHONE = 'UnknownPhone';\n impl.FALLBACK_TABLET = 'UnknownTablet';\n impl.FALLBACK_MOBILE = 'UnknownMobile';\n\n isArray = ('isArray' in Array) ?\n Array.isArray : function (value) { return Object.prototype.toString.call(value) === '[object Array]'; };\n\n function equalIC(a, b) {\n return a != null && b != null && a.toLowerCase() === b.toLowerCase();\n }\n\n function containsIC(array, value) {\n var valueLC, i, len = array.length;\n if (!len || !value) {\n return false;\n }\n valueLC = value.toLowerCase();\n for (i = 0; i < len; ++i) {\n if (valueLC === array[i].toLowerCase()) {\n return true;\n }\n }\n return false;\n }\n\n function convertPropsToRegExp(object) {\n for (var key in object) {\n if (hasOwnProp.call(object, key)) {\n object[key] = new RegExp(object[key], 'i');\n }\n }\n }\n\n function prepareUserAgent(userAgent) {\n return (userAgent || '').substr(0, 500); // mitigate vulnerable to ReDoS\n }\n\n (function init() {\n var key, values, value, i, len, verPos, mobileDetectRules = impl.mobileDetectRules;\n for (key in mobileDetectRules.props) {\n if (hasOwnProp.call(mobileDetectRules.props, key)) {\n values = mobileDetectRules.props[key];\n if (!isArray(values)) {\n values = [values];\n }\n len = values.length;\n for (i = 0; i < len; ++i) {\n value = values[i];\n verPos = value.indexOf('[VER]');\n if (verPos >= 0) {\n value = value.substring(0, verPos) + '([\\\\w._\\\\+]+)' + value.substring(verPos + 5);\n }\n values[i] = new RegExp(value, 'i');\n }\n mobileDetectRules.props[key] = values;\n }\n }\n convertPropsToRegExp(mobileDetectRules.oss);\n convertPropsToRegExp(mobileDetectRules.phones);\n convertPropsToRegExp(mobileDetectRules.tablets);\n convertPropsToRegExp(mobileDetectRules.uas);\n convertPropsToRegExp(mobileDetectRules.utils);\n\n // copy some patterns to oss0 which are tested first (see issue#15)\n mobileDetectRules.oss0 = {\n WindowsPhoneOS: mobileDetectRules.oss.WindowsPhoneOS,\n WindowsMobileOS: mobileDetectRules.oss.WindowsMobileOS\n };\n }());\n\n /**\n * Test userAgent string against a set of rules and find the first matched key.\n * @param {Object} rules (key is String, value is RegExp)\n * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent').\n * @returns {String|null} the matched key if found, otherwise <tt>null</tt>\n * @private\n */\n impl.findMatch = function(rules, userAgent) {\n for (var key in rules) {\n if (hasOwnProp.call(rules, key)) {\n if (rules[key].test(userAgent)) {\n return key;\n }\n }\n }\n return null;\n };\n\n /**\n * Test userAgent string against a set of rules and return an array of matched keys.\n * @param {Object} rules (key is String, value is RegExp)\n * @param {String} userAgent the navigator.userAgent (or HTTP-Header 'User-Agent').\n * @returns {Array} an array of matched keys, may be empty when there is no match, but not <tt>null</tt>\n * @private\n */\n impl.findMatches = function(rules, userAgent) {\n var result = [];\n for (var key in rules) {\n if (hasOwnProp.call(rules, key)) {\n if (rules[key].test(userAgent)) {\n result.push(key);\n }\n }\n }\n return result;\n };\n\n /**\n * Check the version of the given property in the User-Agent.\n *\n * @param {String} propertyName\n * @param {String} userAgent\n * @return {String} version or <tt>null</tt> if version not found\n * @private\n */\n impl.getVersionStr = function (propertyName, userAgent) {\n var props = impl.mobileDetectRules.props, patterns, i, len, match;\n if (hasOwnProp.call(props, propertyName)) {\n patterns = props[propertyName];\n len = patterns.length;\n for (i = 0; i < len; ++i) {\n match = patterns[i].exec(userAgent);\n if (match !== null) {\n return match[1];\n }\n }\n }\n return null;\n };\n\n /**\n * Check the version of the given property in the User-Agent.\n * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)\n *\n * @param {String} propertyName\n * @param {String} userAgent\n * @return {Number} version or <tt>NaN</tt> if version not found\n * @private\n */\n impl.getVersion = function (propertyName, userAgent) {\n var version = impl.getVersionStr(propertyName, userAgent);\n return version ? impl.prepareVersionNo(version) : NaN;\n };\n\n /**\n * Prepare the version number.\n *\n * @param {String} version\n * @return {Number} the version number as a floating number\n * @private\n */\n impl.prepareVersionNo = function (version) {\n var numbers;\n\n numbers = version.split(/[a-z._ \\/\\-]/i);\n if (numbers.length === 1) {\n version = numbers[0];\n }\n if (numbers.length > 1) {\n version = numbers[0] + '.';\n numbers.shift();\n version += numbers.join('');\n }\n return Number(version);\n };\n\n impl.isMobileFallback = function (userAgent) {\n return impl.detectMobileBrowsers.fullPattern.test(userAgent) ||\n impl.detectMobileBrowsers.shortPattern.test(userAgent.substr(0,4));\n };\n\n impl.isTabletFallback = function (userAgent) {\n return impl.detectMobileBrowsers.tabletPattern.test(userAgent);\n };\n\n impl.prepareDetectionCache = function (cache, userAgent, maxPhoneWidth) {\n if (cache.mobile !== undefined) {\n return;\n }\n var phone, tablet, phoneSized;\n\n // first check for stronger tablet rules, then phone (see issue#5)\n tablet = impl.findMatch(impl.mobileDetectRules.tablets, userAgent);\n if (tablet) {\n cache.mobile = cache.tablet = tablet;\n cache.phone = null;\n return; // unambiguously identified as tablet\n }\n\n phone = impl.findMatch(impl.mobileDetectRules.phones, userAgent);\n if (phone) {\n cache.mobile = cache.phone = phone;\n cache.tablet = null;\n return; // unambiguously identified as phone\n }\n\n // our rules haven't found a match -> try more general fallback rules\n if (impl.isMobileFallback(userAgent)) {\n phoneSized = MobileDetect.isPhoneSized(maxPhoneWidth);\n if (phoneSized === undefined) {\n cache.mobile = impl.FALLBACK_MOBILE;\n cache.tablet = cache.phone = null;\n } else if (phoneSized) {\n cache.mobile = cache.phone = impl.FALLBACK_PHONE;\n cache.tablet = null;\n } else {\n cache.mobile = cache.tablet = impl.FALLBACK_TABLET;\n cache.phone = null;\n }\n } else if (impl.isTabletFallback(userAgent)) {\n cache.mobile = cache.tablet = impl.FALLBACK_TABLET;\n cache.phone = null;\n } else {\n // not mobile at all!\n cache.mobile = cache.tablet = cache.phone = null;\n }\n };\n\n // t is a reference to a MobileDetect instance\n impl.mobileGrade = function (t) {\n // impl note:\n // To keep in sync w/ Mobile_Detect.php easily, the following code is tightly aligned to the PHP version.\n // When changes are made in Mobile_Detect.php, copy this method and replace:\n // $this-> / t.\n // self::MOBILE_GRADE_(.) / '$1'\n // , self::VERSION_TYPE_FLOAT / (nothing)\n // isIOS() / os('iOS')\n // [reg] / (nothing) <-- jsdelivr complaining about unescaped unicode character U+00AE\n var $isMobile = t.mobile() !== null;\n\n if (\n // Apple iOS 3.2-5.1 - Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3), iPad 3 (5.1), original iPhone (3.1), iPhone 3 (3.2), 3GS (4.3), 4 (4.3 / 5.0), and 4S (5.1)\n t.os('iOS') && t.version('iPad')>=4.3 ||\n t.os('iOS') && t.version('iPhone')>=3.1 ||\n t.os('iOS') && t.version('iPod')>=3.1 ||\n\n // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5)\n // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM\n // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices\n // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7\n ( t.version('Android')>2.1 && t.is('Webkit') ) ||\n\n // Windows Phone 7-7.5 - Tested on the HTC Surround (7.0) HTC Trophy (7.5), LG-E900 (7.5), Nokia Lumia 800\n t.version('Windows Phone OS')>=7.0 ||\n\n // Blackberry 7 - Tested on BlackBerry Torch 9810\n // Blackberry 6.0 - Tested on the Torch 9800 and Style 9670\n t.is('BlackBerry') && t.version('BlackBerry')>=6.0 ||\n // Blackberry Playbook (1.0-2.0) - Tested on PlayBook\n t.match('Playbook.*Tablet') ||\n\n // Palm WebOS (1.4-2.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0)\n ( t.version('webOS')>=1.4 && t.match('Palm|Pre|Pixi') ) ||\n // Palm WebOS 3.0 - Tested on HP TouchPad\n t.match('hp.*TouchPad') ||\n\n // Firefox Mobile (12 Beta) - Tested on Android 2.3 device\n ( t.is('Firefox') && t.version('Firefox')>=12 ) ||\n\n // Chrome for Android - Tested on Android 4.0, 4.1 device\n ( t.is('Chrome') && t.is('AndroidOS') && t.version('Android')>=4.0 ) ||\n\n // Skyfire 4.1 - Tested on Android 2.3 device\n ( t.is('Skyfire') && t.version('Skyfire')>=4.1 && t.is('AndroidOS') && t.version('Android')>=2.3 ) ||\n\n // Opera Mobile 11.5-12: Tested on Android 2.3\n ( t.is('Opera') && t.version('Opera Mobi')>11 && t.is('AndroidOS') ) ||\n\n // Meego 1.2 - Tested on Nokia 950 and N9\n t.is('MeeGoOS') ||\n\n // Tizen (pre-release) - Tested on early hardware\n t.is('Tizen') ||\n\n // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser\n // @todo: more tests here!\n t.is('Dolfin') && t.version('Bada')>=2.0 ||\n\n // UC Browser - Tested on Android 2.3 device\n ( (t.is('UC Browser') || t.is('Dolfin')) && t.version('Android')>=2.3 ) ||\n\n // Kindle 3 and Fire - Tested on the built-in WebKit browser for each\n ( t.match('Kindle Fire') ||\n t.is('Kindle') && t.version('Kindle')>=3.0 ) ||\n\n // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet\n t.is('AndroidOS') && t.is('NookTablet') ||\n\n // Chrome Desktop 11-21 - Tested on OS X 10.7 and Windows 7\n t.version('Chrome')>=11 && !$isMobile ||\n\n // Safari Desktop 4-5 - Tested on OS X 10.7 and Windows 7\n t.version('Safari')>=5.0 && !$isMobile ||\n\n // Firefox Desktop 4-13 - Tested on OS X 10.7 and Windows 7\n t.version('Firefox')>=4.0 && !$isMobile ||\n\n // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7\n t.version('MSIE')>=7.0 && !$isMobile ||\n\n // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7\n // @reference: http://my.opera.com/community/openweb/idopera/\n t.version('Opera')>=10 && !$isMobile\n\n ){\n return 'A';\n }\n\n if (\n t.os('iOS') && t.version('iPad')<4.3 ||\n t.os('iOS') && t.version('iPhone')<3.1 ||\n t.os('iOS') && t.version('iPod')<3.1 ||\n\n // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770\n t.is('Blackberry') && t.version('BlackBerry')>=5 && t.version('BlackBerry')<6 ||\n\n //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3\n ( t.version('Opera Mini')>=5.0 && t.version('Opera Mini')<=6.5 &&\n (t.version('Android')>=2.3 || t.is('iOS')) ) ||\n\n // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1)\n t.match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') ||\n\n // @todo: report this (tested on Nokia N71)\n t.version('Opera Mobi')>=11 && t.is('SymbianOS')\n ){\n return 'B';\n }\n\n if (\n // Blackberry 4.x - Tested on the Curve 8330\n t.version('BlackBerry')<5.0 ||\n // Windows Mobile - Tested on the HTC Leo (WinMo 5.2)\n t.match('MSIEMobile|Windows CE.*Mobile') || t.version('Windows Mobile')<=5.2\n\n ){\n return 'C';\n }\n\n //All older smartphone platforms and featurephones - Any device that doesn't support media queries\n //will receive the basic, C grade experience.\n return 'C';\n };\n\n impl.detectOS = function (ua) {\n return impl.findMatch(impl.mobileDetectRules.oss0, ua) ||\n impl.findMatch(impl.mobileDetectRules.oss, ua);\n };\n\n impl.getDeviceSmallerSide = function () {\n return window.screen.width < window.screen.height ?\n window.screen.width :\n window.screen.height;\n };\n\n /**\n * Constructor for MobileDetect object.\n * <br>\n * Such an object will keep a reference to the given user-agent string and cache most of the detect queries.<br>\n * <div style=\"background-color: #d9edf7; border: 1px solid #bce8f1; color: #3a87ad; padding: 14px; border-radius: 2px; margin-top: 20px\">\n * <strong>Find information how to download and install:</strong>\n * <a href=\"https://github.com/hgoebl/mobile-detect.js/\">github.com/hgoebl/mobile-detect.js/</a>\n * </div>\n *\n * @example <pre>\n * var md = new MobileDetect(window.navigator.userAgent);\n * if (md.mobile()) {\n * location.href = (md.mobileGrade() === 'A') ? '/mobile/' : '/lynx/';\n * }\n * </pre>\n *\n * @param {string} userAgent typically taken from window.navigator.userAgent or http_header['User-Agent']\n * @param {number} [maxPhoneWidth=600] <strong>only for browsers</strong> specify a value for the maximum\n * width of smallest device side (in logical \"CSS\" pixels) until a device detected as mobile will be handled\n * as phone.\n * This is only used in cases where the device cannot be classified as phone or tablet.<br>\n * See <a href=\"http://developer.android.com/guide/practices/screens_support.html\">Declaring Tablet Layouts\n * for Android</a>.<br>\n * If you provide a value < 0, then this \"fuzzy\" check is disabled.\n * @constructor\n * @global\n */\n function MobileDetect(userAgent, maxPhoneWidth) {\n this.ua = prepareUserAgent(userAgent);\n this._cache = {};\n //600dp is typical 7\" tablet minimum width\n this.maxPhoneWidth = maxPhoneWidth || 600;\n }\n\n MobileDetect.prototype = {\n constructor: MobileDetect,\n\n /**\n * Returns the detected phone or tablet type or <tt>null</tt> if it is not a mobile device.\n * <br>\n * For a list of possible return values see {@link MobileDetect#phone} and {@link MobileDetect#tablet}.<br>\n * <br>\n * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against\n * the patterns of <a href=\"http://detectmobilebrowsers.com/\">detectmobilebrowsers.com</a>. If this test\n * is positive, a value of <code>UnknownPhone</code>, <code>UnknownTablet</code> or\n * <code>UnknownMobile</code> is returned.<br>\n * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br>\n * <br>\n * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code>\n * and <code>UnknownMobile</code>, so you will get <code>UnknownMobile</code> here.<br>\n * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for:\n * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}.\n * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use.\n * <br>\n * In most cases you will use the return value just as a boolean.\n *\n * @returns {String} the key for the phone family or tablet family, e.g. \"Nexus\".\n * @function MobileDetect#mobile\n */\n mobile: function () {\n impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);\n return this._cache.mobile;\n },\n\n /**\n * Returns the detected phone type/family string or <tt>null</tt>.\n * <br>\n * The returned tablet (family or producer) is one of following keys:<br>\n * <br><tt>iPhone, BlackBerry, Pixel, HTC, Nexus, Dell, Motorola, Samsung, LG, Sony, Asus,\n * Xiaomi, NokiaLumia, Micromax, Palm, Vertu, Pantech, Fly, Wiko, iMobile,\n * SimValley, Wolfgang, Alcatel, Nintendo, Amoi, INQ, OnePlus, GenericPhone</tt><br>\n * <br>\n * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against\n * the patterns of <a href=\"http://detectmobilebrowsers.com/\">detectmobilebrowsers.com</a>. If this test\n * is positive, a value of <code>UnknownPhone</code> or <code>UnknownMobile</code> is returned.<br>\n * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br>\n * <br>\n * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code>\n * and <code>UnknownMobile</code>, so you will get <code>null</code> here, while {@link MobileDetect#mobile}\n * will return <code>UnknownMobile</code>.<br>\n * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for:\n * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}.\n * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use.\n * <br>\n * In most cases you will use the return value just as a boolean.\n *\n * @returns {String} the key of the phone family or producer, e.g. \"iPhone\"\n * @function MobileDetect#phone\n */\n phone: function () {\n impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);\n return this._cache.phone;\n },\n\n /**\n * Returns the detected tablet type/family string or <tt>null</tt>.\n * <br>\n * The returned tablet (family or producer) is one of following keys:<br>\n * <br><tt>iPad, NexusTablet, GoogleTablet, SamsungTablet, Kindle, SurfaceTablet,\n * HPTablet, AsusTablet, BlackBerryTablet, HTCtablet, MotorolaTablet, NookTablet,\n * AcerTablet, ToshibaTablet, LGTablet, FujitsuTablet, PrestigioTablet,\n * LenovoTablet, DellTablet, YarvikTablet, MedionTablet, ArnovaTablet,\n * IntensoTablet, IRUTablet, MegafonTablet, EbodaTablet, AllViewTablet,\n * ArchosTablet, AinolTablet, NokiaLumiaTablet, SonyTablet, PhilipsTablet,\n * CubeTablet, CobyTablet, MIDTablet, MSITablet, SMiTTablet, RockChipTablet,\n * FlyTablet, bqTablet, HuaweiTablet, NecTablet, PantechTablet, BronchoTablet,\n * VersusTablet, ZyncTablet, PositivoTablet, NabiTablet, KoboTablet, DanewTablet,\n * TexetTablet, PlaystationTablet, TrekstorTablet, PyleAudioTablet, AdvanTablet,\n * DanyTechTablet, GalapadTablet, MicromaxTablet, KarbonnTablet, AllFineTablet,\n * PROSCANTablet, YONESTablet, ChangJiaTablet, GUTablet, PointOfViewTablet,\n * OvermaxTablet, HCLTablet, DPSTablet, VistureTablet, CrestaTablet,\n * MediatekTablet, ConcordeTablet, GoCleverTablet, ModecomTablet, VoninoTablet,\n * ECSTablet, StorexTablet, VodafoneTablet, EssentielBTablet, RossMoorTablet,\n * iMobileTablet, TolinoTablet, AudioSonicTablet, AMPETablet, SkkTablet,\n * TecnoTablet, JXDTablet, iJoyTablet, FX2Tablet, XoroTablet, ViewsonicTablet,\n * VerizonTablet, OdysTablet, CaptivaTablet, IconbitTablet, TeclastTablet,\n * OndaTablet, JaytechTablet, BlaupunktTablet, DigmaTablet, EvolioTablet,\n * LavaTablet, AocTablet, MpmanTablet, CelkonTablet, WolderTablet, MediacomTablet,\n * MiTablet, NibiruTablet, NexoTablet, LeaderTablet, UbislateTablet,\n * PocketBookTablet, KocasoTablet, HisenseTablet, Hudl, TelstraTablet,\n * GenericTablet</tt><br>\n * <br>\n * If the device is not detected by the regular expressions from Mobile-Detect, a test is made against\n * the patterns of <a href=\"http://detectmobilebrowsers.com/\">detectmobilebrowsers.com</a>. If this test\n * is positive, a value of <code>UnknownTablet</code> or <code>UnknownMobile</code> is returned.<br>\n * When used in browser, the decision whether phone or tablet is made based on <code>screen.width/height</code>.<br>\n * <br>\n * When used server-side (node.js), there is no way to tell the difference between <code>UnknownTablet</code>\n * and <code>UnknownMobile</code>, so you will get <code>null</code> here, while {@link MobileDetect#mobile}\n * will return <code>UnknownMobile</code>.<br>\n * Be aware that since v1.0.0 in this special case you will get <code>UnknownMobile</code> only for:\n * {@link MobileDetect#mobile}, not for {@link MobileDetect#phone} and {@link MobileDetect#tablet}.\n * In versions before v1.0.0 all 3 methods returned <code>UnknownMobile</code> which was tedious to use.\n * <br>\n * In most cases you will use the return value just as a boolean.\n *\n * @returns {String} the key of the tablet family or producer, e.g. \"SamsungTablet\"\n * @function MobileDetect#tablet\n */\n tablet: function () {\n impl.prepareDetectionCache(this._cache, this.ua, this.maxPhoneWidth);\n return this._cache.tablet;\n },\n\n /**\n * Returns the (first) detected user-agent string or <tt>null</tt>.\n * <br>\n * The returned user-agent is one of following keys:<br>\n * <br><tt>Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, Blazer,\n * Safari, WeChat, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, Mercury,\n * ObigoBrowser, NetFront, GenericBrowser, PaleMoon</tt><br>\n * <br>\n * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare\n * cases where a mobile device pretends to be more than one particular browser. You can get the\n * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by\n * providing one of the defined keys as first argument to {@link MobileDetect#is}.\n *\n * @returns {String} the key for the detected user-agent or <tt>null</tt>\n * @function MobileDetect#userAgent\n */\n userAgent: function () {\n if (this._cache.userAgent === undefined) {\n this._cache.userAgent = impl.findMatch(impl.mobileDetectRules.uas, this.ua);\n }\n return this._cache.userAgent;\n },\n\n /**\n * Returns all detected user-agent strings.\n * <br>\n * The array is empty or contains one or more of following keys:<br>\n * <br><tt>Chrome, Dolfin, Opera, Skyfire, Edge, IE, Firefox, Bolt, TeaShark, Blazer,\n * Safari, WeChat, UCBrowser, baiduboxapp, baidubrowser, DiigoBrowser, Mercury,\n * ObigoBrowser, NetFront, GenericBrowser, PaleMoon</tt><br>\n * <br>\n * In most cases calling {@link MobileDetect#userAgent} will be sufficient. But there are rare\n * cases where a mobile device pretends to be more than one particular browser. You can get the\n * list of all matches with {@link MobileDetect#userAgents} or check for a particular value by\n * providing one of the defined keys as first argument to {@link MobileDetect#is}.\n *\n * @returns {Array} the array of detected user-agent keys or <tt>[]</tt>\n * @function MobileDetect#userAgents\n */\n userAgents: function () {\n if (this._cache.userAgents === undefined) {\n this._cache.userAgents = impl.findMatches(impl.mobileDetectRules.uas, this.ua);\n }\n return this._cache.userAgents;\n },\n\n /**\n * Returns the detected operating system string or <tt>null</tt>.\n * <br>\n * The operating system is one of following keys:<br>\n * <br><tt>AndroidOS, BlackBerryOS, PalmOS, SymbianOS, WindowsMobileOS, WindowsPhoneOS,\n * iOS, iPadOS, SailfishOS, MeeGoOS, MaemoOS, JavaOS, webOS, badaOS, BREWOS</tt><br>\n *\n * @returns {String} the key for the detected operating system.\n * @function MobileDetect#os\n */\n os: function () {\n if (this._cache.os === undefined) {\n this._cache.os = impl.detectOS(this.ua);\n }\n return this._cache.os;\n },\n\n /**\n * Get the version (as Number) of the given property in the User-Agent.\n * <br>\n * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31)\n *\n * @param {String} key a key defining a thing which has a version.<br>\n * You can use one of following keys:<br>\n * <br><tt>Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast,\n * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini,\n * Opera Mobi, UCBrowser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser,\n * SamsungBrowser, Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon,\n * SailfishBrowser, Gecko, Trident, Presto, Goanna, iOS, Android, Sailfish,\n * BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows CE, Windows\n * NT, Symbian, webOS</tt><br>\n *\n * @returns {Number} the version as float or <tt>NaN</tt> if User-Agent doesn't contain this version.\n * Be careful when comparing this value with '==' operator!\n * @function MobileDetect#version\n */\n version: function (key) {\n return impl.getVersion(key, this.ua);\n },\n\n /**\n * Get the version (as String) of the given property in the User-Agent.\n * <br>\n *\n * @param {String} key a key defining a thing which has a version.<br>\n * You can use one of following keys:<br>\n * <br><tt>Mobile, Build, Version, VendorID, iPad, iPhone, iPod, Kindle, Chrome, Coast,\n * Dolfin, Firefox, Fennec, Edge, IE, NetFront, NokiaBrowser, Opera, Opera Mini,\n * Opera Mobi, UCBrowser, MQQBrowser, MicroMessenger, baiduboxapp, baidubrowser,\n * SamsungBrowser, Iron, Safari, Skyfire, Tizen, Webkit, PaleMoon,\n * SailfishBrowser, Gecko, Trident, Presto, Goanna, iOS, Android, Sailfish,\n * BlackBerry, BREW, Java, Windows Phone OS, Windows Phone, Windows CE, Windows\n * NT, Symbian, webOS</tt><br>\n *\n * @returns {String} the \"raw\" version as String or <tt>null</tt> if User-Agent doesn't contain this version.\n *\n * @function MobileDetect#versionStr\n */\n versionStr: function (key) {\n return impl.getVersionStr(key, this.ua);\n },\n\n /**\n * Global test key against userAgent, os, phone, tablet and some other properties of userAgent string.\n *\n * @param {String} key the key (case-insensitive) of a userAgent, an operating system, phone or\n * tablet family.<br>\n * For a complete list of possible values, see {@link MobileDetect#userAgent},\n * {@link MobileDetect#os}, {@link MobileDetect#phone}, {@link MobileDetect#tablet}.<br>\n * Additionally you have following keys:<br>\n * <br><tt>Bot, MobileBot, DesktopMode, TV, WebKit, Console, Watch</tt><br>\n *\n * @returns {boolean} <tt>true</tt> when the given key is one of the defined keys of userAgent, os, phone,\n * tablet or one of the listed additional keys, otherwise <tt>false</tt>\n * @function MobileDetect#is\n */\n is: function (key) {\n return containsIC(this.userAgents(), key) ||\n equalIC(key, this.os()) ||\n equalIC(key, this.phone()) ||\n equalIC(key, this.tablet()) ||\n containsIC(impl.findMatches(impl.mobileDetectRules.utils, this.ua), key);\n },\n\n /**\n * Do a quick test against navigator::userAgent.\n *\n * @param {String|RegExp} pattern the pattern, either as String or RegExp\n * (a string will be converted to a case-insensitive RegExp).\n * @returns {boolean} <tt>true</tt> when the pattern matches, otherwise <tt>false</tt>\n * @function MobileDetect#match\n */\n match: function (pattern) {\n if (!(pattern instanceof RegExp)) {\n pattern = new RegExp(pattern, 'i');\n }\n return pattern.test(this.ua);\n },\n\n /**\n * Checks whether the mobile device can be considered as phone regarding <code>screen.width</code>.\n * <br>\n * Obviously this method makes sense in browser environments only (not for Node.js)!\n * @param {number} [maxPhoneWidth] the maximum logical pixels (aka. CSS-pixels) to be considered as phone.<br>\n * The argument is optional and if not present or falsy, the value of the constructor is taken.\n * @returns {boolean|undefined} <code>undefined</code> if screen size wasn't detectable, else <code>true</code>\n * when screen.width is less or equal to maxPhoneWidth, otherwise <code>false</code>.<br>\n * Will always return <code>undefined</code> server-side.\n */\n isPhoneSized: function (maxPhoneWidth) {\n return MobileDetect.isPhoneSized(maxPhoneWidth || this.maxPhoneWidth);\n },\n\n /**\n * Returns the mobile grade ('A', 'B', 'C').\n *\n * @returns {String} one of the mobile grades ('A', 'B', 'C').\n * @function MobileDetect#mobileGrade\n */\n mobileGrade: function () {\n if (this._cache.grade === undefined) {\n this._cache.grade = impl.mobileGrade(this);\n }\n return this._cache.grade;\n }\n };\n\n // environment-dependent\n if (typeof window !== 'undefined' && window.screen) {\n MobileDetect.isPhoneSized = function (maxPhoneWidth) {\n return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth;\n };\n } else {\n MobileDetect.isPhoneSized = function () {};\n }\n\n // should not be replaced by a completely new object - just overwrite existing methods\n MobileDetect._impl = impl;\n \n MobileDetect.version = '1.4.5 2021-03-13';\n\n return MobileDetect;\n}); // end of call of define()\n})((function (undefined) {\n if (typeof module !== 'undefined' && module.exports) {\n return function (factory) { module.exports = factory(); };\n } else if (typeof define === 'function' && define.amd) {\n return define;\n } else if (typeof window !== 'undefined') {\n return function (factory) { window.MobileDetect = factory(); };\n } else {\n // please file a bug if you get this error!\n throw new Error('unknown environment');\n }\n})());", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass CaretString {\n constructor(str, caretPosition) {\n this.str = str;\n this.caretPosition = caretPosition;\n }\n}\nexports.CaretString = CaretString;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass Next {\n constructor(state, insert, pass, value) {\n this.state = state;\n this.insert = insert;\n this.pass = pass;\n this.value = value;\n }\n}\nexports.Next = Next;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass Notation {\n constructor(character, characterSet, isOptional) {\n this.character = character;\n this.characterSet = characterSet;\n this.isOptional = isOptional;\n }\n}\nexports.Notation = Notation;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isNull(value) {\n return value === null;\n}\nexports.isNull = isNull;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst isNull_1 = require(\"../util/isNull\");\nclass State {\n constructor(child) {\n this.child = child;\n }\n autocomplete() {\n return null;\n }\n nextState() {\n if (!isNull_1.isNull(this.child)) {\n return this.child;\n }\n else {\n throw new Error('Value cannot be null');\n }\n }\n toString() {\n return 'BASE -> ' + !isNull_1.isNull(this.child) ? this.child.toString() : 'null';\n }\n}\nexports.State = State;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst state_1 = require(\"../state\");\nclass EOLState extends state_1.State {\n constructor(child = null) {\n super(child);\n this.child = child;\n }\n accept(character) {\n return null;\n }\n toString() {\n return 'EOL';\n }\n}\nexports.EOLState = EOLState;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst state_1 = require(\"../state\");\nconst next_1 = require(\"../next\");\nconst isNull_1 = require(\"../../util/isNull\");\nclass FixedState extends state_1.State {\n constructor(child, ownCharacter) {\n super(child);\n this.child = child;\n this.ownCharacter = ownCharacter;\n }\n accept(character) {\n if (this.ownCharacter === character) {\n return new next_1.Next(this.nextState(), character, true, character);\n }\n else {\n return new next_1.Next(this.nextState(), this.ownCharacter, false, this.ownCharacter);\n }\n }\n autocomplete() {\n return new next_1.Next(this.nextState(), this.ownCharacter, false, this.ownCharacter);\n }\n toString() {\n return `{${this.ownCharacter}} -> ` + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n}\nexports.FixedState = FixedState;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst state_1 = require(\"../state\");\nconst next_1 = require(\"../next\");\nconst isNull_1 = require(\"../../util/isNull\");\nclass FreeState extends state_1.State {\n constructor(child, ownCharacter) {\n super(child);\n this.child = child;\n this.ownCharacter = ownCharacter;\n }\n accept(character) {\n if (this.ownCharacter === character) {\n return new next_1.Next(this.nextState(), character, true, null);\n }\n else {\n return new next_1.Next(this.nextState(), this.ownCharacter, false, null);\n }\n }\n autocomplete() {\n return new next_1.Next(this.nextState(), this.ownCharacter, false, null);\n }\n toString() {\n return `${this.ownCharacter} -> ` + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n}\nexports.FreeState = FreeState;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nString.prototype.isDigit = function () {\n return this.search(/^[0-9]$/) !== -1;\n};\n/**\n * https://stackoverflow.com/questions/150033/regular-expression-to-match-non-ascii-characters\n */\nString.prototype.isLetter = function () {\n return this.search(/^[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]$/) !== -1;\n};\nString.prototype.isLetterOrDigit = function () {\n return this.isDigit() || this.isLetter();\n};\nString.prototype.contains = function (char) {\n return this.search(char) !== -1;\n};\nString.prototype.isEmpty = function () {\n return this.length === 0;\n};\nString.prototype.first = function () {\n return this.charAt(0);\n};\nString.prototype.toCharArray = function () {\n return this.split('');\n};\nString.prototype.prefixIntersection = function (another) {\n if (this.isEmpty() || another.isEmpty())\n return '';\n let endIndex = 0;\n while (endIndex < this.length && endIndex < another.length) {\n if (this[endIndex] === another[endIndex]) {\n ++endIndex;\n }\n else {\n return this.substring(0, endIndex);\n }\n }\n return this.substring(0, endIndex);\n};\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst state_1 = require(\"../state\");\nconst next_1 = require(\"../next\");\nrequire(\"../../util/string\");\nconst isNull_1 = require(\"../../util/isNull\");\nclass OptionalValueState extends state_1.State {\n constructor(child, type) {\n super(child);\n this.child = child;\n this.type = type;\n }\n accept(character) {\n if (this.accepts(character)) {\n return new next_1.Next(this.nextState(), character, true, character);\n }\n else {\n return new next_1.Next(this.nextState(), null, false, null);\n }\n }\n toString() {\n const type = this.type;\n if (type instanceof OptionalValueState.Numeric) {\n return '[a] -> ' + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else if (type instanceof OptionalValueState.Literal) {\n return '[9] -> ' + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else if (type instanceof OptionalValueState.AlphaNumeric) {\n return '[-] -> ' + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else if (type instanceof OptionalValueState.Custom) {\n return `[${type.character}] -> ` + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else {\n throw new Error(\"Doesn't match any supported type\");\n }\n }\n accepts(character) {\n const type = this.type;\n if (type instanceof OptionalValueState.Numeric) {\n return character.isDigit();\n }\n else if (type instanceof OptionalValueState.Literal) {\n return character.isLetter();\n }\n else if (type instanceof OptionalValueState.AlphaNumeric) {\n return character.isLetterOrDigit();\n }\n else if (type instanceof OptionalValueState.Custom) {\n return type.characterSet.includes(character);\n }\n else {\n throw new Error(\"Doesn't match any supported type\");\n }\n }\n}\nexports.OptionalValueState = OptionalValueState;\n(function (OptionalValueState) {\n class StateType {\n }\n OptionalValueState.StateType = StateType;\n class Literal extends StateType {\n }\n OptionalValueState.Literal = Literal;\n class Numeric extends StateType {\n }\n OptionalValueState.Numeric = Numeric;\n class AlphaNumeric extends StateType {\n }\n OptionalValueState.AlphaNumeric = AlphaNumeric;\n class Ellipsis extends StateType {\n constructor(inheritedType) {\n super();\n this.inheritedType = inheritedType;\n }\n }\n OptionalValueState.Ellipsis = Ellipsis;\n class Custom extends StateType {\n constructor(character, characterSet) {\n super();\n this.character = character;\n this.characterSet = characterSet;\n }\n }\n OptionalValueState.Custom = Custom;\n})(OptionalValueState = exports.OptionalValueState || (exports.OptionalValueState = {}));\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst state_1 = require(\"../state\");\nconst next_1 = require(\"../next\");\nrequire(\"../../util/string\");\nconst isNull_1 = require(\"../../util/isNull\");\nclass ValueState extends state_1.State {\n constructor(child, type) {\n super(child);\n this.child = child;\n this.type = type;\n this.isElliptical = type instanceof ValueState.Ellipsis;\n }\n accept(character) {\n if (!this.accepts(character)) {\n return null;\n }\n return new next_1.Next(this.nextState(), character, true, character);\n }\n nextState() {\n if (this.type instanceof ValueState.Ellipsis) {\n return this;\n }\n else {\n return super.nextState();\n }\n }\n toString() {\n const type = this.type;\n if (type instanceof ValueState.Numeric) {\n return '[A] -> ' + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else if (type instanceof ValueState.Literal) {\n return '[0] -> ' + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else if (type instanceof ValueState.AlphaNumeric) {\n return '[_] -> ' + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else if (type instanceof ValueState.Ellipsis) {\n return '[...] -> ' + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else if (type instanceof ValueState.Custom) {\n return `[${type.character}] -> ` + (!isNull_1.isNull(this.child) ? this.child.toString() : 'null');\n }\n else {\n throw new Error(\"Doesn't match any supported type\");\n }\n }\n accepts(character) {\n const type = this.type;\n if (type instanceof ValueState.Numeric) {\n return character.isDigit();\n }\n else if (type instanceof ValueState.Literal) {\n return character.isLetter();\n }\n else if (type instanceof ValueState.AlphaNumeric) {\n return character.isLetterOrDigit();\n }\n else if (type instanceof ValueState.Ellipsis) {\n if (type instanceof ValueState.Numeric) {\n return character.isDigit();\n }\n else if (type instanceof ValueState.Literal) {\n return character.isLetter();\n }\n else if (type instanceof ValueState.AlphaNumeric) {\n return character.isLetterOrDigit();\n }\n else {\n return false;\n }\n }\n else if (type instanceof ValueState.Custom) {\n return type.characterSet.includes(character);\n }\n else {\n throw new Error(\"Doesn't match any supported type\");\n }\n }\n}\nexports.ValueState = ValueState;\n(function (ValueState) {\n class StateType {\n }\n ValueState.StateType = StateType;\n class Literal extends StateType {\n }\n ValueState.Literal = Literal;\n class Numeric extends StateType {\n }\n ValueState.Numeric = Numeric;\n class AlphaNumeric extends StateType {\n }\n ValueState.AlphaNumeric = AlphaNumeric;\n class Ellipsis extends StateType {\n constructor(inheritedType) {\n super();\n this.inheritedType = inheritedType;\n }\n }\n ValueState.Ellipsis = Ellipsis;\n class Custom extends StateType {\n constructor(character, characterSet) {\n super();\n this.character = character;\n this.characterSet = characterSet;\n }\n }\n ValueState.Custom = Custom;\n})(ValueState = exports.ValueState || (exports.ValueState = {}));\n", "\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./caret-string\"));\n__export(require(\"./next\"));\n__export(require(\"./notation\"));\n__export(require(\"./state\"));\n__export(require(\"./state/e-o-l-state\"));\n__export(require(\"./state/fixed-state\"));\n__export(require(\"./state/free-state\"));\n__export(require(\"./state/optional-value-state\"));\n__export(require(\"./state/value-state\"));\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst model_1 = require(\"../model\");\nrequire(\"../util/string\");\nvar AffinityCalculationStrategy;\n(function (AffinityCalculationStrategy) {\n AffinityCalculationStrategy[AffinityCalculationStrategy[\"WHOLE_STRING\"] = 0] = \"WHOLE_STRING\";\n AffinityCalculationStrategy[AffinityCalculationStrategy[\"PREFIX\"] = 1] = \"PREFIX\";\n})(AffinityCalculationStrategy = exports.AffinityCalculationStrategy || (exports.AffinityCalculationStrategy = {}));\nclass AffinityCalculation {\n constructor(strategy) {\n this.strategy = strategy;\n }\n calculateAffinityOfMask(mask, text, autocomplete) {\n switch (this.strategy) {\n case AffinityCalculationStrategy.WHOLE_STRING: {\n return mask.apply(new model_1.CaretString(text.str, text.caretPosition), autocomplete).affinity;\n }\n case AffinityCalculationStrategy.PREFIX: {\n return mask.apply(new model_1.CaretString(text.str, text.caretPosition), autocomplete).formattedText.str.prefixIntersection(text.str).length;\n }\n }\n }\n}\nexports.AffinityCalculation = AffinityCalculation;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass FormatSanitizer {\n static sanitize(formatString) {\n try {\n FormatSanitizer.checkOpenBraces(formatString);\n const blocks = FormatSanitizer.divideBlocksWithMixedCharacters(FormatSanitizer.getFormatBlocks(formatString));\n return FormatSanitizer.sortFormatBlocks(blocks).join('');\n }\n catch (e) {\n throw new Error('Wrong format');\n }\n }\n static getFormatBlocks(formatString) {\n const blocks = new Array();\n let currentBlock = '';\n let escape = false;\n for (const char of formatString.toCharArray()) {\n if (char === '\\\\') {\n if (!escape) {\n escape = true;\n currentBlock += char;\n continue;\n }\n }\n if ((char === '[' || char === '{') && !escape) {\n if (!currentBlock.isEmpty()) {\n blocks.push(currentBlock);\n }\n currentBlock = '';\n }\n currentBlock += char;\n if ((char === ']' || char === '}') && !escape) {\n blocks.push(currentBlock);\n currentBlock = '';\n }\n escape = false;\n }\n if (!currentBlock.isEmpty()) {\n blocks.push(currentBlock);\n }\n return blocks;\n }\n static divideBlocksWithMixedCharacters(blocks) {\n const resultingBlocks = new Array();\n for (const block of blocks) {\n if (block.startsWith('[')) {\n let blockBuffer = '';\n for (const blockCharacter of block) {\n if (blockCharacter === '[') {\n blockBuffer += blockCharacter;\n continue;\n }\n if (blockCharacter === ']' && !blockBuffer.endsWith('\\\\')) {\n blockBuffer += blockCharacter;\n resultingBlocks.push(blockBuffer);\n break;\n }\n if (blockCharacter === '0' || blockCharacter === '9') {\n if (blockBuffer.contains('A')\n || blockBuffer.contains('a')\n || blockBuffer.contains('-')\n || blockBuffer.contains('_')) {\n blockBuffer += ']';\n resultingBlocks.push(blockBuffer);\n blockBuffer = `[${blockCharacter}`;\n continue;\n }\n }\n if (blockCharacter === 'A' || blockCharacter === 'a') {\n if (blockBuffer.contains('0')\n || blockBuffer.contains('9')\n || blockBuffer.contains('-')\n || blockBuffer.contains('_')) {\n blockBuffer += ']';\n resultingBlocks.push(blockBuffer);\n blockBuffer = `[${blockCharacter}`;\n continue;\n }\n }\n if (blockCharacter === '-' || blockCharacter === '_') {\n if (blockBuffer.contains('0')\n || blockBuffer.contains('9')\n || blockBuffer.contains('A')\n || blockBuffer.contains('a')) {\n blockBuffer += ']';\n resultingBlocks.push(blockBuffer);\n blockBuffer = `[${blockCharacter}`;\n continue;\n }\n }\n blockBuffer += blockCharacter;\n }\n }\n else {\n resultingBlocks.push(block);\n }\n }\n return resultingBlocks;\n }\n static sortFormatBlocks(blocks) {\n const sortedBlocks = new Array();\n for (let block of blocks) {\n let sortedBlock;\n if (block.startsWith('[')) {\n if (block.contains('0') || block.contains('9')) {\n block = block.replace(/\\[/g, '')\n .replace(/]/g, '');\n sortedBlock = '[' + block\n .toCharArray()\n .sort()\n .join('') + ']';\n }\n else if (block.contains('a') || block.contains('A')) {\n block = block.replace(/\\[/g, '')\n .replace(/]/g, '');\n sortedBlock = '[' + block\n .toCharArray()\n .sort()\n .join('') + ']';\n }\n else {\n block = block.replace(/\\[/g, '')\n .replace(/]/g, '')\n .replace(/_/g, 'A')\n .replace(/-/g, 'a');\n sortedBlock = '[' + block\n .toCharArray()\n .sort()\n .join('') + ']';\n sortedBlock = sortedBlock\n .replace(/A/g, '_')\n .replace(/a/g, '-');\n }\n }\n else {\n sortedBlock = block;\n }\n sortedBlocks.push(sortedBlock);\n }\n return sortedBlocks;\n }\n static checkOpenBraces(str) {\n let escape = false;\n let squareBraceOpen = false;\n let curlyBraceOpen = false;\n for (const char of str.toCharArray()) {\n if (char === '\\\\') {\n escape = !escape;\n continue;\n }\n if (char === '[') {\n if (squareBraceOpen) {\n throw new Error('Wrong format');\n }\n squareBraceOpen = !escape;\n }\n if (char === ']' && !escape) {\n squareBraceOpen = false;\n }\n if (char === '{') {\n if (curlyBraceOpen) {\n throw new Error('Wrong format');\n }\n curlyBraceOpen = !escape;\n }\n if (char === '}' && !escape) {\n curlyBraceOpen = false;\n }\n escape = false;\n }\n }\n}\nexports.FormatSanitizer = FormatSanitizer;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst model_1 = require(\"../model\");\nconst format_sanitizer_1 = require(\"./format-sanitizer\");\nclass Compiler {\n constructor(customNotations) {\n this.customNotations = customNotations;\n }\n compile(formatString) {\n try {\n const sanitizedString = format_sanitizer_1.FormatSanitizer.sanitize(formatString);\n return this._compile(sanitizedString, false, false, null);\n }\n catch (e) {\n throw new Error('Wrong format');\n }\n }\n _compile(formatString, valuable, fixed, lastCharacter) {\n if (formatString.isEmpty()) {\n return new model_1.EOLState();\n }\n const char = formatString.first();\n switch (char) {\n case '[': {\n if (lastCharacter !== '\\\\') {\n return this._compile(formatString.substring(1), true, false, char);\n }\n break;\n }\n case '{': {\n if (lastCharacter !== '\\\\') {\n return this._compile(formatString.substring(1), false, true, char);\n }\n break;\n }\n case ']': {\n if (lastCharacter !== '\\\\') {\n return this._compile(formatString.substring(1), false, false, char);\n }\n break;\n }\n case '}': {\n if (lastCharacter !== '\\\\') {\n return this._compile(formatString.substring(1), false, false, char);\n }\n break;\n }\n case '\\\\': {\n if (lastCharacter !== '\\\\') {\n return this._compile(formatString.substring(1), valuable, fixed, char);\n }\n break;\n }\n }\n if (valuable) {\n switch (char) {\n case '0': {\n return new model_1.ValueState(this._compile(formatString.substring(1), true, false, char), new model_1.ValueState.Numeric());\n }\n case 'A': {\n return new model_1.ValueState(this._compile(formatString.substring(1), true, false, char), new model_1.ValueState.Literal());\n }\n case '_': {\n return new model_1.ValueState(this._compile(formatString.substring(1), true, false, char), new model_1.ValueState.AlphaNumeric());\n }\n case '...': {\n return new model_1.ValueState(null, this.determineInheritedType(lastCharacter));\n }\n case '9': {\n return new model_1.OptionalValueState(this._compile(formatString.substring(1), true, false, char), new model_1.OptionalValueState.Numeric());\n }\n case 'a': {\n return new model_1.OptionalValueState(this._compile(formatString.substring(1), true, false, char), new model_1.OptionalValueState.Literal());\n }\n case '-': {\n return new model_1.OptionalValueState(this._compile(formatString.substring(1), true, false, char), new model_1.OptionalValueState.AlphaNumeric());\n }\n default: {\n return this.compileWithCustomNotations(char, formatString);\n }\n }\n }\n if (fixed) {\n return new model_1.FixedState(this._compile(formatString.substring(1), false, true, char), char);\n }\n return new model_1.FreeState(this._compile(formatString.substring(1), false, false, char), char);\n }\n determineInheritedType(lastCharacter) {\n switch (lastCharacter) {\n case '0' || '9': {\n return new model_1.ValueState.Numeric();\n }\n case 'A' || 'a': {\n return new model_1.ValueState.Literal();\n }\n case '_' || '_': {\n return new model_1.ValueState.AlphaNumeric();\n }\n case '...': {\n return new model_1.ValueState.AlphaNumeric();\n }\n case '[': {\n return new model_1.ValueState.AlphaNumeric();\n }\n default: {\n return this.determineTypeWithCustomNotation(lastCharacter);\n }\n }\n }\n compileWithCustomNotations(char, str) {\n const notation = this.customNotations.find(x => x.character === char);\n if (!notation)\n throw new Error('Wrong format');\n if (notation.isOptional) {\n return new model_1.OptionalValueState(this._compile(str.substring(1), true, false, char), new model_1.OptionalValueState.Custom(char, notation.characterSet));\n }\n else {\n return new model_1.ValueState(this._compile(str.substring(1), true, false, char), new model_1.ValueState.Custom(char, notation.characterSet));\n }\n }\n determineTypeWithCustomNotation(lastCharacter) {\n for (const notation of this.customNotations) {\n if (notation.character === lastCharacter) {\n return new model_1.ValueState.Custom(lastCharacter, notation.characterSet);\n }\n }\n throw new Error('Wrong format');\n }\n}\nexports.Compiler = Compiler;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass CaretStringIterator {\n constructor(caretString, currentIndex = 0) {\n this.caretString = caretString;\n this.currentIndex = currentIndex;\n }\n beforeCaret() {\n return this.currentIndex <= this.caretString.caretPosition\n || (this.currentIndex === 0 && this.caretString.caretPosition === 0);\n }\n next() {\n if (this.currentIndex >= this.caretString.str.length) {\n return null;\n }\n const char = this.caretString.str.toCharArray()[this.currentIndex];\n ++this.currentIndex;\n return char;\n }\n}\nexports.CaretStringIterator = CaretStringIterator;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst model_1 = require(\"../model\");\nconst compiler_1 = require(\"./compiler\");\nconst caret_string_iterator_1 = require(\"./caret-string-iterator\");\nclass Mask {\n constructor(format, customNotations) {\n this.format = format;\n this.customNotations = customNotations;\n this.initialState = new compiler_1.Compiler(this.customNotations).compile(this.format);\n this.placeholder = () => this.appendPlaceholder(this.initialState, '');\n }\n static getOrCreate(format, customNotations) {\n let cachedMask = Mask.cache.get(format);\n if (!cachedMask) {\n cachedMask = new Mask(format, customNotations);\n Mask.cache.set(format, cachedMask);\n }\n return cachedMask;\n }\n apply(text, autocomplete) {\n const iterator = new caret_string_iterator_1.CaretStringIterator(text);\n let affinity = 0;\n let extractedValue = '';\n let modifiedString = '';\n let modifiedCaretPosition = text.caretPosition;\n let state = this.initialState;\n let beforeCaret = iterator.beforeCaret();\n let character = iterator.next();\n let next;\n while (!!character) {\n next = state.accept(character);\n if (!!next) {\n state = next.state;\n modifiedString += !!next.insert ? next.insert : '';\n extractedValue += !!next.value ? next.value : '';\n if (next.pass) {\n beforeCaret = iterator.beforeCaret();\n character = iterator.next();\n ++affinity;\n }\n else {\n if (beforeCaret && next.insert !== null) {\n ++modifiedCaretPosition;\n }\n --affinity;\n }\n }\n else {\n if (iterator.beforeCaret()) {\n --modifiedCaretPosition;\n }\n beforeCaret = iterator.beforeCaret();\n character = iterator.next();\n --affinity;\n }\n }\n while (autocomplete && beforeCaret) {\n const nxt = state.autocomplete();\n if (nxt === null) {\n break;\n }\n state = nxt.state;\n modifiedString += !!nxt.insert ? nxt.insert : '';\n extractedValue += !!nxt.value ? nxt.value : '';\n if (nxt.insert !== null) {\n ++modifiedCaretPosition;\n }\n }\n return new Mask.Result(new model_1.CaretString(modifiedString, modifiedCaretPosition), extractedValue, affinity, this.noMandatoryCharactersLeftAfterState(state));\n }\n acceptableTextLength() {\n let state = this.initialState;\n let length = 0;\n while (!!state && !(state instanceof model_1.EOLState)) {\n if (state instanceof model_1.FixedState\n || state instanceof model_1.FreeState\n || state instanceof model_1.ValueState) {\n ++length;\n }\n state = state.child;\n }\n return length;\n }\n totalTextLength() {\n let state = this.initialState;\n let length = 0;\n while (!!state && !(state instanceof model_1.EOLState)) {\n if (state instanceof model_1.FixedState\n || state instanceof model_1.FreeState\n || state instanceof model_1.ValueState\n || state instanceof model_1.OptionalValueState) {\n ++length;\n }\n state = state.child;\n }\n return length;\n }\n acceptableValueLength() {\n let state = this.initialState;\n let length = 0;\n while (!!state && !(state instanceof model_1.EOLState)) {\n if (state instanceof model_1.FixedState\n || state instanceof model_1.ValueState) {\n ++length;\n }\n state = state.child;\n }\n return length;\n }\n totalValueLength() {\n let state = this.initialState;\n let length = 0;\n while (!!state && !(state instanceof model_1.EOLState)) {\n if (state instanceof model_1.FixedState\n || state instanceof model_1.ValueState\n || state instanceof model_1.OptionalValueState) {\n ++length;\n }\n state = state.child;\n }\n return length;\n }\n noMandatoryCharactersLeftAfterState(state) {\n if (state instanceof model_1.EOLState) {\n return true;\n }\n else if (state instanceof model_1.ValueState) {\n return state.isElliptical;\n }\n else if (state instanceof model_1.FixedState) {\n return false;\n }\n else {\n return this.noMandatoryCharactersLeftAfterState(state.nextState());\n }\n }\n appendPlaceholder(state, placeholder) {\n if (state === null) {\n return placeholder;\n }\n if (state instanceof model_1.EOLState) {\n return placeholder;\n }\n if (state instanceof model_1.FixedState) {\n return this.appendPlaceholder(state.child, placeholder.concat(state.ownCharacter.toString()));\n }\n if (state instanceof model_1.FreeState) {\n return this.appendPlaceholder(state.child, placeholder.concat(state.ownCharacter.toString()));\n }\n if (state instanceof model_1.OptionalValueState) {\n if (state.type instanceof model_1.OptionalValueState.AlphaNumeric) {\n return this.appendPlaceholder(state.child, placeholder + '-');\n }\n if (state.type instanceof model_1.OptionalValueState.Numeric) {\n return this.appendPlaceholder(state.child, placeholder + '0');\n }\n if (state.type instanceof model_1.OptionalValueState.Literal) {\n return this.appendPlaceholder(state.child, placeholder + 'a');\n }\n if (state.type instanceof model_1.OptionalValueState.Custom) {\n return this.appendPlaceholder(state.child, placeholder.concat(state.type.character.toString()));\n }\n }\n if (state instanceof model_1.ValueState) {\n if (state.type instanceof model_1.ValueState.AlphaNumeric) {\n return this.appendPlaceholder(state.child, placeholder + '-');\n }\n if (state.type instanceof model_1.ValueState.Numeric) {\n return this.appendPlaceholder(state.child, placeholder + '0');\n }\n if (state.type instanceof model_1.ValueState.Literal) {\n return this.appendPlaceholder(state.child, placeholder + 'a');\n }\n if (state.type instanceof model_1.ValueState.Ellipsis) {\n return placeholder;\n }\n if (state.type instanceof model_1.ValueState.Custom) {\n return this.appendPlaceholder(state.child, placeholder.concat(state.type.character.toString()));\n }\n }\n return placeholder;\n }\n}\nexports.Mask = Mask;\nMask.cache = new Map();\n(function (Mask) {\n class Result {\n constructor(formattedText, extractedValue, affinity, complete) {\n this.formattedText = formattedText;\n this.extractedValue = extractedValue;\n this.affinity = affinity;\n this.complete = complete;\n }\n }\n Mask.Result = Result;\n})(Mask = exports.Mask || (exports.Mask = {}));\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass MaskAffinity {\n constructor(mask, affinity) {\n this.mask = mask;\n this.affinity = affinity;\n }\n}\nexports.MaskAffinity = MaskAffinity;\n", "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst model_1 = require(\"./model\");\nconst affinity_calculation_strategy_1 = require(\"./helper/affinity-calculation-strategy\");\nconst mask_1 = require(\"./helper/mask\");\nconst mask_affinity_1 = require(\"./helper/mask-affinity\");\nclass MaskedTextChangedListener {\n constructor(primaryFormat, field, listener, affineFormats = [], customNotations = [], affinityCalculationStrategy = new affinity_calculation_strategy_1.AffinityCalculation(affinity_calculation_strategy_1.AffinityCalculationStrategy.WHOLE_STRING), autocomplete = true) {\n this.primaryFormat = primaryFormat;\n this.field = field;\n this.listener = listener;\n this.affineFormats = affineFormats;\n this.customNotations = customNotations;\n this.affinityCalculationStrategy = affinityCalculationStrategy;\n this.autocomplete = autocomplete;\n this.afterText = '';\n this.caretPosition = 0;\n this.placeholder = () => this.primaryMask.placeholder();\n this.acceptableTextLength = () => this.primaryMask.acceptableTextLength();\n this.totalTextLength = () => this.primaryMask.totalTextLength();\n this.totalValueLength = () => this.primaryMask.totalValueLength();\n this.dispose = () => {\n this.field.removeEventListener('input', this.handleInputChange);\n this.field.removeEventListener('focus', this.handleFocus);\n this.field.removeEventListener('blur', this.handleBlur);\n };\n this.handleInputChange = (ev) => {\n this.onTextChanged(ev.target.value, ev);\n };\n this.handleFocus = () => this.onFocusChange(true);\n this.handleBlur = () => this.onFocusChange(false);\n this.primaryMask = mask_1.Mask.getOrCreate(this.primaryFormat, this.customNotations);\n this.addEvents(field);\n }\n static installOn(primaryFormat, field, listener, affineFormats = [], customNotations = [], affinityCalculationStrategy = new affinity_calculation_strategy_1.AffinityCalculation(affinity_calculation_strategy_1.AffinityCalculationStrategy.WHOLE_STRING), autocomplete = true) {\n return new MaskedTextChangedListener(primaryFormat, field, listener, affineFormats, customNotations, affinityCalculationStrategy, autocomplete);\n }\n setText(text) {\n let result = null;\n if (!this.field.value || this.field.value === '') {\n result = this._setText(text, this.field);\n this.afterText = result.formattedText.str;\n this.caretPosition = result.formattedText.caretPosition;\n if (!!this.listener) {\n this.listener.onTextChanged(result.complete, result.extractedValue, this.afterText);\n }\n }\n return result;\n }\n _setText(text, field) {\n const result = this.pickMask(text, text.length, this.autocomplete).apply(new model_1.CaretString(text, text.length), this.autocomplete);\n field.value = String(result.formattedText.str);\n field.setSelectionRange(result.formattedText.caretPosition, result.formattedText.caretPosition);\n return result;\n }\n pickMask(text, caretPosition, autocomplete) {\n text = String(text);\n if (this.affineFormats.length === 0) {\n return this.primaryMask;\n }\n const primaryAffinity = this.calculateAffinity(this.primaryMask, text, caretPosition, autocomplete);\n const maskAndAffinities = [];\n for (const format of this.affineFormats) {\n const mask = new mask_1.Mask(format, this.customNotations);\n const affinity = this.calculateAffinity(mask, text, caretPosition, autocomplete);\n maskAndAffinities.push(new mask_affinity_1.MaskAffinity(mask, affinity));\n }\n maskAndAffinities.sort((a, b) => b.affinity - a.affinity);\n let insertIndex = -1;\n maskAndAffinities.some((maskAffinity, index) => {\n if (primaryAffinity >= maskAffinity.affinity) {\n insertIndex = index;\n }\n return primaryAffinity >= maskAffinity.affinity;\n });\n if (insertIndex >= 0) {\n maskAndAffinities[insertIndex] = new mask_affinity_1.MaskAffinity(this.primaryMask, primaryAffinity);\n }\n else {\n maskAndAffinities.push(new mask_affinity_1.MaskAffinity(this.primaryMask, primaryAffinity));\n }\n return maskAndAffinities[0].mask;\n }\n calculateAffinity(mask, text, caretPosition, autocomplete) {\n return this.affinityCalculationStrategy.calculateAffinityOfMask(mask, new model_1.CaretString(text, caretPosition), autocomplete);\n }\n addEvents(field) {\n field.addEventListener('input', this.handleInputChange);\n field.addEventListener('focus', this.handleFocus);\n field.addEventListener('blur', this.handleBlur);\n }\n onFocusChange(hasFocus) {\n if (this.autocomplete && hasFocus) {\n const text = !!this.field.value ? this.field.value : '';\n const result = this.pickMask(text, text.length, this.autocomplete).apply(new model_1.CaretString(text, text.length), this.autocomplete);\n this.afterText = result.formattedText.str;\n this.caretPosition = result.formattedText.caretPosition;\n this.field.value = String(this.afterText);\n this.field.setSelectionRange(result.formattedText.caretPosition, result.formattedText.caretPosition);\n if (!!this.listener) {\n this.listener.onTextChanged(result.complete, result.extractedValue, this.afterText);\n }\n }\n }\n onTextChanged(text, event) {\n const isDeletion = event.inputType === 'deleteContentForward'\n || event.inputType === 'deleteContentBackward';\n const isInside = this.field.selectionStart < text.length;\n const caretPosition = (isDeletion || isInside) ? this.field.selectionStart : text.length;\n const result = this.pickMask(text, caretPosition, this.autocomplete && !isDeletion).apply(new model_1.CaretString(text, caretPosition), this.autocomplete && !isDeletion);\n this.afterText = result.formattedText.str;\n this.caretPosition = (isDeletion || isInside)\n ? this.field.selectionStart\n : result.formattedText.caretPosition;\n this.field.value = String(this.afterText);\n this.field.setSelectionRange(this.caretPosition, this.caretPosition);\n if (!!this.listener) {\n this.listener.onTextChanged(result.complete, result.extractedValue, this.afterText);\n }\n }\n}\nexports.MaskedTextChangedListener = MaskedTextChangedListener;\n", "\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./helper/affinity-calculation-strategy\"));\n__export(require(\"./helper/mask\"));\n__export(require(\"./model/caret-string\"));\n__export(require(\"./model/notation\"));\n__export(require(\"./masked-text-changed-listener\"));\n", "/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n", "export class Map<T> {\r\n private items: { [key: string]: T };\r\n private lengthC: number = 0;\r\n\r\n constructor() {\r\n this.items = {};\r\n }\r\n\r\n add(key: string, value: T): void {\r\n this.lengthC++;\r\n this.items[key] = value;\r\n }\r\n\r\n has(key: string): boolean {\r\n return key in this.items;\r\n }\r\n\r\n get(key: string): T {\r\n return this.items[key];\r\n }\r\n\r\n length() {\r\n return this.lengthC;\r\n }\r\n\r\n delete(key: string) {\r\n delete this.items[key];\r\n this.lengthC--;\r\n }\r\n}", "\r\nexport abstract class AxInit {\r\n abstract AxInit(init?: any): void;\r\n\r\n}\r\n\r\nexport function ModuleName(aliasName: string) {\r\n const orgName = aliasName;\r\n return function (target: Function) {\r\n target.prototype.moduleAliasName = orgName;\r\n }\r\n}", "import { Map } from \"../Types/Map\";\r\nimport { AxAfterInit } from \"./AxAfterInit\";\r\nimport { AxInit, ModuleName } from \"./AxInit\";\r\nimport { AxReloadable } from \"./AxReloadable\";\r\n\r\n@ModuleName(\"AxLoad\")\r\nexport class AxLoad {\r\n static availableProviders: Map<any> = new Map<object>();\r\n static loadedModules: Map<any> = new Map<object>();\r\n\r\n static GetModule<T>(name: string): T {\r\n return AxLoad.loadedModules.get(name) as T;\r\n }\r\n\r\n static GetModuleWithoutType(name: string): object {\r\n return AxLoad.loadedModules.get(name);\r\n }\r\n\r\n static ReloadModule(name: string, init?: any, alias?: string, callLoaded: boolean = true) {\r\n let moduleInstance = this.GetModule<AxReloadable>(name);\r\n\r\n if (moduleInstance != null) {\r\n moduleInstance.AxReload(init);\r\n console.info(`%cAxLoad::ReloadModule reloaded Module %c${name}`, \"color: #ff8034\", \"color: #389AA4\");\r\n } else {\r\n this.LoadModule(name, init, alias, callLoaded);\r\n }\r\n }\r\n\r\n static LoadModule(name: string, init?: any, alias?: string, callLoaded: boolean = true) {\r\n $(() => {\r\n if (alias == null) {\r\n alias = name;\r\n }\r\n\r\n if (typeof this.availableProviders[name] != 'undefined') {\r\n let module: AxInit = new this.availableProviders[name];\r\n AxLoad.loadedModules.add(alias, module);\r\n module.AxInit(init);\r\n console.info(`%cAxLoad::LoadModule loaded Module %c${name}`, \"color: #ff8034\", \"color: #389AA4\");\r\n if (callLoaded && AxLoad.IsLoadAfterInit(module)) {\r\n (<AxAfterInit>module).AxAfterInit;\r\n }\r\n } else {\r\n console.error(`AxLoad::LoadModule unknown Module ${name}`);\r\n }\r\n });\r\n return Promise.resolve();\r\n }\r\n\r\n static LoadModules(modules: ModuleLoad[], timeout: number = 1000) {\r\n for (let module of modules) {\r\n AxLoad.LoadModule(module.name, module.initData, module.alias, false);\r\n }\r\n\r\n setTimeout(function () {\r\n for (let module of modules) {\r\n let tmp: any = AxLoad.GetModule<AxInit>(module.alias || module.name);\r\n\r\n if (AxLoad.IsLoadAfterInit(tmp)) {\r\n tmp.AxAfterInit();\r\n }\r\n }\r\n }, timeout);\r\n }\r\n\r\n static IsLoadAfterInit(module: AxInit | AxAfterInit): module is AxAfterInit {\r\n return module !== undefined && (<AxAfterInit>module).AxAfterInit !== undefined;\r\n }\r\n}\r\n\r\ninterface ModuleLoad {\r\n name: string;\r\n initData: any;\r\n alias?: string;\r\n}", "export class AxAlert {\r\n public constructor(selector: string) {\r\n $(selector).on('click', '.ax-close', e => {\r\n $(e.delegateTarget).addClass('d-none');\r\n });\r\n }\r\n}", "export class AxButton {\r\n Loading(btn: HTMLElement) {\r\n let $btn = $(btn);\r\n if (!$btn.hasClass(\"ax-loading\")) {\r\n $btn.prop(\"disabled\", true).addClass('ax-loading').append(\"<span class='ax-btn-loading'></span>\");\r\n }\r\n }\r\n\r\n StopLoading(btn: HTMLElement) {\r\n let $btn = $(btn);\r\n if ($btn.hasClass(\"ax-loading\")) {\r\n $btn.prop(\"disabled\", false).removeClass('ax-loading');\r\n $btn.find('.ax-btn-loading').remove();\r\n }\r\n }\r\n}", "export class AxPortletExpandable {\r\n\r\n Init() {\r\n $('.ax-portlet.ax-portlet--expandable').each((i, x) => {\r\n let $portlet = $(x);\r\n $portlet.find('button[data-dismiss=\"portlet\"]').each((i2, button) => {\r\n $(button).click(x => {\r\n let options = {\r\n detail: {\r\n elem: button\r\n },\r\n bubbles: true,\r\n cancelable: true,\r\n composed: false\r\n };\r\n\r\n let onOpen = new CustomEvent('ax-portlet--open', options);\r\n let onClose = new CustomEvent('ax-portlet--close', options);\r\n\r\n $portlet.toggleClass('active');\r\n\r\n if ($portlet.hasClass('active')) {\r\n button.dispatchEvent(onOpen);\r\n }\r\n if (!$portlet.hasClass('active')) {\r\n button.dispatchEvent(onClose);\r\n }\r\n });\r\n });\r\n });\r\n\r\n }\r\n\r\n OnOpen(selector: string, callback: (e: CustomEvent, elem: HTMLElement) => void) {\r\n let div_list = document.querySelectorAll(selector);\r\n div_list.forEach(div => {\r\n div.addEventListener(\"ax-portlet--open\", (event: CustomEvent) => {\r\n callback(event, event.detail.elem);\r\n });\r\n });\r\n\r\n }\r\n\r\n OnClose(selector: string, callback: (e: CustomEvent, elem: HTMLElement) => void) {\r\n document.querySelector(selector).addEventListener(\"ax-portlet--close\", (event: CustomEvent) => {\r\n callback(event, event.detail.elem);\r\n });\r\n }\r\n}\r\n", "export class AxTab {\r\n private TabHolders: TabHolder[] = [];\r\n private DefaultSelector: string = '.ax-tabs.ax-tabs--auto';\r\n\r\n Init(selector?: string) {\r\n selector = selector || this.DefaultSelector;\r\n\r\n if (selector != this.DefaultSelector && $(selector + '[data-ax-tab-header-for]').length == 0) {\r\n console.log(`AxTab: No Element or Target found for ${selector}`);\r\n }\r\n\r\n $(selector + '[data-ax-tab-header-for]').each((i, e) => {\r\n let $e = $(e);\r\n let startTarget = $e.attr('data-ax-tab-start');\r\n\r\n let holder: TabHolder = {\r\n Menu: e,\r\n TabContentHolder: [],\r\n EventListner: null\r\n };\r\n holder.EventListner = AxTabListener.Listener.bind(this, holder);\r\n\r\n let target = $($e.attr('data-ax-tab-header-for'));\r\n\r\n target.children('*[data-target]').each((i, c) => {\r\n let $c = $(c);\r\n let targetName = $c.attr('data-target');\r\n let active = (typeof startTarget != 'undefined' && targetName == startTarget);\r\n holder.TabContentHolder.push({\r\n TargetName: targetName,\r\n Active: false, //will be set in Activate Target\r\n TargetElement: c\r\n });\r\n\r\n if (active) {\r\n this.ActivateTarget(targetName, holder);\r\n }\r\n });\r\n\r\n holder.Menu.addEventListener(\"click\", holder.EventListner);\r\n this.TabHolders.push(holder);\r\n });\r\n }\r\n\r\n ActivateTab(targetName: string) {\r\n let tabHolders = this.TabHolders.filter(x => x.TabContentHolder.findIndex(y => y.TargetName == targetName) != -1);\r\n\r\n for (let holder of tabHolders) {\r\n this.ActivateTarget(targetName, holder);\r\n }\r\n }\r\n\r\n private ActivateTarget(targetName: string, tabHolder: TabHolder) {\r\n let $menu = $(tabHolder.Menu);\r\n $menu.children('*[data-target]').removeClass('active');\r\n $menu.children(`[data-target=${targetName}]`).addClass('active');\r\n\r\n let currentTarget = tabHolder.TabContentHolder.find(x => x.Active);\r\n\r\n if (typeof currentTarget == 'undefined' || currentTarget.TargetName != targetName) {\r\n if (typeof currentTarget != 'undefined') {\r\n currentTarget.Active = false;\r\n $(currentTarget.TargetElement).removeClass('active');\r\n }\r\n\r\n let contentTarget = tabHolder.TabContentHolder.find(x => x.TargetName == targetName);\r\n contentTarget.Active = true;\r\n $(contentTarget.TargetElement).addClass('active');\r\n }\r\n }\r\n}\r\n\r\nconst AxTabListener = {\r\n ///Element seems to be null\r\n Listener(tabHolder: TabHolder, event: PointerEvent) {\r\n let target = event.target;\r\n\r\n let targetName = $(target).attr('data-target');\r\n\r\n if (typeof targetName != 'undefined') {\r\n this.ActivateTarget(targetName, tabHolder);\r\n }\r\n }\r\n};\r\n\r\ninterface TabHolder {\r\n Menu: HTMLElement;\r\n TabContentHolder: ContentHolder[];\r\n EventListner: any;\r\n}\r\n\r\ninterface ContentHolder {\r\n TargetName: string;\r\n Active: boolean;\r\n TargetElement: HTMLElement;\r\n}", "import { AxAlert } from \"./AxAlert/AxAlert\";\r\nimport { AxButton } from \"./AxButton/AxButton\";\r\nimport { AxPortletExpandable } from \"./AxPortlet/AxPortletExpandable\";\r\nimport { AxTab } from \"./AxPortlet/AxTab\";\r\nimport { ModuleName } from \"../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"AxLimeStone\")\r\nexport class AxLimeStone {\r\n private TabHandler: AxTab[] = [];\r\n\r\n constructor(private _AxButton = new AxButton(),\r\n private _AxPortletExpandable = new AxPortletExpandable()) { }\r\n\r\n public Init() {\r\n let portletTabHandler = new AxTab();\r\n this.TabHandler.push(portletTabHandler);\r\n\r\n portletTabHandler.Init();\r\n this._AxPortletExpandable.Init();\r\n window.addEventListener(\"pageshow\", this.WindowListener.bind(this));\r\n }\r\n\r\n WindowListener(event: PageTransitionEvent) {\r\n if (event.persisted) {\r\n this.UnlockAllButtons();\r\n }\r\n }\r\n\r\n public Alert(selector: string): void {\r\n new AxAlert(selector);\r\n }\r\n\r\n public LockButton(e: HTMLElement) {\r\n this._AxButton.Loading(e);\r\n }\r\n\r\n public UnlockButton(e: HTMLElement) {\r\n this._AxButton.StopLoading(e);\r\n }\r\n\r\n public UnlockAllButtons() {\r\n let buttons = document.querySelectorAll('.ax-btn.ax-loading');\r\n\r\n buttons.forEach((currentValue, currentIndex, listObj) => {\r\n this._AxButton.StopLoading(currentValue as HTMLElement);\r\n });\r\n }\r\n}", "/**\n * SSR Window 3.0.0\n * Better handling for window object in SSR environment\n * https://github.com/nolimits4web/ssr-window\n *\n * Copyright 2020, Vladimir Kharlampidi\n *\n * Licensed under MIT\n *\n * Released on: November 9, 2020\n */\n/* eslint-disable no-param-reassign */\nfunction isObject(obj) {\n return (obj !== null &&\n typeof obj === 'object' &&\n 'constructor' in obj &&\n obj.constructor === Object);\n}\nfunction extend(target, src) {\n if (target === void 0) { target = {}; }\n if (src === void 0) { src = {}; }\n Object.keys(src).forEach(function (key) {\n if (typeof target[key] === 'undefined')\n target[key] = src[key];\n else if (isObject(src[key]) &&\n isObject(target[key]) &&\n Object.keys(src[key]).length > 0) {\n extend(target[key], src[key]);\n }\n });\n}\n\nvar ssrDocument = {\n body: {},\n addEventListener: function () { },\n removeEventListener: function () { },\n activeElement: {\n blur: function () { },\n nodeName: '',\n },\n querySelector: function () {\n return null;\n },\n querySelectorAll: function () {\n return [];\n },\n getElementById: function () {\n return null;\n },\n createEvent: function () {\n return {\n initEvent: function () { },\n };\n },\n createElement: function () {\n return {\n children: [],\n childNodes: [],\n style: {},\n setAttribute: function () { },\n getElementsByTagName: function () {\n return [];\n },\n };\n },\n createElementNS: function () {\n return {};\n },\n importNode: function () {\n return null;\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: '',\n },\n};\nfunction getDocument() {\n var doc = typeof document !== 'undefined' ? document : {};\n extend(doc, ssrDocument);\n return doc;\n}\n\nvar ssrWindow = {\n document: ssrDocument,\n navigator: {\n userAgent: '',\n },\n location: {\n hash: '',\n host: '',\n hostname: '',\n href: '',\n origin: '',\n pathname: '',\n protocol: '',\n search: '',\n },\n history: {\n replaceState: function () { },\n pushState: function () { },\n go: function () { },\n back: function () { },\n },\n CustomEvent: function CustomEvent() {\n return this;\n },\n addEventListener: function () { },\n removeEventListener: function () { },\n getComputedStyle: function () {\n return {\n getPropertyValue: function () {\n return '';\n },\n };\n },\n Image: function () { },\n Date: function () { },\n screen: {},\n setTimeout: function () { },\n clearTimeout: function () { },\n matchMedia: function () {\n return {};\n },\n requestAnimationFrame: function (callback) {\n if (typeof setTimeout === 'undefined') {\n callback();\n return null;\n }\n return setTimeout(callback, 0);\n },\n cancelAnimationFrame: function (id) {\n if (typeof setTimeout === 'undefined') {\n return;\n }\n clearTimeout(id);\n },\n};\nfunction getWindow() {\n var win = typeof window !== 'undefined' ? window : {};\n extend(win, ssrWindow);\n return win;\n}\n\nexport { extend, getDocument, getWindow, ssrDocument, ssrWindow };\n", "/**\n * Dom7 3.0.0\n * Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API\n * https://framework7.io/docs/dom7.html\n *\n * Copyright 2020, Vladimir Kharlampidi\n *\n * Licensed under MIT\n *\n * Released on: November 9, 2020\n */\nimport { getWindow, getDocument } from 'ssr-window';\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\n\nfunction _construct(Parent, args, Class) {\n if (_isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n}\n\nfunction _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n}\n\nfunction _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\n/* eslint-disable no-proto */\nfunction makeReactive(obj) {\n var proto = obj.__proto__;\n Object.defineProperty(obj, '__proto__', {\n get: function get() {\n return proto;\n },\n set: function set(value) {\n proto.__proto__ = value;\n }\n });\n}\n\nvar Dom7 = /*#__PURE__*/function (_Array) {\n _inheritsLoose(Dom7, _Array);\n\n function Dom7(items) {\n var _this;\n\n _this = _Array.call.apply(_Array, [this].concat(items)) || this;\n makeReactive(_assertThisInitialized(_this));\n return _this;\n }\n\n return Dom7;\n}( /*#__PURE__*/_wrapNativeSuper(Array));\n\nfunction arrayFlat(arr) {\n if (arr === void 0) {\n arr = [];\n }\n\n var res = [];\n arr.forEach(function (el) {\n if (Array.isArray(el)) {\n res.push.apply(res, arrayFlat(el));\n } else {\n res.push(el);\n }\n });\n return res;\n}\nfunction arrayFilter(arr, callback) {\n return Array.prototype.filter.call(arr, callback);\n}\nfunction arrayUnique(arr) {\n var uniqueArray = [];\n\n for (var i = 0; i < arr.length; i += 1) {\n if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]);\n }\n\n return uniqueArray;\n}\nfunction toCamelCase(string) {\n return string.toLowerCase().replace(/-(.)/g, function (match, group) {\n return group.toUpperCase();\n });\n}\n\nfunction qsa(selector, context) {\n if (typeof selector !== 'string') {\n return [selector];\n }\n\n var a = [];\n var res = context.querySelectorAll(selector);\n\n for (var i = 0; i < res.length; i += 1) {\n a.push(res[i]);\n }\n\n return a;\n}\n\nfunction $(selector, context) {\n var window = getWindow();\n var document = getDocument();\n var arr = [];\n\n if (!context && selector instanceof Dom7) {\n return selector;\n }\n\n if (!selector) {\n return new Dom7(arr);\n }\n\n if (typeof selector === 'string') {\n var html = selector.trim();\n\n if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {\n var toCreate = 'div';\n if (html.indexOf('<li') === 0) toCreate = 'ul';\n if (html.indexOf('<tr') === 0) toCreate = 'tbody';\n if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr';\n if (html.indexOf('<tbody') === 0) toCreate = 'table';\n if (html.indexOf('<option') === 0) toCreate = 'select';\n var tempParent = document.createElement(toCreate);\n tempParent.innerHTML = html;\n\n for (var i = 0; i < tempParent.childNodes.length; i += 1) {\n arr.push(tempParent.childNodes[i]);\n }\n } else {\n arr = qsa(selector.trim(), context || document);\n } // arr = qsa(selector, document);\n\n } else if (selector.nodeType || selector === window || selector === document) {\n arr.push(selector);\n } else if (Array.isArray(selector)) {\n if (selector instanceof Dom7) return selector;\n arr = selector;\n }\n\n return new Dom7(arrayUnique(arr));\n}\n\n$.fn = Dom7.prototype;\n\nfunction addClass() {\n for (var _len = arguments.length, classes = new Array(_len), _key = 0; _key < _len; _key++) {\n classes[_key] = arguments[_key];\n }\n\n var classNames = arrayFlat(classes.map(function (c) {\n return c.split(' ');\n }));\n this.forEach(function (el) {\n var _el$classList;\n\n (_el$classList = el.classList).add.apply(_el$classList, classNames);\n });\n return this;\n}\n\nfunction removeClass() {\n for (var _len2 = arguments.length, classes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n classes[_key2] = arguments[_key2];\n }\n\n var classNames = arrayFlat(classes.map(function (c) {\n return c.split(' ');\n }));\n this.forEach(function (el) {\n var _el$classList2;\n\n (_el$classList2 = el.classList).remove.apply(_el$classList2, classNames);\n });\n return this;\n}\n\nfunction toggleClass() {\n for (var _len3 = arguments.length, classes = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n classes[_key3] = arguments[_key3];\n }\n\n var classNames = arrayFlat(classes.map(function (c) {\n return c.split(' ');\n }));\n this.forEach(function (el) {\n classNames.forEach(function (className) {\n el.classList.toggle(className);\n });\n });\n}\n\nfunction hasClass() {\n for (var _len4 = arguments.length, classes = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n classes[_key4] = arguments[_key4];\n }\n\n var classNames = arrayFlat(classes.map(function (c) {\n return c.split(' ');\n }));\n return arrayFilter(this, function (el) {\n return classNames.filter(function (className) {\n return el.classList.contains(className);\n }).length > 0;\n }).length > 0;\n}\n\nfunction attr(attrs, value) {\n if (arguments.length === 1 && typeof attrs === 'string') {\n // Get attr\n if (this[0]) return this[0].getAttribute(attrs);\n return undefined;\n } // Set attrs\n\n\n for (var i = 0; i < this.length; i += 1) {\n if (arguments.length === 2) {\n // String\n this[i].setAttribute(attrs, value);\n } else {\n // Object\n for (var attrName in attrs) {\n this[i][attrName] = attrs[attrName];\n this[i].setAttribute(attrName, attrs[attrName]);\n }\n }\n }\n\n return this;\n}\n\nfunction removeAttr(attr) {\n for (var i = 0; i < this.length; i += 1) {\n this[i].removeAttribute(attr);\n }\n\n return this;\n}\n\nfunction prop(props, value) {\n if (arguments.length === 1 && typeof props === 'string') {\n // Get prop\n if (this[0]) return this[0][props];\n } else {\n // Set props\n for (var i = 0; i < this.length; i += 1) {\n if (arguments.length === 2) {\n // String\n this[i][props] = value;\n } else {\n // Object\n for (var propName in props) {\n this[i][propName] = props[propName];\n }\n }\n }\n\n return this;\n }\n\n return this;\n}\n\nfunction data(key, value) {\n var el;\n\n if (typeof value === 'undefined') {\n el = this[0];\n if (!el) return undefined; // Get value\n\n if (el.dom7ElementDataStorage && key in el.dom7ElementDataStorage) {\n return el.dom7ElementDataStorage[key];\n }\n\n var dataKey = el.getAttribute(\"data-\" + key);\n\n if (dataKey) {\n return dataKey;\n }\n\n return undefined;\n } // Set value\n\n\n for (var i = 0; i < this.length; i += 1) {\n el = this[i];\n if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {};\n el.dom7ElementDataStorage[key] = value;\n }\n\n return this;\n}\n\nfunction removeData(key) {\n for (var i = 0; i < this.length; i += 1) {\n var el = this[i];\n\n if (el.dom7ElementDataStorage && el.dom7ElementDataStorage[key]) {\n el.dom7ElementDataStorage[key] = null;\n delete el.dom7ElementDataStorage[key];\n }\n }\n}\n\nfunction dataset() {\n var el = this[0];\n if (!el) return undefined;\n var dataset = {}; // eslint-disable-line\n\n if (el.dataset) {\n for (var dataKey in el.dataset) {\n dataset[dataKey] = el.dataset[dataKey];\n }\n } else {\n for (var i = 0; i < el.attributes.length; i += 1) {\n var _attr = el.attributes[i];\n\n if (_attr.name.indexOf('data-') >= 0) {\n dataset[toCamelCase(_attr.name.split('data-')[1])] = _attr.value;\n }\n }\n }\n\n for (var key in dataset) {\n if (dataset[key] === 'false') dataset[key] = false;else if (dataset[key] === 'true') dataset[key] = true;else if (parseFloat(dataset[key]) === dataset[key] * 1) dataset[key] *= 1;\n }\n\n return dataset;\n}\n\nfunction val(value) {\n if (typeof value === 'undefined') {\n // get value\n var el = this[0];\n if (!el) return undefined;\n\n if (el.multiple && el.nodeName.toLowerCase() === 'select') {\n var values = [];\n\n for (var i = 0; i < el.selectedOptions.length; i += 1) {\n values.push(el.selectedOptions[i].value);\n }\n\n return values;\n }\n\n return el.value;\n } // set value\n\n\n for (var _i = 0; _i < this.length; _i += 1) {\n var _el = this[_i];\n\n if (Array.isArray(value) && _el.multiple && _el.nodeName.toLowerCase() === 'select') {\n for (var j = 0; j < _el.options.length; j += 1) {\n _el.options[j].selected = value.indexOf(_el.options[j].value) >= 0;\n }\n } else {\n _el.value = value;\n }\n }\n\n return this;\n}\n\nfunction value(value) {\n return this.val(value);\n}\n\nfunction transform(transform) {\n for (var i = 0; i < this.length; i += 1) {\n this[i].style.transform = transform;\n }\n\n return this;\n}\n\nfunction transition(duration) {\n for (var i = 0; i < this.length; i += 1) {\n this[i].style.transitionDuration = typeof duration !== 'string' ? duration + \"ms\" : duration;\n }\n\n return this;\n}\n\nfunction on() {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n var eventType = args[0],\n targetSelector = args[1],\n listener = args[2],\n capture = args[3];\n\n if (typeof args[1] === 'function') {\n eventType = args[0];\n listener = args[1];\n capture = args[2];\n targetSelector = undefined;\n }\n\n if (!capture) capture = false;\n\n function handleLiveEvent(e) {\n var target = e.target;\n if (!target) return;\n var eventData = e.target.dom7EventData || [];\n\n if (eventData.indexOf(e) < 0) {\n eventData.unshift(e);\n }\n\n if ($(target).is(targetSelector)) listener.apply(target, eventData);else {\n var _parents = $(target).parents(); // eslint-disable-line\n\n\n for (var k = 0; k < _parents.length; k += 1) {\n if ($(_parents[k]).is(targetSelector)) listener.apply(_parents[k], eventData);\n }\n }\n }\n\n function handleEvent(e) {\n var eventData = e && e.target ? e.target.dom7EventData || [] : [];\n\n if (eventData.indexOf(e) < 0) {\n eventData.unshift(e);\n }\n\n listener.apply(this, eventData);\n }\n\n var events = eventType.split(' ');\n var j;\n\n for (var i = 0; i < this.length; i += 1) {\n var el = this[i];\n\n if (!targetSelector) {\n for (j = 0; j < events.length; j += 1) {\n var event = events[j];\n if (!el.dom7Listeners) el.dom7Listeners = {};\n if (!el.dom7Listeners[event]) el.dom7Listeners[event] = [];\n el.dom7Listeners[event].push({\n listener: listener,\n proxyListener: handleEvent\n });\n el.addEventListener(event, handleEvent, capture);\n }\n } else {\n // Live events\n for (j = 0; j < events.length; j += 1) {\n var _event = events[j];\n if (!el.dom7LiveListeners) el.dom7LiveListeners = {};\n if (!el.dom7LiveListeners[_event]) el.dom7LiveListeners[_event] = [];\n\n el.dom7LiveListeners[_event].push({\n listener: listener,\n proxyListener: handleLiveEvent\n });\n\n el.addEventListener(_event, handleLiveEvent, capture);\n }\n }\n }\n\n return this;\n}\n\nfunction off() {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n var eventType = args[0],\n targetSelector = args[1],\n listener = args[2],\n capture = args[3];\n\n if (typeof args[1] === 'function') {\n eventType = args[0];\n listener = args[1];\n capture = args[2];\n targetSelector = undefined;\n }\n\n if (!capture) capture = false;\n var events = eventType.split(' ');\n\n for (var i = 0; i < events.length; i += 1) {\n var event = events[i];\n\n for (var j = 0; j < this.length; j += 1) {\n var el = this[j];\n var handlers = void 0;\n\n if (!targetSelector && el.dom7Listeners) {\n handlers = el.dom7Listeners[event];\n } else if (targetSelector && el.dom7LiveListeners) {\n handlers = el.dom7LiveListeners[event];\n }\n\n if (handlers && handlers.length) {\n for (var k = handlers.length - 1; k >= 0; k -= 1) {\n var handler = handlers[k];\n\n if (listener && handler.listener === listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n } else if (!listener) {\n el.removeEventListener(event, handler.proxyListener, capture);\n handlers.splice(k, 1);\n }\n }\n }\n }\n }\n\n return this;\n}\n\nfunction once() {\n var dom = this;\n\n for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {\n args[_key7] = arguments[_key7];\n }\n\n var eventName = args[0],\n targetSelector = args[1],\n listener = args[2],\n capture = args[3];\n\n if (typeof args[1] === 'function') {\n eventName = args[0];\n listener = args[1];\n capture = args[2];\n targetSelector = undefined;\n }\n\n function onceHandler() {\n for (var _len8 = arguments.length, eventArgs = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {\n eventArgs[_key8] = arguments[_key8];\n }\n\n listener.apply(this, eventArgs);\n dom.off(eventName, targetSelector, onceHandler, capture);\n\n if (onceHandler.dom7proxy) {\n delete onceHandler.dom7proxy;\n }\n }\n\n onceHandler.dom7proxy = listener;\n return dom.on(eventName, targetSelector, onceHandler, capture);\n}\n\nfunction trigger() {\n var window = getWindow();\n\n for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {\n args[_key9] = arguments[_key9];\n }\n\n var events = args[0].split(' ');\n var eventData = args[1];\n\n for (var i = 0; i < events.length; i += 1) {\n var event = events[i];\n\n for (var j = 0; j < this.length; j += 1) {\n var el = this[j];\n\n if (window.CustomEvent) {\n var evt = new window.CustomEvent(event, {\n detail: eventData,\n bubbles: true,\n cancelable: true\n });\n el.dom7EventData = args.filter(function (data, dataIndex) {\n return dataIndex > 0;\n });\n el.dispatchEvent(evt);\n el.dom7EventData = [];\n delete el.dom7EventData;\n }\n }\n }\n\n return this;\n}\n\nfunction transitionEnd(callback) {\n var dom = this;\n\n function fireCallBack(e) {\n if (e.target !== this) return;\n callback.call(this, e);\n dom.off('transitionend', fireCallBack);\n }\n\n if (callback) {\n dom.on('transitionend', fireCallBack);\n }\n\n return this;\n}\n\nfunction animationEnd(callback) {\n var dom = this;\n\n function fireCallBack(e) {\n if (e.target !== this) return;\n callback.call(this, e);\n dom.off('animationend', fireCallBack);\n }\n\n if (callback) {\n dom.on('animationend', fireCallBack);\n }\n\n return this;\n}\n\nfunction width() {\n var window = getWindow();\n\n if (this[0] === window) {\n return window.innerWidth;\n }\n\n if (this.length > 0) {\n return parseFloat(this.css('width'));\n }\n\n return null;\n}\n\nfunction outerWidth(includeMargins) {\n if (this.length > 0) {\n if (includeMargins) {\n var _styles = this.styles();\n\n return this[0].offsetWidth + parseFloat(_styles.getPropertyValue('margin-right')) + parseFloat(_styles.getPropertyValue('margin-left'));\n }\n\n return this[0].offsetWidth;\n }\n\n return null;\n}\n\nfunction height() {\n var window = getWindow();\n\n if (this[0] === window) {\n return window.innerHeight;\n }\n\n if (this.length > 0) {\n return parseFloat(this.css('height'));\n }\n\n return null;\n}\n\nfunction outerHeight(includeMargins) {\n if (this.length > 0) {\n if (includeMargins) {\n var _styles2 = this.styles();\n\n return this[0].offsetHeight + parseFloat(_styles2.getPropertyValue('margin-top')) + parseFloat(_styles2.getPropertyValue('margin-bottom'));\n }\n\n return this[0].offsetHeight;\n }\n\n return null;\n}\n\nfunction offset() {\n if (this.length > 0) {\n var window = getWindow();\n var document = getDocument();\n var el = this[0];\n var box = el.getBoundingClientRect();\n var body = document.body;\n var clientTop = el.clientTop || body.clientTop || 0;\n var clientLeft = el.clientLeft || body.clientLeft || 0;\n var scrollTop = el === window ? window.scrollY : el.scrollTop;\n var scrollLeft = el === window ? window.scrollX : el.scrollLeft;\n return {\n top: box.top + scrollTop - clientTop,\n left: box.left + scrollLeft - clientLeft\n };\n }\n\n return null;\n}\n\nfunction hide() {\n for (var i = 0; i < this.length; i += 1) {\n this[i].style.display = 'none';\n }\n\n return this;\n}\n\nfunction show() {\n var window = getWindow();\n\n for (var i = 0; i < this.length; i += 1) {\n var el = this[i];\n\n if (el.style.display === 'none') {\n el.style.display = '';\n }\n\n if (window.getComputedStyle(el, null).getPropertyValue('display') === 'none') {\n // Still not visible\n el.style.display = 'block';\n }\n }\n\n return this;\n}\n\nfunction styles() {\n var window = getWindow();\n if (this[0]) return window.getComputedStyle(this[0], null);\n return {};\n}\n\nfunction css(props, value) {\n var window = getWindow();\n var i;\n\n if (arguments.length === 1) {\n if (typeof props === 'string') {\n // .css('width')\n if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props);\n } else {\n // .css({ width: '100px' })\n for (i = 0; i < this.length; i += 1) {\n for (var _prop in props) {\n this[i].style[_prop] = props[_prop];\n }\n }\n\n return this;\n }\n }\n\n if (arguments.length === 2 && typeof props === 'string') {\n // .css('width', '100px')\n for (i = 0; i < this.length; i += 1) {\n this[i].style[props] = value;\n }\n\n return this;\n }\n\n return this;\n}\n\nfunction each(callback) {\n if (!callback) return this;\n this.forEach(function (el, index) {\n callback.apply(el, [el, index]);\n });\n return this;\n}\n\nfunction filter(callback) {\n var result = arrayFilter(this, callback);\n return $(result);\n}\n\nfunction html(html) {\n if (typeof html === 'undefined') {\n return this[0] ? this[0].innerHTML : null;\n }\n\n for (var i = 0; i < this.length; i += 1) {\n this[i].innerHTML = html;\n }\n\n return this;\n}\n\nfunction text(text) {\n if (typeof text === 'undefined') {\n return this[0] ? this[0].textContent.trim() : null;\n }\n\n for (var i = 0; i < this.length; i += 1) {\n this[i].textContent = text;\n }\n\n return this;\n}\n\nfunction is(selector) {\n var window = getWindow();\n var document = getDocument();\n var el = this[0];\n var compareWith;\n var i;\n if (!el || typeof selector === 'undefined') return false;\n\n if (typeof selector === 'string') {\n if (el.matches) return el.matches(selector);\n if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);\n if (el.msMatchesSelector) return el.msMatchesSelector(selector);\n compareWith = $(selector);\n\n for (i = 0; i < compareWith.length; i += 1) {\n if (compareWith[i] === el) return true;\n }\n\n return false;\n }\n\n if (selector === document) {\n return el === document;\n }\n\n if (selector === window) {\n return el === window;\n }\n\n if (selector.nodeType || selector instanceof Dom7) {\n compareWith = selector.nodeType ? [selector] : selector;\n\n for (i = 0; i < compareWith.length; i += 1) {\n if (compareWith[i] === el) return true;\n }\n\n return false;\n }\n\n return false;\n}\n\nfunction index() {\n var child = this[0];\n var i;\n\n if (child) {\n i = 0; // eslint-disable-next-line\n\n while ((child = child.previousSibling) !== null) {\n if (child.nodeType === 1) i += 1;\n }\n\n return i;\n }\n\n return undefined;\n}\n\nfunction eq(index) {\n if (typeof index === 'undefined') return this;\n var length = this.length;\n\n if (index > length - 1) {\n return $([]);\n }\n\n if (index < 0) {\n var returnIndex = length + index;\n if (returnIndex < 0) return $([]);\n return $([this[returnIndex]]);\n }\n\n return $([this[index]]);\n}\n\nfunction append() {\n var newChild;\n var document = getDocument();\n\n for (var k = 0; k < arguments.length; k += 1) {\n newChild = k < 0 || arguments.length <= k ? undefined : arguments[k];\n\n for (var i = 0; i < this.length; i += 1) {\n if (typeof newChild === 'string') {\n var tempDiv = document.createElement('div');\n tempDiv.innerHTML = newChild;\n\n while (tempDiv.firstChild) {\n this[i].appendChild(tempDiv.firstChild);\n }\n } else if (newChild instanceof Dom7) {\n for (var j = 0; j < newChild.length; j += 1) {\n this[i].appendChild(newChild[j]);\n }\n } else {\n this[i].appendChild(newChild);\n }\n }\n }\n\n return this;\n}\n\nfunction appendTo(parent) {\n $(parent).append(this);\n return this;\n}\n\nfunction prepend(newChild) {\n var document = getDocument();\n var i;\n var j;\n\n for (i = 0; i < this.length; i += 1) {\n if (typeof newChild === 'string') {\n var tempDiv = document.createElement('div');\n tempDiv.innerHTML = newChild;\n\n for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {\n this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);\n }\n } else if (newChild instanceof Dom7) {\n for (j = 0; j < newChild.length; j += 1) {\n this[i].insertBefore(newChild[j], this[i].childNodes[0]);\n }\n } else {\n this[i].insertBefore(newChild, this[i].childNodes[0]);\n }\n }\n\n return this;\n}\n\nfunction prependTo(parent) {\n $(parent).prepend(this);\n return this;\n}\n\nfunction insertBefore(selector) {\n var before = $(selector);\n\n for (var i = 0; i < this.length; i += 1) {\n if (before.length === 1) {\n before[0].parentNode.insertBefore(this[i], before[0]);\n } else if (before.length > 1) {\n for (var j = 0; j < before.length; j += 1) {\n before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]);\n }\n }\n }\n}\n\nfunction insertAfter(selector) {\n var after = $(selector);\n\n for (var i = 0; i < this.length; i += 1) {\n if (after.length === 1) {\n after[0].parentNode.insertBefore(this[i], after[0].nextSibling);\n } else if (after.length > 1) {\n for (var j = 0; j < after.length; j += 1) {\n after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling);\n }\n }\n }\n}\n\nfunction next(selector) {\n if (this.length > 0) {\n if (selector) {\n if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {\n return $([this[0].nextElementSibling]);\n }\n\n return $([]);\n }\n\n if (this[0].nextElementSibling) return $([this[0].nextElementSibling]);\n return $([]);\n }\n\n return $([]);\n}\n\nfunction nextAll(selector) {\n var nextEls = [];\n var el = this[0];\n if (!el) return $([]);\n\n while (el.nextElementSibling) {\n var _next = el.nextElementSibling; // eslint-disable-line\n\n if (selector) {\n if ($(_next).is(selector)) nextEls.push(_next);\n } else nextEls.push(_next);\n\n el = _next;\n }\n\n return $(nextEls);\n}\n\nfunction prev(selector) {\n if (this.length > 0) {\n var el = this[0];\n\n if (selector) {\n if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {\n return $([el.previousElementSibling]);\n }\n\n return $([]);\n }\n\n if (el.previousElementSibling) return $([el.previousElementSibling]);\n return $([]);\n }\n\n return $([]);\n}\n\nfunction prevAll(selector) {\n var prevEls = [];\n var el = this[0];\n if (!el) return $([]);\n\n while (el.previousElementSibling) {\n var _prev = el.previousElementSibling; // eslint-disable-line\n\n if (selector) {\n if ($(_prev).is(selector)) prevEls.push(_prev);\n } else prevEls.push(_prev);\n\n el = _prev;\n }\n\n return $(prevEls);\n}\n\nfunction siblings(selector) {\n return this.nextAll(selector).add(this.prevAll(selector));\n}\n\nfunction parent(selector) {\n var parents = []; // eslint-disable-line\n\n for (var i = 0; i < this.length; i += 1) {\n if (this[i].parentNode !== null) {\n if (selector) {\n if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode);\n } else {\n parents.push(this[i].parentNode);\n }\n }\n }\n\n return $(parents);\n}\n\nfunction parents(selector) {\n var parents = []; // eslint-disable-line\n\n for (var i = 0; i < this.length; i += 1) {\n var _parent = this[i].parentNode; // eslint-disable-line\n\n while (_parent) {\n if (selector) {\n if ($(_parent).is(selector)) parents.push(_parent);\n } else {\n parents.push(_parent);\n }\n\n _parent = _parent.parentNode;\n }\n }\n\n return $(parents);\n}\n\nfunction closest(selector) {\n var closest = this; // eslint-disable-line\n\n if (typeof selector === 'undefined') {\n return $([]);\n }\n\n if (!closest.is(selector)) {\n closest = closest.parents(selector).eq(0);\n }\n\n return closest;\n}\n\nfunction find(selector) {\n var foundElements = [];\n\n for (var i = 0; i < this.length; i += 1) {\n var found = this[i].querySelectorAll(selector);\n\n for (var j = 0; j < found.length; j += 1) {\n foundElements.push(found[j]);\n }\n }\n\n return $(foundElements);\n}\n\nfunction children(selector) {\n var children = []; // eslint-disable-line\n\n for (var i = 0; i < this.length; i += 1) {\n var childNodes = this[i].children;\n\n for (var j = 0; j < childNodes.length; j += 1) {\n if (!selector || $(childNodes[j]).is(selector)) {\n children.push(childNodes[j]);\n }\n }\n }\n\n return $(children);\n}\n\nfunction remove() {\n for (var i = 0; i < this.length; i += 1) {\n if (this[i].parentNode) this[i].parentNode.removeChild(this[i]);\n }\n\n return this;\n}\n\nfunction detach() {\n return this.remove();\n}\n\nfunction add() {\n var dom = this;\n var i;\n var j;\n\n for (var _len10 = arguments.length, els = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {\n els[_key10] = arguments[_key10];\n }\n\n for (i = 0; i < els.length; i += 1) {\n var toAdd = $(els[i]);\n\n for (j = 0; j < toAdd.length; j += 1) {\n dom.push(toAdd[j]);\n }\n }\n\n return dom;\n}\n\nfunction empty() {\n for (var i = 0; i < this.length; i += 1) {\n var el = this[i];\n\n if (el.nodeType === 1) {\n for (var j = 0; j < el.childNodes.length; j += 1) {\n if (el.childNodes[j].parentNode) {\n el.childNodes[j].parentNode.removeChild(el.childNodes[j]);\n }\n }\n\n el.textContent = '';\n }\n }\n\n return this;\n}\n\nfunction scrollTo() {\n var window = getWindow();\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var left = args[0],\n top = args[1],\n duration = args[2],\n easing = args[3],\n callback = args[4];\n\n if (args.length === 4 && typeof easing === 'function') {\n callback = easing;\n left = args[0];\n top = args[1];\n duration = args[2];\n callback = args[3];\n easing = args[4];\n }\n\n if (typeof easing === 'undefined') easing = 'swing';\n return this.each(function animate() {\n var el = this;\n var currentTop;\n var currentLeft;\n var maxTop;\n var maxLeft;\n var newTop;\n var newLeft;\n var scrollTop; // eslint-disable-line\n\n var scrollLeft; // eslint-disable-line\n\n var animateTop = top > 0 || top === 0;\n var animateLeft = left > 0 || left === 0;\n\n if (typeof easing === 'undefined') {\n easing = 'swing';\n }\n\n if (animateTop) {\n currentTop = el.scrollTop;\n\n if (!duration) {\n el.scrollTop = top;\n }\n }\n\n if (animateLeft) {\n currentLeft = el.scrollLeft;\n\n if (!duration) {\n el.scrollLeft = left;\n }\n }\n\n if (!duration) return;\n\n if (animateTop) {\n maxTop = el.scrollHeight - el.offsetHeight;\n newTop = Math.max(Math.min(top, maxTop), 0);\n }\n\n if (animateLeft) {\n maxLeft = el.scrollWidth - el.offsetWidth;\n newLeft = Math.max(Math.min(left, maxLeft), 0);\n }\n\n var startTime = null;\n if (animateTop && newTop === currentTop) animateTop = false;\n if (animateLeft && newLeft === currentLeft) animateLeft = false;\n\n function render(time) {\n if (time === void 0) {\n time = new Date().getTime();\n }\n\n if (startTime === null) {\n startTime = time;\n }\n\n var progress = Math.max(Math.min((time - startTime) / duration, 1), 0);\n var easeProgress = easing === 'linear' ? progress : 0.5 - Math.cos(progress * Math.PI) / 2;\n var done;\n if (animateTop) scrollTop = currentTop + easeProgress * (newTop - currentTop);\n if (animateLeft) scrollLeft = currentLeft + easeProgress * (newLeft - currentLeft);\n\n if (animateTop && newTop > currentTop && scrollTop >= newTop) {\n el.scrollTop = newTop;\n done = true;\n }\n\n if (animateTop && newTop < currentTop && scrollTop <= newTop) {\n el.scrollTop = newTop;\n done = true;\n }\n\n if (animateLeft && newLeft > currentLeft && scrollLeft >= newLeft) {\n el.scrollLeft = newLeft;\n done = true;\n }\n\n if (animateLeft && newLeft < currentLeft && scrollLeft <= newLeft) {\n el.scrollLeft = newLeft;\n done = true;\n }\n\n if (done) {\n if (callback) callback();\n return;\n }\n\n if (animateTop) el.scrollTop = scrollTop;\n if (animateLeft) el.scrollLeft = scrollLeft;\n window.requestAnimationFrame(render);\n }\n\n window.requestAnimationFrame(render);\n });\n} // scrollTop(top, duration, easing, callback) {\n\n\nfunction scrollTop() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var top = args[0],\n duration = args[1],\n easing = args[2],\n callback = args[3];\n\n if (args.length === 3 && typeof easing === 'function') {\n top = args[0];\n duration = args[1];\n callback = args[2];\n easing = args[3];\n }\n\n var dom = this;\n\n if (typeof top === 'undefined') {\n if (dom.length > 0) return dom[0].scrollTop;\n return null;\n }\n\n return dom.scrollTo(undefined, top, duration, easing, callback);\n}\n\nfunction scrollLeft() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n var left = args[0],\n duration = args[1],\n easing = args[2],\n callback = args[3];\n\n if (args.length === 3 && typeof easing === 'function') {\n left = args[0];\n duration = args[1];\n callback = args[2];\n easing = args[3];\n }\n\n var dom = this;\n\n if (typeof left === 'undefined') {\n if (dom.length > 0) return dom[0].scrollLeft;\n return null;\n }\n\n return dom.scrollTo(left, undefined, duration, easing, callback);\n}\n\nfunction animate(initialProps, initialParams) {\n var window = getWindow();\n var els = this;\n var a = {\n props: Object.assign({}, initialProps),\n params: Object.assign({\n duration: 300,\n easing: 'swing' // or 'linear'\n\n /* Callbacks\n begin(elements)\n complete(elements)\n progress(elements, complete, remaining, start, tweenValue)\n */\n\n }, initialParams),\n elements: els,\n animating: false,\n que: [],\n easingProgress: function easingProgress(easing, progress) {\n if (easing === 'swing') {\n return 0.5 - Math.cos(progress * Math.PI) / 2;\n }\n\n if (typeof easing === 'function') {\n return easing(progress);\n }\n\n return progress;\n },\n stop: function stop() {\n if (a.frameId) {\n window.cancelAnimationFrame(a.frameId);\n }\n\n a.animating = false;\n a.elements.each(function (el) {\n var element = el;\n delete element.dom7AnimateInstance;\n });\n a.que = [];\n },\n done: function done(complete) {\n a.animating = false;\n a.elements.each(function (el) {\n var element = el;\n delete element.dom7AnimateInstance;\n });\n if (complete) complete(els);\n\n if (a.que.length > 0) {\n var que = a.que.shift();\n a.animate(que[0], que[1]);\n }\n },\n animate: function animate(props, params) {\n if (a.animating) {\n a.que.push([props, params]);\n return a;\n }\n\n var elements = []; // Define & Cache Initials & Units\n\n a.elements.each(function (el, index) {\n var initialFullValue;\n var initialValue;\n var unit;\n var finalValue;\n var finalFullValue;\n if (!el.dom7AnimateInstance) a.elements[index].dom7AnimateInstance = a;\n elements[index] = {\n container: el\n };\n Object.keys(props).forEach(function (prop) {\n initialFullValue = window.getComputedStyle(el, null).getPropertyValue(prop).replace(',', '.');\n initialValue = parseFloat(initialFullValue);\n unit = initialFullValue.replace(initialValue, '');\n finalValue = parseFloat(props[prop]);\n finalFullValue = props[prop] + unit;\n elements[index][prop] = {\n initialFullValue: initialFullValue,\n initialValue: initialValue,\n unit: unit,\n finalValue: finalValue,\n finalFullValue: finalFullValue,\n currentValue: initialValue\n };\n });\n });\n var startTime = null;\n var time;\n var elementsDone = 0;\n var propsDone = 0;\n var done;\n var began = false;\n a.animating = true;\n\n function render() {\n time = new Date().getTime();\n var progress;\n var easeProgress; // let el;\n\n if (!began) {\n began = true;\n if (params.begin) params.begin(els);\n }\n\n if (startTime === null) {\n startTime = time;\n }\n\n if (params.progress) {\n // eslint-disable-next-line\n params.progress(els, Math.max(Math.min((time - startTime) / params.duration, 1), 0), startTime + params.duration - time < 0 ? 0 : startTime + params.duration - time, startTime);\n }\n\n elements.forEach(function (element) {\n var el = element;\n if (done || el.done) return;\n Object.keys(props).forEach(function (prop) {\n if (done || el.done) return;\n progress = Math.max(Math.min((time - startTime) / params.duration, 1), 0);\n easeProgress = a.easingProgress(params.easing, progress);\n var _el$prop = el[prop],\n initialValue = _el$prop.initialValue,\n finalValue = _el$prop.finalValue,\n unit = _el$prop.unit;\n el[prop].currentValue = initialValue + easeProgress * (finalValue - initialValue);\n var currentValue = el[prop].currentValue;\n\n if (finalValue > initialValue && currentValue >= finalValue || finalValue < initialValue && currentValue <= finalValue) {\n el.container.style[prop] = finalValue + unit;\n propsDone += 1;\n\n if (propsDone === Object.keys(props).length) {\n el.done = true;\n elementsDone += 1;\n }\n\n if (elementsDone === elements.length) {\n done = true;\n }\n }\n\n if (done) {\n a.done(params.complete);\n return;\n }\n\n el.container.style[prop] = currentValue + unit;\n });\n });\n if (done) return; // Then call\n\n a.frameId = window.requestAnimationFrame(render);\n }\n\n a.frameId = window.requestAnimationFrame(render);\n return a;\n }\n };\n\n if (a.elements.length === 0) {\n return els;\n }\n\n var animateInstance;\n\n for (var i = 0; i < a.elements.length; i += 1) {\n if (a.elements[i].dom7AnimateInstance) {\n animateInstance = a.elements[i].dom7AnimateInstance;\n } else a.elements[i].dom7AnimateInstance = a;\n }\n\n if (!animateInstance) {\n animateInstance = a;\n }\n\n if (initialProps === 'stop') {\n animateInstance.stop();\n } else {\n animateInstance.animate(a.props, a.params);\n }\n\n return els;\n}\n\nfunction stop() {\n var els = this;\n\n for (var i = 0; i < els.length; i += 1) {\n if (els[i].dom7AnimateInstance) {\n els[i].dom7AnimateInstance.stop();\n }\n }\n}\n\nvar noTrigger = 'resize scroll'.split(' ');\n\nfunction shortcut(name) {\n function eventHandler() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[0] === 'undefined') {\n for (var i = 0; i < this.length; i += 1) {\n if (noTrigger.indexOf(name) < 0) {\n if (name in this[i]) this[i][name]();else {\n $(this[i]).trigger(name);\n }\n }\n }\n\n return this;\n }\n\n return this.on.apply(this, [name].concat(args));\n }\n\n return eventHandler;\n}\n\nvar click = shortcut('click');\nvar blur = shortcut('blur');\nvar focus = shortcut('focus');\nvar focusin = shortcut('focusin');\nvar focusout = shortcut('focusout');\nvar keyup = shortcut('keyup');\nvar keydown = shortcut('keydown');\nvar keypress = shortcut('keypress');\nvar submit = shortcut('submit');\nvar change = shortcut('change');\nvar mousedown = shortcut('mousedown');\nvar mousemove = shortcut('mousemove');\nvar mouseup = shortcut('mouseup');\nvar mouseenter = shortcut('mouseenter');\nvar mouseleave = shortcut('mouseleave');\nvar mouseout = shortcut('mouseout');\nvar mouseover = shortcut('mouseover');\nvar touchstart = shortcut('touchstart');\nvar touchend = shortcut('touchend');\nvar touchmove = shortcut('touchmove');\nvar resize = shortcut('resize');\nvar scroll = shortcut('scroll');\n\nexport default $;\nexport { $, add, addClass, animate, animationEnd, append, appendTo, attr, blur, change, children, click, closest, css, data, dataset, detach, each, empty, eq, filter, find, focus, focusin, focusout, hasClass, height, hide, html, index, insertAfter, insertBefore, is, keydown, keypress, keyup, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, next, nextAll, off, offset, on, once, outerHeight, outerWidth, parent, parents, prepend, prependTo, prev, prevAll, prop, remove, removeAttr, removeClass, removeData, resize, scroll, scrollLeft, scrollTo, scrollTop, show, siblings, stop, styles, submit, text, toggleClass, touchend, touchmove, touchstart, transform, transition, transitionEnd, trigger, val, value, width };\n", "import { $, addClass, removeClass, hasClass, toggleClass, attr, removeAttr, transform, transition, on, off, trigger, transitionEnd, outerWidth, outerHeight, styles, offset, css, each, html, text, is, index, eq, append, prepend, next, nextAll, prev, prevAll, parent, parents, closest, find, children, filter, remove } from 'dom7';\nvar Methods = {\n addClass: addClass,\n removeClass: removeClass,\n hasClass: hasClass,\n toggleClass: toggleClass,\n attr: attr,\n removeAttr: removeAttr,\n transform: transform,\n transition: transition,\n on: on,\n off: off,\n trigger: trigger,\n transitionEnd: transitionEnd,\n outerWidth: outerWidth,\n outerHeight: outerHeight,\n styles: styles,\n offset: offset,\n css: css,\n each: each,\n html: html,\n text: text,\n is: is,\n index: index,\n eq: eq,\n append: append,\n prepend: prepend,\n next: next,\n nextAll: nextAll,\n prev: prev,\n prevAll: prevAll,\n parent: parent,\n parents: parents,\n closest: closest,\n find: find,\n children: children,\n filter: filter,\n remove: remove\n};\nObject.keys(Methods).forEach(function (methodName) {\n Object.defineProperty($.fn, methodName, {\n value: Methods[methodName],\n writable: true\n });\n});\nexport default $;", "import { getDocument, getWindow } from 'ssr-window';\n\nfunction deleteProps(obj) {\n var object = obj;\n Object.keys(object).forEach(function (key) {\n try {\n object[key] = null;\n } catch (e) {// no getter for object\n }\n\n try {\n delete object[key];\n } catch (e) {// something got wrong\n }\n });\n}\n\nfunction nextTick(callback, delay) {\n if (delay === void 0) {\n delay = 0;\n }\n\n return setTimeout(callback, delay);\n}\n\nfunction now() {\n return Date.now();\n}\n\nfunction getComputedStyle(el) {\n var window = getWindow();\n var style;\n\n if (window.getComputedStyle) {\n style = window.getComputedStyle(el, null);\n }\n\n if (!style && el.currentStyle) {\n style = el.currentStyle;\n }\n\n if (!style) {\n style = el.style;\n }\n\n return style;\n}\n\nfunction getTranslate(el, axis) {\n if (axis === void 0) {\n axis = 'x';\n }\n\n var window = getWindow();\n var matrix;\n var curTransform;\n var transformMatrix;\n var curStyle = getComputedStyle(el, null);\n\n if (window.WebKitCSSMatrix) {\n curTransform = curStyle.transform || curStyle.webkitTransform;\n\n if (curTransform.split(',').length > 6) {\n curTransform = curTransform.split(', ').map(function (a) {\n return a.replace(',', '.');\n }).join(', ');\n } // Some old versions of Webkit choke when 'none' is passed; pass\n // empty string instead in this case\n\n\n transformMatrix = new window.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);\n } else {\n transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');\n matrix = transformMatrix.toString().split(',');\n }\n\n if (axis === 'x') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41; // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[12]); // Normal Browsers\n else curTransform = parseFloat(matrix[4]);\n }\n\n if (axis === 'y') {\n // Latest Chrome and webkits Fix\n if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42; // Crazy IE10 Matrix\n else if (matrix.length === 16) curTransform = parseFloat(matrix[13]); // Normal Browsers\n else curTransform = parseFloat(matrix[5]);\n }\n\n return curTransform || 0;\n}\n\nfunction isObject(o) {\n return typeof o === 'object' && o !== null && o.constructor && Object.prototype.toString.call(o).slice(8, -1) === 'Object';\n}\n\nfunction isNode(node) {\n // eslint-disable-next-line\n if (typeof window !== 'undefined' && typeof window.HTMLElement !== 'undefined') {\n return node instanceof HTMLElement;\n }\n\n return node && (node.nodeType === 1 || node.nodeType === 11);\n}\n\nfunction extend() {\n var to = Object(arguments.length <= 0 ? undefined : arguments[0]);\n var noExtend = ['__proto__', 'constructor', 'prototype'];\n\n for (var i = 1; i < arguments.length; i += 1) {\n var nextSource = i < 0 || arguments.length <= i ? undefined : arguments[i];\n\n if (nextSource !== undefined && nextSource !== null && !isNode(nextSource)) {\n var keysArray = Object.keys(Object(nextSource)).filter(function (key) {\n return noExtend.indexOf(key) < 0;\n });\n\n for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {\n var nextKey = keysArray[nextIndex];\n var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);\n\n if (desc !== undefined && desc.enumerable) {\n if (isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n if (nextSource[nextKey].__swiper__) {\n to[nextKey] = nextSource[nextKey];\n } else {\n extend(to[nextKey], nextSource[nextKey]);\n }\n } else if (!isObject(to[nextKey]) && isObject(nextSource[nextKey])) {\n to[nextKey] = {};\n\n if (nextSource[nextKey].__swiper__) {\n to[nextKey] = nextSource[nextKey];\n } else {\n extend(to[nextKey], nextSource[nextKey]);\n }\n } else {\n to[nextKey] = nextSource[nextKey];\n }\n }\n }\n }\n }\n\n return to;\n}\n\nfunction bindModuleMethods(instance, obj) {\n Object.keys(obj).forEach(function (key) {\n if (isObject(obj[key])) {\n Object.keys(obj[key]).forEach(function (subKey) {\n if (typeof obj[key][subKey] === 'function') {\n obj[key][subKey] = obj[key][subKey].bind(instance);\n }\n });\n }\n\n instance[key] = obj[key];\n });\n}\n\nfunction classesToSelector(classes) {\n if (classes === void 0) {\n classes = '';\n }\n\n return \".\" + classes.trim().replace(/([\\.:!\\/])/g, '\\\\$1') // eslint-disable-line\n .replace(/ /g, '.');\n}\n\nfunction createElementIfNotDefined($container, params, createElements, checkProps) {\n var document = getDocument();\n\n if (createElements) {\n Object.keys(checkProps).forEach(function (key) {\n if (!params[key] && params.auto === true) {\n var element = document.createElement('div');\n element.className = checkProps[key];\n $container.append(element);\n params[key] = element;\n }\n });\n }\n\n return params;\n}\n\nexport { deleteProps, nextTick, now, getTranslate, isObject, extend, bindModuleMethods, getComputedStyle, classesToSelector, createElementIfNotDefined };", "import { getWindow, getDocument } from 'ssr-window';\nvar support;\n\nfunction calcSupport() {\n var window = getWindow();\n var document = getDocument();\n return {\n touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch),\n pointerEvents: !!window.PointerEvent && 'maxTouchPoints' in window.navigator && window.navigator.maxTouchPoints >= 0,\n observer: function checkObserver() {\n return 'MutationObserver' in window || 'WebkitMutationObserver' in window;\n }(),\n passiveListener: function checkPassiveListener() {\n var supportsPassive = false;\n\n try {\n var opts = Object.defineProperty({}, 'passive', {\n // eslint-disable-next-line\n get: function get() {\n supportsPassive = true;\n }\n });\n window.addEventListener('testPassiveListener', null, opts);\n } catch (e) {// No support\n }\n\n return supportsPassive;\n }(),\n gestures: function checkGestures() {\n return 'ongesturestart' in window;\n }()\n };\n}\n\nfunction getSupport() {\n if (!support) {\n support = calcSupport();\n }\n\n return support;\n}\n\nexport { getSupport };", "import { getWindow } from 'ssr-window';\nimport { getSupport } from './get-support';\nvar device;\n\nfunction calcDevice(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n userAgent = _ref.userAgent;\n\n var support = getSupport();\n var window = getWindow();\n var platform = window.navigator.platform;\n var ua = userAgent || window.navigator.userAgent;\n var device = {\n ios: false,\n android: false\n };\n var screenWidth = window.screen.width;\n var screenHeight = window.screen.height;\n var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/); // eslint-disable-line\n\n var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n var iphone = !ipad && ua.match(/(iPhone\\sOS|iOS)\\s([\\d_]+)/);\n var windows = platform === 'Win32';\n var macos = platform === 'MacIntel'; // iPadOs 13 fix\n\n var iPadScreens = ['1024x1366', '1366x1024', '834x1194', '1194x834', '834x1112', '1112x834', '768x1024', '1024x768', '820x1180', '1180x820', '810x1080', '1080x810'];\n\n if (!ipad && macos && support.touch && iPadScreens.indexOf(screenWidth + \"x\" + screenHeight) >= 0) {\n ipad = ua.match(/(Version)\\/([\\d.]+)/);\n if (!ipad) ipad = [0, 1, '13_0_0'];\n macos = false;\n } // Android\n\n\n if (android && !windows) {\n device.os = 'android';\n device.android = true;\n }\n\n if (ipad || iphone || ipod) {\n device.os = 'ios';\n device.ios = true;\n } // Export object\n\n\n return device;\n}\n\nfunction getDevice(overrides) {\n if (overrides === void 0) {\n overrides = {};\n }\n\n if (!device) {\n device = calcDevice(overrides);\n }\n\n return device;\n}\n\nexport { getDevice };", "import { getWindow } from 'ssr-window';\nvar browser;\n\nfunction calcBrowser() {\n var window = getWindow();\n\n function isSafari() {\n var ua = window.navigator.userAgent.toLowerCase();\n return ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0;\n }\n\n return {\n isEdge: !!window.navigator.userAgent.match(/Edge/g),\n isSafari: isSafari(),\n isWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent)\n };\n}\n\nfunction getBrowser() {\n if (!browser) {\n browser = calcBrowser();\n }\n\n return browser;\n}\n\nexport { getBrowser };", "import { getWindow } from 'ssr-window';\nimport { extend } from '../../utils/utils';\n\nvar supportsResizeObserver = function supportsResizeObserver() {\n var window = getWindow();\n return typeof window.ResizeObserver !== 'undefined';\n};\n\nexport default {\n name: 'resize',\n create: function create() {\n var swiper = this;\n extend(swiper, {\n resize: {\n observer: null,\n createObserver: function createObserver() {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n swiper.resize.observer = new ResizeObserver(function (entries) {\n var width = swiper.width,\n height = swiper.height;\n var newWidth = width;\n var newHeight = height;\n entries.forEach(function (_ref) {\n var contentBoxSize = _ref.contentBoxSize,\n contentRect = _ref.contentRect,\n target = _ref.target;\n if (target && target !== swiper.el) return;\n newWidth = contentRect ? contentRect.width : (contentBoxSize[0] || contentBoxSize).inlineSize;\n newHeight = contentRect ? contentRect.height : (contentBoxSize[0] || contentBoxSize).blockSize;\n });\n\n if (newWidth !== width || newHeight !== height) {\n swiper.resize.resizeHandler();\n }\n });\n swiper.resize.observer.observe(swiper.el);\n },\n removeObserver: function removeObserver() {\n if (swiper.resize.observer && swiper.resize.observer.unobserve && swiper.el) {\n swiper.resize.observer.unobserve(swiper.el);\n swiper.resize.observer = null;\n }\n },\n resizeHandler: function resizeHandler() {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n swiper.emit('beforeResize');\n swiper.emit('resize');\n },\n orientationChangeHandler: function orientationChangeHandler() {\n if (!swiper || swiper.destroyed || !swiper.initialized) return;\n swiper.emit('orientationchange');\n }\n }\n });\n },\n on: {\n init: function init(swiper) {\n var window = getWindow();\n\n if (swiper.params.resizeObserver && supportsResizeObserver()) {\n swiper.resize.createObserver();\n return;\n } // Emit resize\n\n\n window.addEventListener('resize', swiper.resize.resizeHandler); // Emit orientationchange\n\n window.addEventListener('orientationchange', swiper.resize.orientationChangeHandler);\n },\n destroy: function destroy(swiper) {\n var window = getWindow();\n swiper.resize.removeObserver();\n window.removeEventListener('resize', swiper.resize.resizeHandler);\n window.removeEventListener('orientationchange', swiper.resize.orientationChangeHandler);\n }\n }\n};", "function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport { getWindow } from 'ssr-window';\nimport { bindModuleMethods } from '../../utils/utils';\nvar Observer = {\n attach: function attach(target, options) {\n if (options === void 0) {\n options = {};\n }\n\n var window = getWindow();\n var swiper = this;\n var ObserverFunc = window.MutationObserver || window.WebkitMutationObserver;\n var observer = new ObserverFunc(function (mutations) {\n // The observerUpdate event should only be triggered\n // once despite the number of mutations. Additional\n // triggers are redundant and are very costly\n if (mutations.length === 1) {\n swiper.emit('observerUpdate', mutations[0]);\n return;\n }\n\n var observerUpdate = function observerUpdate() {\n swiper.emit('observerUpdate', mutations[0]);\n };\n\n if (window.requestAnimationFrame) {\n window.requestAnimationFrame(observerUpdate);\n } else {\n window.setTimeout(observerUpdate, 0);\n }\n });\n observer.observe(target, {\n attributes: typeof options.attributes === 'undefined' ? true : options.attributes,\n childList: typeof options.childList === 'undefined' ? true : options.childList,\n characterData: typeof options.characterData === 'undefined' ? true : options.characterData\n });\n swiper.observer.observers.push(observer);\n },\n init: function init() {\n var swiper = this;\n if (!swiper.support.observer || !swiper.params.observer) return;\n\n if (swiper.params.observeParents) {\n var containerParents = swiper.$el.parents();\n\n for (var i = 0; i < containerParents.length; i += 1) {\n swiper.observer.attach(containerParents[i]);\n }\n } // Observe container\n\n\n swiper.observer.attach(swiper.$el[0], {\n childList: swiper.params.observeSlideChildren\n }); // Observe wrapper\n\n swiper.observer.attach(swiper.$wrapperEl[0], {\n attributes: false\n });\n },\n destroy: function destroy() {\n var swiper = this;\n swiper.observer.observers.forEach(function (observer) {\n observer.disconnect();\n });\n swiper.observer.observers = [];\n }\n};\nexport default {\n name: 'observer',\n params: {\n observer: false,\n observeParents: false,\n observeSlideChildren: false\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n observer: _extends({}, Observer, {\n observers: []\n })\n });\n },\n on: {\n init: function init(swiper) {\n swiper.observer.init();\n },\n destroy: function destroy(swiper) {\n swiper.observer.destroy();\n }\n }\n};", "import { extend } from '../../utils/utils';\nexport default {\n useParams: function useParams(instanceParams) {\n var instance = this;\n if (!instance.modules) return;\n Object.keys(instance.modules).forEach(function (moduleName) {\n var module = instance.modules[moduleName]; // Extend params\n\n if (module.params) {\n extend(instanceParams, module.params);\n }\n });\n },\n useModules: function useModules(modulesParams) {\n if (modulesParams === void 0) {\n modulesParams = {};\n }\n\n var instance = this;\n if (!instance.modules) return;\n Object.keys(instance.modules).forEach(function (moduleName) {\n var module = instance.modules[moduleName];\n var moduleParams = modulesParams[moduleName] || {}; // Add event listeners\n\n if (module.on && instance.on) {\n Object.keys(module.on).forEach(function (moduleEventName) {\n instance.on(moduleEventName, module.on[moduleEventName]);\n });\n } // Module create callback\n\n\n if (module.create) {\n module.create.bind(instance)(moduleParams);\n }\n });\n }\n};", "/* eslint-disable no-underscore-dangle */\nexport default {\n on: function on(events, handler, priority) {\n var self = this;\n if (typeof handler !== 'function') return self;\n var method = priority ? 'unshift' : 'push';\n events.split(' ').forEach(function (event) {\n if (!self.eventsListeners[event]) self.eventsListeners[event] = [];\n self.eventsListeners[event][method](handler);\n });\n return self;\n },\n once: function once(events, handler, priority) {\n var self = this;\n if (typeof handler !== 'function') return self;\n\n function onceHandler() {\n self.off(events, onceHandler);\n\n if (onceHandler.__emitterProxy) {\n delete onceHandler.__emitterProxy;\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n handler.apply(self, args);\n }\n\n onceHandler.__emitterProxy = handler;\n return self.on(events, onceHandler, priority);\n },\n onAny: function onAny(handler, priority) {\n var self = this;\n if (typeof handler !== 'function') return self;\n var method = priority ? 'unshift' : 'push';\n\n if (self.eventsAnyListeners.indexOf(handler) < 0) {\n self.eventsAnyListeners[method](handler);\n }\n\n return self;\n },\n offAny: function offAny(handler) {\n var self = this;\n if (!self.eventsAnyListeners) return self;\n var index = self.eventsAnyListeners.indexOf(handler);\n\n if (index >= 0) {\n self.eventsAnyListeners.splice(index, 1);\n }\n\n return self;\n },\n off: function off(events, handler) {\n var self = this;\n if (!self.eventsListeners) return self;\n events.split(' ').forEach(function (event) {\n if (typeof handler === 'undefined') {\n self.eventsListeners[event] = [];\n } else if (self.eventsListeners[event]) {\n self.eventsListeners[event].forEach(function (eventHandler, index) {\n if (eventHandler === handler || eventHandler.__emitterProxy && eventHandler.__emitterProxy === handler) {\n self.eventsListeners[event].splice(index, 1);\n }\n });\n }\n });\n return self;\n },\n emit: function emit() {\n var self = this;\n if (!self.eventsListeners) return self;\n var events;\n var data;\n var context;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n if (typeof args[0] === 'string' || Array.isArray(args[0])) {\n events = args[0];\n data = args.slice(1, args.length);\n context = self;\n } else {\n events = args[0].events;\n data = args[0].data;\n context = args[0].context || self;\n }\n\n data.unshift(context);\n var eventsArray = Array.isArray(events) ? events : events.split(' ');\n eventsArray.forEach(function (event) {\n if (self.eventsAnyListeners && self.eventsAnyListeners.length) {\n self.eventsAnyListeners.forEach(function (eventHandler) {\n eventHandler.apply(context, [event].concat(data));\n });\n }\n\n if (self.eventsListeners && self.eventsListeners[event]) {\n self.eventsListeners[event].forEach(function (eventHandler) {\n eventHandler.apply(context, data);\n });\n }\n });\n return self;\n }\n};", "import { extend } from '../../../utils/utils';\nexport default function updateSize() {\n var swiper = this;\n var width;\n var height;\n var $el = swiper.$el;\n\n if (typeof swiper.params.width !== 'undefined' && swiper.params.width !== null) {\n width = swiper.params.width;\n } else {\n width = $el[0].clientWidth;\n }\n\n if (typeof swiper.params.height !== 'undefined' && swiper.params.height !== null) {\n height = swiper.params.height;\n } else {\n height = $el[0].clientHeight;\n }\n\n if (width === 0 && swiper.isHorizontal() || height === 0 && swiper.isVertical()) {\n return;\n } // Subtract paddings\n\n\n width = width - parseInt($el.css('padding-left') || 0, 10) - parseInt($el.css('padding-right') || 0, 10);\n height = height - parseInt($el.css('padding-top') || 0, 10) - parseInt($el.css('padding-bottom') || 0, 10);\n if (Number.isNaN(width)) width = 0;\n if (Number.isNaN(height)) height = 0;\n extend(swiper, {\n width: width,\n height: height,\n size: swiper.isHorizontal() ? width : height\n });\n}", "import { extend } from '../../../utils/utils';\nexport default function updateSlides() {\n var swiper = this;\n\n function getDirectionLabel(property) {\n if (swiper.isHorizontal()) {\n return property;\n } // prettier-ignore\n\n\n return {\n 'width': 'height',\n 'margin-top': 'margin-left',\n 'margin-bottom ': 'margin-right',\n 'margin-left': 'margin-top',\n 'margin-right': 'margin-bottom',\n 'padding-left': 'padding-top',\n 'padding-right': 'padding-bottom',\n 'marginRight': 'marginBottom'\n }[property];\n }\n\n function getDirectionPropertyValue(node, label) {\n return parseFloat(node.getPropertyValue(getDirectionLabel(label)) || 0);\n }\n\n var params = swiper.params;\n var $wrapperEl = swiper.$wrapperEl,\n swiperSize = swiper.size,\n rtl = swiper.rtlTranslate,\n wrongRTL = swiper.wrongRTL;\n var isVirtual = swiper.virtual && params.virtual.enabled;\n var previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;\n var slides = $wrapperEl.children(\".\" + swiper.params.slideClass);\n var slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;\n var snapGrid = [];\n var slidesGrid = [];\n var slidesSizesGrid = [];\n var offsetBefore = params.slidesOffsetBefore;\n\n if (typeof offsetBefore === 'function') {\n offsetBefore = params.slidesOffsetBefore.call(swiper);\n }\n\n var offsetAfter = params.slidesOffsetAfter;\n\n if (typeof offsetAfter === 'function') {\n offsetAfter = params.slidesOffsetAfter.call(swiper);\n }\n\n var previousSnapGridLength = swiper.snapGrid.length;\n var previousSlidesGridLength = swiper.slidesGrid.length;\n var spaceBetween = params.spaceBetween;\n var slidePosition = -offsetBefore;\n var prevSlideSize = 0;\n var index = 0;\n\n if (typeof swiperSize === 'undefined') {\n return;\n }\n\n if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {\n spaceBetween = parseFloat(spaceBetween.replace('%', '')) / 100 * swiperSize;\n }\n\n swiper.virtualSize = -spaceBetween; // reset margins\n\n if (rtl) slides.css({\n marginLeft: '',\n marginBottom: '',\n marginTop: ''\n });else slides.css({\n marginRight: '',\n marginBottom: '',\n marginTop: ''\n });\n var slidesNumberEvenToRows;\n\n if (params.slidesPerColumn > 1) {\n if (Math.floor(slidesLength / params.slidesPerColumn) === slidesLength / swiper.params.slidesPerColumn) {\n slidesNumberEvenToRows = slidesLength;\n } else {\n slidesNumberEvenToRows = Math.ceil(slidesLength / params.slidesPerColumn) * params.slidesPerColumn;\n }\n\n if (params.slidesPerView !== 'auto' && params.slidesPerColumnFill === 'row') {\n slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, params.slidesPerView * params.slidesPerColumn);\n }\n } // Calc slides\n\n\n var slideSize;\n var slidesPerColumn = params.slidesPerColumn;\n var slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;\n var numFullColumns = Math.floor(slidesLength / params.slidesPerColumn);\n\n for (var i = 0; i < slidesLength; i += 1) {\n slideSize = 0;\n var slide = slides.eq(i);\n\n if (params.slidesPerColumn > 1) {\n // Set slides order\n var newSlideOrderIndex = void 0;\n var column = void 0;\n var row = void 0;\n\n if (params.slidesPerColumnFill === 'row' && params.slidesPerGroup > 1) {\n var groupIndex = Math.floor(i / (params.slidesPerGroup * params.slidesPerColumn));\n var slideIndexInGroup = i - params.slidesPerColumn * params.slidesPerGroup * groupIndex;\n var columnsInGroup = groupIndex === 0 ? params.slidesPerGroup : Math.min(Math.ceil((slidesLength - groupIndex * slidesPerColumn * params.slidesPerGroup) / slidesPerColumn), params.slidesPerGroup);\n row = Math.floor(slideIndexInGroup / columnsInGroup);\n column = slideIndexInGroup - row * columnsInGroup + groupIndex * params.slidesPerGroup;\n newSlideOrderIndex = column + row * slidesNumberEvenToRows / slidesPerColumn;\n slide.css({\n '-webkit-box-ordinal-group': newSlideOrderIndex,\n '-moz-box-ordinal-group': newSlideOrderIndex,\n '-ms-flex-order': newSlideOrderIndex,\n '-webkit-order': newSlideOrderIndex,\n order: newSlideOrderIndex\n });\n } else if (params.slidesPerColumnFill === 'column') {\n column = Math.floor(i / slidesPerColumn);\n row = i - column * slidesPerColumn;\n\n if (column > numFullColumns || column === numFullColumns && row === slidesPerColumn - 1) {\n row += 1;\n\n if (row >= slidesPerColumn) {\n row = 0;\n column += 1;\n }\n }\n } else {\n row = Math.floor(i / slidesPerRow);\n column = i - row * slidesPerRow;\n }\n\n slide.css(getDirectionLabel('margin-top'), row !== 0 ? params.spaceBetween && params.spaceBetween + \"px\" : '');\n }\n\n if (slide.css('display') === 'none') continue; // eslint-disable-line\n\n if (params.slidesPerView === 'auto') {\n var slideStyles = getComputedStyle(slide[0]);\n var currentTransform = slide[0].style.transform;\n var currentWebKitTransform = slide[0].style.webkitTransform;\n\n if (currentTransform) {\n slide[0].style.transform = 'none';\n }\n\n if (currentWebKitTransform) {\n slide[0].style.webkitTransform = 'none';\n }\n\n if (params.roundLengths) {\n slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);\n } else {\n // eslint-disable-next-line\n var width = getDirectionPropertyValue(slideStyles, 'width');\n var paddingLeft = getDirectionPropertyValue(slideStyles, 'padding-left');\n var paddingRight = getDirectionPropertyValue(slideStyles, 'padding-right');\n var marginLeft = getDirectionPropertyValue(slideStyles, 'margin-left');\n var marginRight = getDirectionPropertyValue(slideStyles, 'margin-right');\n var boxSizing = slideStyles.getPropertyValue('box-sizing');\n\n if (boxSizing && boxSizing === 'border-box') {\n slideSize = width + marginLeft + marginRight;\n } else {\n var _slide$ = slide[0],\n clientWidth = _slide$.clientWidth,\n offsetWidth = _slide$.offsetWidth;\n slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight + (offsetWidth - clientWidth);\n }\n }\n\n if (currentTransform) {\n slide[0].style.transform = currentTransform;\n }\n\n if (currentWebKitTransform) {\n slide[0].style.webkitTransform = currentWebKitTransform;\n }\n\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n } else {\n slideSize = (swiperSize - (params.slidesPerView - 1) * spaceBetween) / params.slidesPerView;\n if (params.roundLengths) slideSize = Math.floor(slideSize);\n\n if (slides[i]) {\n slides[i].style[getDirectionLabel('width')] = slideSize + \"px\";\n }\n }\n\n if (slides[i]) {\n slides[i].swiperSlideSize = slideSize;\n }\n\n slidesSizesGrid.push(slideSize);\n\n if (params.centeredSlides) {\n slidePosition = slidePosition + slideSize / 2 + prevSlideSize / 2 + spaceBetween;\n if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;\n if (i === 0) slidePosition = slidePosition - swiperSize / 2 - spaceBetween;\n if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if (index % params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n } else {\n if (params.roundLengths) slidePosition = Math.floor(slidePosition);\n if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);\n slidesGrid.push(slidePosition);\n slidePosition = slidePosition + slideSize + spaceBetween;\n }\n\n swiper.virtualSize += slideSize + spaceBetween;\n prevSlideSize = slideSize;\n index += 1;\n }\n\n swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;\n var newSlidesGrid;\n\n if (rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {\n $wrapperEl.css({\n width: swiper.virtualSize + params.spaceBetween + \"px\"\n });\n }\n\n if (params.setWrapperSize) {\n var _$wrapperEl$css;\n\n $wrapperEl.css((_$wrapperEl$css = {}, _$wrapperEl$css[getDirectionLabel('width')] = swiper.virtualSize + params.spaceBetween + \"px\", _$wrapperEl$css));\n }\n\n if (params.slidesPerColumn > 1) {\n var _$wrapperEl$css2;\n\n swiper.virtualSize = (slideSize + params.spaceBetween) * slidesNumberEvenToRows;\n swiper.virtualSize = Math.ceil(swiper.virtualSize / params.slidesPerColumn) - params.spaceBetween;\n $wrapperEl.css((_$wrapperEl$css2 = {}, _$wrapperEl$css2[getDirectionLabel('width')] = swiper.virtualSize + params.spaceBetween + \"px\", _$wrapperEl$css2));\n\n if (params.centeredSlides) {\n newSlidesGrid = [];\n\n for (var _i = 0; _i < snapGrid.length; _i += 1) {\n var slidesGridItem = snapGrid[_i];\n if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);\n if (snapGrid[_i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);\n }\n\n snapGrid = newSlidesGrid;\n }\n } // Remove last grid elements depending on width\n\n\n if (!params.centeredSlides) {\n newSlidesGrid = [];\n\n for (var _i2 = 0; _i2 < snapGrid.length; _i2 += 1) {\n var _slidesGridItem = snapGrid[_i2];\n if (params.roundLengths) _slidesGridItem = Math.floor(_slidesGridItem);\n\n if (snapGrid[_i2] <= swiper.virtualSize - swiperSize) {\n newSlidesGrid.push(_slidesGridItem);\n }\n }\n\n snapGrid = newSlidesGrid;\n\n if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {\n snapGrid.push(swiper.virtualSize - swiperSize);\n }\n }\n\n if (snapGrid.length === 0) snapGrid = [0];\n\n if (params.spaceBetween !== 0) {\n var _slides$filter$css;\n\n var key = swiper.isHorizontal() && rtl ? 'marginLeft' : getDirectionLabel('marginRight');\n slides.filter(function (_, slideIndex) {\n if (!params.cssMode) return true;\n\n if (slideIndex === slides.length - 1) {\n return false;\n }\n\n return true;\n }).css((_slides$filter$css = {}, _slides$filter$css[key] = spaceBetween + \"px\", _slides$filter$css));\n }\n\n if (params.centeredSlides && params.centeredSlidesBounds) {\n var allSlidesSize = 0;\n slidesSizesGrid.forEach(function (slideSizeValue) {\n allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);\n });\n allSlidesSize -= params.spaceBetween;\n var maxSnap = allSlidesSize - swiperSize;\n snapGrid = snapGrid.map(function (snap) {\n if (snap < 0) return -offsetBefore;\n if (snap > maxSnap) return maxSnap + offsetAfter;\n return snap;\n });\n }\n\n if (params.centerInsufficientSlides) {\n var _allSlidesSize = 0;\n slidesSizesGrid.forEach(function (slideSizeValue) {\n _allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);\n });\n _allSlidesSize -= params.spaceBetween;\n\n if (_allSlidesSize < swiperSize) {\n var allSlidesOffset = (swiperSize - _allSlidesSize) / 2;\n snapGrid.forEach(function (snap, snapIndex) {\n snapGrid[snapIndex] = snap - allSlidesOffset;\n });\n slidesGrid.forEach(function (snap, snapIndex) {\n slidesGrid[snapIndex] = snap + allSlidesOffset;\n });\n }\n }\n\n extend(swiper, {\n slides: slides,\n snapGrid: snapGrid,\n slidesGrid: slidesGrid,\n slidesSizesGrid: slidesSizesGrid\n });\n\n if (slidesLength !== previousSlidesLength) {\n swiper.emit('slidesLengthChange');\n }\n\n if (snapGrid.length !== previousSnapGridLength) {\n if (swiper.params.watchOverflow) swiper.checkOverflow();\n swiper.emit('snapGridLengthChange');\n }\n\n if (slidesGrid.length !== previousSlidesGridLength) {\n swiper.emit('slidesGridLengthChange');\n }\n\n if (params.watchSlidesProgress || params.watchSlidesVisibility) {\n swiper.updateSlidesOffset();\n }\n}", "export default function updateAutoHeight(speed) {\n var swiper = this;\n var activeSlides = [];\n var isVirtual = swiper.virtual && swiper.params.virtual.enabled;\n var newHeight = 0;\n var i;\n\n if (typeof speed === 'number') {\n swiper.setTransition(speed);\n } else if (speed === true) {\n swiper.setTransition(swiper.params.speed);\n }\n\n var getSlideByIndex = function getSlideByIndex(index) {\n if (isVirtual) {\n return swiper.slides.filter(function (el) {\n return parseInt(el.getAttribute('data-swiper-slide-index'), 10) === index;\n })[0];\n }\n\n return swiper.slides.eq(index)[0];\n }; // Find slides currently in view\n\n\n if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {\n if (swiper.params.centeredSlides) {\n swiper.visibleSlides.each(function (slide) {\n activeSlides.push(slide);\n });\n } else {\n for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {\n var index = swiper.activeIndex + i;\n if (index > swiper.slides.length && !isVirtual) break;\n activeSlides.push(getSlideByIndex(index));\n }\n }\n } else {\n activeSlides.push(getSlideByIndex(swiper.activeIndex));\n } // Find new height from highest slide in view\n\n\n for (i = 0; i < activeSlides.length; i += 1) {\n if (typeof activeSlides[i] !== 'undefined') {\n var height = activeSlides[i].offsetHeight;\n newHeight = height > newHeight ? height : newHeight;\n }\n } // Update Height\n\n\n if (newHeight) swiper.$wrapperEl.css('height', newHeight + \"px\");\n}", "export default function updateSlidesOffset() {\n var swiper = this;\n var slides = swiper.slides;\n\n for (var i = 0; i < slides.length; i += 1) {\n slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;\n }\n}", "import $ from '../../../utils/dom';\nexport default function updateSlidesProgress(translate) {\n if (translate === void 0) {\n translate = this && this.translate || 0;\n }\n\n var swiper = this;\n var params = swiper.params;\n var slides = swiper.slides,\n rtl = swiper.rtlTranslate;\n if (slides.length === 0) return;\n if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();\n var offsetCenter = -translate;\n if (rtl) offsetCenter = translate; // Visible Slides\n\n slides.removeClass(params.slideVisibleClass);\n swiper.visibleSlidesIndexes = [];\n swiper.visibleSlides = [];\n\n for (var i = 0; i < slides.length; i += 1) {\n var slide = slides[i];\n var slideProgress = (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0) - slide.swiperSlideOffset) / (slide.swiperSlideSize + params.spaceBetween);\n\n if (params.watchSlidesVisibility || params.centeredSlides && params.autoHeight) {\n var slideBefore = -(offsetCenter - slide.swiperSlideOffset);\n var slideAfter = slideBefore + swiper.slidesSizesGrid[i];\n var isVisible = slideBefore >= 0 && slideBefore < swiper.size - 1 || slideAfter > 1 && slideAfter <= swiper.size || slideBefore <= 0 && slideAfter >= swiper.size;\n\n if (isVisible) {\n swiper.visibleSlides.push(slide);\n swiper.visibleSlidesIndexes.push(i);\n slides.eq(i).addClass(params.slideVisibleClass);\n }\n }\n\n slide.progress = rtl ? -slideProgress : slideProgress;\n }\n\n swiper.visibleSlides = $(swiper.visibleSlides);\n}", "import { extend } from '../../../utils/utils';\nexport default function updateProgress(translate) {\n var swiper = this;\n\n if (typeof translate === 'undefined') {\n var multiplier = swiper.rtlTranslate ? -1 : 1; // eslint-disable-next-line\n\n translate = swiper && swiper.translate && swiper.translate * multiplier || 0;\n }\n\n var params = swiper.params;\n var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n var progress = swiper.progress,\n isBeginning = swiper.isBeginning,\n isEnd = swiper.isEnd;\n var wasBeginning = isBeginning;\n var wasEnd = isEnd;\n\n if (translatesDiff === 0) {\n progress = 0;\n isBeginning = true;\n isEnd = true;\n } else {\n progress = (translate - swiper.minTranslate()) / translatesDiff;\n isBeginning = progress <= 0;\n isEnd = progress >= 1;\n }\n\n extend(swiper, {\n progress: progress,\n isBeginning: isBeginning,\n isEnd: isEnd\n });\n if (params.watchSlidesProgress || params.watchSlidesVisibility || params.centeredSlides && params.autoHeight) swiper.updateSlidesProgress(translate);\n\n if (isBeginning && !wasBeginning) {\n swiper.emit('reachBeginning toEdge');\n }\n\n if (isEnd && !wasEnd) {\n swiper.emit('reachEnd toEdge');\n }\n\n if (wasBeginning && !isBeginning || wasEnd && !isEnd) {\n swiper.emit('fromEdge');\n }\n\n swiper.emit('progress', progress);\n}", "export default function updateSlidesClasses() {\n var swiper = this;\n var slides = swiper.slides,\n params = swiper.params,\n $wrapperEl = swiper.$wrapperEl,\n activeIndex = swiper.activeIndex,\n realIndex = swiper.realIndex;\n var isVirtual = swiper.virtual && params.virtual.enabled;\n slides.removeClass(params.slideActiveClass + \" \" + params.slideNextClass + \" \" + params.slidePrevClass + \" \" + params.slideDuplicateActiveClass + \" \" + params.slideDuplicateNextClass + \" \" + params.slideDuplicatePrevClass);\n var activeSlide;\n\n if (isVirtual) {\n activeSlide = swiper.$wrapperEl.find(\".\" + params.slideClass + \"[data-swiper-slide-index=\\\"\" + activeIndex + \"\\\"]\");\n } else {\n activeSlide = slides.eq(activeIndex);\n } // Active classes\n\n\n activeSlide.addClass(params.slideActiveClass);\n\n if (params.loop) {\n // Duplicate to all looped slides\n if (activeSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl.children(\".\" + params.slideClass + \":not(.\" + params.slideDuplicateClass + \")[data-swiper-slide-index=\\\"\" + realIndex + \"\\\"]\").addClass(params.slideDuplicateActiveClass);\n } else {\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass + \"[data-swiper-slide-index=\\\"\" + realIndex + \"\\\"]\").addClass(params.slideDuplicateActiveClass);\n }\n } // Next Slide\n\n\n var nextSlide = activeSlide.nextAll(\".\" + params.slideClass).eq(0).addClass(params.slideNextClass);\n\n if (params.loop && nextSlide.length === 0) {\n nextSlide = slides.eq(0);\n nextSlide.addClass(params.slideNextClass);\n } // Prev Slide\n\n\n var prevSlide = activeSlide.prevAll(\".\" + params.slideClass).eq(0).addClass(params.slidePrevClass);\n\n if (params.loop && prevSlide.length === 0) {\n prevSlide = slides.eq(-1);\n prevSlide.addClass(params.slidePrevClass);\n }\n\n if (params.loop) {\n // Duplicate to all looped slides\n if (nextSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl.children(\".\" + params.slideClass + \":not(.\" + params.slideDuplicateClass + \")[data-swiper-slide-index=\\\"\" + nextSlide.attr('data-swiper-slide-index') + \"\\\"]\").addClass(params.slideDuplicateNextClass);\n } else {\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass + \"[data-swiper-slide-index=\\\"\" + nextSlide.attr('data-swiper-slide-index') + \"\\\"]\").addClass(params.slideDuplicateNextClass);\n }\n\n if (prevSlide.hasClass(params.slideDuplicateClass)) {\n $wrapperEl.children(\".\" + params.slideClass + \":not(.\" + params.slideDuplicateClass + \")[data-swiper-slide-index=\\\"\" + prevSlide.attr('data-swiper-slide-index') + \"\\\"]\").addClass(params.slideDuplicatePrevClass);\n } else {\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass + \"[data-swiper-slide-index=\\\"\" + prevSlide.attr('data-swiper-slide-index') + \"\\\"]\").addClass(params.slideDuplicatePrevClass);\n }\n }\n\n swiper.emitSlidesClasses();\n}", "import { extend } from '../../../utils/utils';\nexport default function updateActiveIndex(newActiveIndex) {\n var swiper = this;\n var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n var slidesGrid = swiper.slidesGrid,\n snapGrid = swiper.snapGrid,\n params = swiper.params,\n previousIndex = swiper.activeIndex,\n previousRealIndex = swiper.realIndex,\n previousSnapIndex = swiper.snapIndex;\n var activeIndex = newActiveIndex;\n var snapIndex;\n\n if (typeof activeIndex === 'undefined') {\n for (var i = 0; i < slidesGrid.length; i += 1) {\n if (typeof slidesGrid[i + 1] !== 'undefined') {\n if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - (slidesGrid[i + 1] - slidesGrid[i]) / 2) {\n activeIndex = i;\n } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {\n activeIndex = i + 1;\n }\n } else if (translate >= slidesGrid[i]) {\n activeIndex = i;\n }\n } // Normalize slideIndex\n\n\n if (params.normalizeSlideIndex) {\n if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;\n }\n }\n\n if (snapGrid.indexOf(translate) >= 0) {\n snapIndex = snapGrid.indexOf(translate);\n } else {\n var skip = Math.min(params.slidesPerGroupSkip, activeIndex);\n snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);\n }\n\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n\n if (activeIndex === previousIndex) {\n if (snapIndex !== previousSnapIndex) {\n swiper.snapIndex = snapIndex;\n swiper.emit('snapIndexChange');\n }\n\n return;\n } // Get real index\n\n\n var realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);\n extend(swiper, {\n snapIndex: snapIndex,\n realIndex: realIndex,\n previousIndex: previousIndex,\n activeIndex: activeIndex\n });\n swiper.emit('activeIndexChange');\n swiper.emit('snapIndexChange');\n\n if (previousRealIndex !== realIndex) {\n swiper.emit('realIndexChange');\n }\n\n if (swiper.initialized || swiper.params.runCallbacksOnInit) {\n swiper.emit('slideChange');\n }\n}", "import $ from '../../../utils/dom';\nexport default function updateClickedSlide(e) {\n var swiper = this;\n var params = swiper.params;\n var slide = $(e.target).closest(\".\" + params.slideClass)[0];\n var slideFound = false;\n var slideIndex;\n\n if (slide) {\n for (var i = 0; i < swiper.slides.length; i += 1) {\n if (swiper.slides[i] === slide) {\n slideFound = true;\n slideIndex = i;\n break;\n }\n }\n }\n\n if (slide && slideFound) {\n swiper.clickedSlide = slide;\n\n if (swiper.virtual && swiper.params.virtual.enabled) {\n swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10);\n } else {\n swiper.clickedIndex = slideIndex;\n }\n } else {\n swiper.clickedSlide = undefined;\n swiper.clickedIndex = undefined;\n return;\n }\n\n if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {\n swiper.slideToClickedSlide();\n }\n}", "import updateSize from './updateSize';\nimport updateSlides from './updateSlides';\nimport updateAutoHeight from './updateAutoHeight';\nimport updateSlidesOffset from './updateSlidesOffset';\nimport updateSlidesProgress from './updateSlidesProgress';\nimport updateProgress from './updateProgress';\nimport updateSlidesClasses from './updateSlidesClasses';\nimport updateActiveIndex from './updateActiveIndex';\nimport updateClickedSlide from './updateClickedSlide';\nexport default {\n updateSize: updateSize,\n updateSlides: updateSlides,\n updateAutoHeight: updateAutoHeight,\n updateSlidesOffset: updateSlidesOffset,\n updateSlidesProgress: updateSlidesProgress,\n updateProgress: updateProgress,\n updateSlidesClasses: updateSlidesClasses,\n updateActiveIndex: updateActiveIndex,\n updateClickedSlide: updateClickedSlide\n};", "import { getTranslate } from '../../../utils/utils';\nexport default function getSwiperTranslate(axis) {\n if (axis === void 0) {\n axis = this.isHorizontal() ? 'x' : 'y';\n }\n\n var swiper = this;\n var params = swiper.params,\n rtl = swiper.rtlTranslate,\n translate = swiper.translate,\n $wrapperEl = swiper.$wrapperEl;\n\n if (params.virtualTranslate) {\n return rtl ? -translate : translate;\n }\n\n if (params.cssMode) {\n return translate;\n }\n\n var currentTranslate = getTranslate($wrapperEl[0], axis);\n if (rtl) currentTranslate = -currentTranslate;\n return currentTranslate || 0;\n}", "export default function setTranslate(translate, byController) {\n var swiper = this;\n var rtl = swiper.rtlTranslate,\n params = swiper.params,\n $wrapperEl = swiper.$wrapperEl,\n wrapperEl = swiper.wrapperEl,\n progress = swiper.progress;\n var x = 0;\n var y = 0;\n var z = 0;\n\n if (swiper.isHorizontal()) {\n x = rtl ? -translate : translate;\n } else {\n y = translate;\n }\n\n if (params.roundLengths) {\n x = Math.floor(x);\n y = Math.floor(y);\n }\n\n if (params.cssMode) {\n wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;\n } else if (!params.virtualTranslate) {\n $wrapperEl.transform(\"translate3d(\" + x + \"px, \" + y + \"px, \" + z + \"px)\");\n }\n\n swiper.previousTranslate = swiper.translate;\n swiper.translate = swiper.isHorizontal() ? x : y; // Check if we need to update progress\n\n var newProgress;\n var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (translate - swiper.minTranslate()) / translatesDiff;\n }\n\n if (newProgress !== progress) {\n swiper.updateProgress(translate);\n }\n\n swiper.emit('setTranslate', swiper.translate, byController);\n}", "export default function minTranslate() {\n return -this.snapGrid[0];\n}", "export default function maxTranslate() {\n return -this.snapGrid[this.snapGrid.length - 1];\n}", "export default function translateTo(translate, speed, runCallbacks, translateBounds, internal) {\n if (translate === void 0) {\n translate = 0;\n }\n\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n if (translateBounds === void 0) {\n translateBounds = true;\n }\n\n var swiper = this;\n var params = swiper.params,\n wrapperEl = swiper.wrapperEl;\n\n if (swiper.animating && params.preventInteractionOnTransition) {\n return false;\n }\n\n var minTranslate = swiper.minTranslate();\n var maxTranslate = swiper.maxTranslate();\n var newTranslate;\n if (translateBounds && translate > minTranslate) newTranslate = minTranslate;else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;else newTranslate = translate; // Update progress\n\n swiper.updateProgress(newTranslate);\n\n if (params.cssMode) {\n var isH = swiper.isHorizontal();\n\n if (speed === 0) {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;\n } else {\n // eslint-disable-next-line\n if (wrapperEl.scrollTo) {\n var _wrapperEl$scrollTo;\n\n wrapperEl.scrollTo((_wrapperEl$scrollTo = {}, _wrapperEl$scrollTo[isH ? 'left' : 'top'] = -newTranslate, _wrapperEl$scrollTo.behavior = 'smooth', _wrapperEl$scrollTo));\n } else {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;\n }\n }\n\n return true;\n }\n\n if (speed === 0) {\n swiper.setTransition(0);\n swiper.setTranslate(newTranslate);\n\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionEnd');\n }\n } else {\n swiper.setTransition(speed);\n swiper.setTranslate(newTranslate);\n\n if (runCallbacks) {\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.emit('transitionStart');\n }\n\n if (!swiper.animating) {\n swiper.animating = true;\n\n if (!swiper.onTranslateToWrapperTransitionEnd) {\n swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);\n swiper.onTranslateToWrapperTransitionEnd = null;\n delete swiper.onTranslateToWrapperTransitionEnd;\n\n if (runCallbacks) {\n swiper.emit('transitionEnd');\n }\n };\n }\n\n swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);\n swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);\n }\n }\n\n return true;\n}", "import getTranslate from './getTranslate';\nimport setTranslate from './setTranslate';\nimport minTranslate from './minTranslate';\nimport maxTranslate from './maxTranslate';\nimport translateTo from './translateTo';\nexport default {\n getTranslate: getTranslate,\n setTranslate: setTranslate,\n minTranslate: minTranslate,\n maxTranslate: maxTranslate,\n translateTo: translateTo\n};", "export default function setTransition(duration, byController) {\n var swiper = this;\n\n if (!swiper.params.cssMode) {\n swiper.$wrapperEl.transition(duration);\n }\n\n swiper.emit('setTransition', duration, byController);\n}", "export default function transitionStart(runCallbacks, direction) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var activeIndex = swiper.activeIndex,\n params = swiper.params,\n previousIndex = swiper.previousIndex;\n if (params.cssMode) return;\n\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n\n var dir = direction;\n\n if (!dir) {\n if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';\n }\n\n swiper.emit('transitionStart');\n\n if (runCallbacks && activeIndex !== previousIndex) {\n if (dir === 'reset') {\n swiper.emit('slideResetTransitionStart');\n return;\n }\n\n swiper.emit('slideChangeTransitionStart');\n\n if (dir === 'next') {\n swiper.emit('slideNextTransitionStart');\n } else {\n swiper.emit('slidePrevTransitionStart');\n }\n }\n}", "export default function transitionEnd(runCallbacks, direction) {\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var activeIndex = swiper.activeIndex,\n previousIndex = swiper.previousIndex,\n params = swiper.params;\n swiper.animating = false;\n if (params.cssMode) return;\n swiper.setTransition(0);\n var dir = direction;\n\n if (!dir) {\n if (activeIndex > previousIndex) dir = 'next';else if (activeIndex < previousIndex) dir = 'prev';else dir = 'reset';\n }\n\n swiper.emit('transitionEnd');\n\n if (runCallbacks && activeIndex !== previousIndex) {\n if (dir === 'reset') {\n swiper.emit('slideResetTransitionEnd');\n return;\n }\n\n swiper.emit('slideChangeTransitionEnd');\n\n if (dir === 'next') {\n swiper.emit('slideNextTransitionEnd');\n } else {\n swiper.emit('slidePrevTransitionEnd');\n }\n }\n}", "import setTransition from './setTransition';\nimport transitionStart from './transitionStart';\nimport transitionEnd from './transitionEnd';\nexport default {\n setTransition: setTransition,\n transitionStart: transitionStart,\n transitionEnd: transitionEnd\n};", "export default function slideTo(index, speed, runCallbacks, internal, initial) {\n if (index === void 0) {\n index = 0;\n }\n\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n if (typeof index !== 'number' && typeof index !== 'string') {\n throw new Error(\"The 'index' argument cannot have type other than 'number' or 'string'. [\" + typeof index + \"] given.\");\n }\n\n if (typeof index === 'string') {\n /**\n * The `index` argument converted from `string` to `number`.\n * @type {number}\n */\n var indexAsNumber = parseInt(index, 10);\n /**\n * Determines whether the `index` argument is a valid `number`\n * after being converted from the `string` type.\n * @type {boolean}\n */\n\n var isValidNumber = isFinite(indexAsNumber);\n\n if (!isValidNumber) {\n throw new Error(\"The passed-in 'index' (string) couldn't be converted to 'number'. [\" + index + \"] given.\");\n } // Knowing that the converted `index` is a valid number,\n // we can update the original argument's value.\n\n\n index = indexAsNumber;\n }\n\n var swiper = this;\n var slideIndex = index;\n if (slideIndex < 0) slideIndex = 0;\n var params = swiper.params,\n snapGrid = swiper.snapGrid,\n slidesGrid = swiper.slidesGrid,\n previousIndex = swiper.previousIndex,\n activeIndex = swiper.activeIndex,\n rtl = swiper.rtlTranslate,\n wrapperEl = swiper.wrapperEl,\n enabled = swiper.enabled;\n\n if (swiper.animating && params.preventInteractionOnTransition || !enabled && !internal && !initial) {\n return false;\n }\n\n var skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);\n var snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);\n if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;\n\n if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) {\n swiper.emit('beforeSlideChangeStart');\n }\n\n var translate = -snapGrid[snapIndex]; // Update progress\n\n swiper.updateProgress(translate); // Normalize slideIndex\n\n if (params.normalizeSlideIndex) {\n for (var i = 0; i < slidesGrid.length; i += 1) {\n var normalizedTranslate = -Math.floor(translate * 100);\n var normalizedGird = Math.floor(slidesGrid[i] * 100);\n var normalizedGridNext = Math.floor(slidesGrid[i + 1] * 100);\n\n if (typeof slidesGrid[i + 1] !== 'undefined') {\n if (normalizedTranslate >= normalizedGird && normalizedTranslate < normalizedGridNext - (normalizedGridNext - normalizedGird) / 2) {\n slideIndex = i;\n } else if (normalizedTranslate >= normalizedGird && normalizedTranslate < normalizedGridNext) {\n slideIndex = i + 1;\n }\n } else if (normalizedTranslate >= normalizedGird) {\n slideIndex = i;\n }\n }\n } // Directions locks\n\n\n if (swiper.initialized && slideIndex !== activeIndex) {\n if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {\n return false;\n }\n\n if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {\n if ((activeIndex || 0) !== slideIndex) return false;\n }\n }\n\n var direction;\n if (slideIndex > activeIndex) direction = 'next';else if (slideIndex < activeIndex) direction = 'prev';else direction = 'reset'; // Update Index\n\n if (rtl && -translate === swiper.translate || !rtl && translate === swiper.translate) {\n swiper.updateActiveIndex(slideIndex); // Update Height\n\n if (params.autoHeight) {\n swiper.updateAutoHeight();\n }\n\n swiper.updateSlidesClasses();\n\n if (params.effect !== 'slide') {\n swiper.setTranslate(translate);\n }\n\n if (direction !== 'reset') {\n swiper.transitionStart(runCallbacks, direction);\n swiper.transitionEnd(runCallbacks, direction);\n }\n\n return false;\n }\n\n if (params.cssMode) {\n var isH = swiper.isHorizontal();\n var t = -translate;\n\n if (rtl) {\n t = wrapperEl.scrollWidth - wrapperEl.offsetWidth - t;\n }\n\n if (speed === 0) {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;\n } else {\n // eslint-disable-next-line\n if (wrapperEl.scrollTo) {\n var _wrapperEl$scrollTo;\n\n wrapperEl.scrollTo((_wrapperEl$scrollTo = {}, _wrapperEl$scrollTo[isH ? 'left' : 'top'] = t, _wrapperEl$scrollTo.behavior = 'smooth', _wrapperEl$scrollTo));\n } else {\n wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;\n }\n }\n\n return true;\n }\n\n if (speed === 0) {\n swiper.setTransition(0);\n swiper.setTranslate(translate);\n swiper.updateActiveIndex(slideIndex);\n swiper.updateSlidesClasses();\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.transitionStart(runCallbacks, direction);\n swiper.transitionEnd(runCallbacks, direction);\n } else {\n swiper.setTransition(speed);\n swiper.setTranslate(translate);\n swiper.updateActiveIndex(slideIndex);\n swiper.updateSlidesClasses();\n swiper.emit('beforeTransitionStart', speed, internal);\n swiper.transitionStart(runCallbacks, direction);\n\n if (!swiper.animating) {\n swiper.animating = true;\n\n if (!swiper.onSlideToWrapperTransitionEnd) {\n swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {\n if (!swiper || swiper.destroyed) return;\n if (e.target !== this) return;\n swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);\n swiper.onSlideToWrapperTransitionEnd = null;\n delete swiper.onSlideToWrapperTransitionEnd;\n swiper.transitionEnd(runCallbacks, direction);\n };\n }\n\n swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);\n swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);\n }\n }\n\n return true;\n}", "export default function slideToLoop(index, speed, runCallbacks, internal) {\n if (index === void 0) {\n index = 0;\n }\n\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var newIndex = index;\n\n if (swiper.params.loop) {\n newIndex += swiper.loopedSlides;\n }\n\n return swiper.slideTo(newIndex, speed, runCallbacks, internal);\n}", "/* eslint no-unused-vars: \"off\" */\nexport default function slideNext(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var params = swiper.params,\n animating = swiper.animating,\n enabled = swiper.enabled;\n if (!enabled) return swiper;\n var increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup;\n\n if (params.loop) {\n if (animating && params.loopPreventsSlide) return false;\n swiper.loopFix(); // eslint-disable-next-line\n\n swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;\n }\n\n return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);\n}", "/* eslint no-unused-vars: \"off\" */\nexport default function slidePrev(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n var params = swiper.params,\n animating = swiper.animating,\n snapGrid = swiper.snapGrid,\n slidesGrid = swiper.slidesGrid,\n rtlTranslate = swiper.rtlTranslate,\n enabled = swiper.enabled;\n if (!enabled) return swiper;\n\n if (params.loop) {\n if (animating && params.loopPreventsSlide) return false;\n swiper.loopFix(); // eslint-disable-next-line\n\n swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;\n }\n\n var translate = rtlTranslate ? swiper.translate : -swiper.translate;\n\n function normalize(val) {\n if (val < 0) return -Math.floor(Math.abs(val));\n return Math.floor(val);\n }\n\n var normalizedTranslate = normalize(translate);\n var normalizedSnapGrid = snapGrid.map(function (val) {\n return normalize(val);\n });\n var prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];\n\n if (typeof prevSnap === 'undefined' && params.cssMode) {\n snapGrid.forEach(function (snap) {\n if (!prevSnap && normalizedTranslate >= snap) prevSnap = snap;\n });\n }\n\n var prevIndex;\n\n if (typeof prevSnap !== 'undefined') {\n prevIndex = slidesGrid.indexOf(prevSnap);\n if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;\n }\n\n return swiper.slideTo(prevIndex, speed, runCallbacks, internal);\n}", "/* eslint no-unused-vars: \"off\" */\nexport default function slideReset(speed, runCallbacks, internal) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n var swiper = this;\n return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);\n}", "/* eslint no-unused-vars: \"off\" */\nexport default function slideToClosest(speed, runCallbacks, internal, threshold) {\n if (speed === void 0) {\n speed = this.params.speed;\n }\n\n if (runCallbacks === void 0) {\n runCallbacks = true;\n }\n\n if (threshold === void 0) {\n threshold = 0.5;\n }\n\n var swiper = this;\n var index = swiper.activeIndex;\n var skip = Math.min(swiper.params.slidesPerGroupSkip, index);\n var snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);\n var translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;\n\n if (translate >= swiper.snapGrid[snapIndex]) {\n // The current translate is on or after the current snap index, so the choice\n // is between the current index and the one after it.\n var currentSnap = swiper.snapGrid[snapIndex];\n var nextSnap = swiper.snapGrid[snapIndex + 1];\n\n if (translate - currentSnap > (nextSnap - currentSnap) * threshold) {\n index += swiper.params.slidesPerGroup;\n }\n } else {\n // The current translate is before the current snap index, so the choice\n // is between the current index and the one before it.\n var prevSnap = swiper.snapGrid[snapIndex - 1];\n var _currentSnap = swiper.snapGrid[snapIndex];\n\n if (translate - prevSnap <= (_currentSnap - prevSnap) * threshold) {\n index -= swiper.params.slidesPerGroup;\n }\n }\n\n index = Math.max(index, 0);\n index = Math.min(index, swiper.slidesGrid.length - 1);\n return swiper.slideTo(index, speed, runCallbacks, internal);\n}", "import $ from '../../../utils/dom';\nimport { nextTick } from '../../../utils/utils';\nexport default function slideToClickedSlide() {\n var swiper = this;\n var params = swiper.params,\n $wrapperEl = swiper.$wrapperEl;\n var slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;\n var slideToIndex = swiper.clickedIndex;\n var realIndex;\n\n if (params.loop) {\n if (swiper.animating) return;\n realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);\n\n if (params.centeredSlides) {\n if (slideToIndex < swiper.loopedSlides - slidesPerView / 2 || slideToIndex > swiper.slides.length - swiper.loopedSlides + slidesPerView / 2) {\n swiper.loopFix();\n slideToIndex = $wrapperEl.children(\".\" + params.slideClass + \"[data-swiper-slide-index=\\\"\" + realIndex + \"\\\"]:not(.\" + params.slideDuplicateClass + \")\").eq(0).index();\n nextTick(function () {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else if (slideToIndex > swiper.slides.length - slidesPerView) {\n swiper.loopFix();\n slideToIndex = $wrapperEl.children(\".\" + params.slideClass + \"[data-swiper-slide-index=\\\"\" + realIndex + \"\\\"]:not(.\" + params.slideDuplicateClass + \")\").eq(0).index();\n nextTick(function () {\n swiper.slideTo(slideToIndex);\n });\n } else {\n swiper.slideTo(slideToIndex);\n }\n } else {\n swiper.slideTo(slideToIndex);\n }\n}", "import slideTo from './slideTo';\nimport slideToLoop from './slideToLoop';\nimport slideNext from './slideNext';\nimport slidePrev from './slidePrev';\nimport slideReset from './slideReset';\nimport slideToClosest from './slideToClosest';\nimport slideToClickedSlide from './slideToClickedSlide';\nexport default {\n slideTo: slideTo,\n slideToLoop: slideToLoop,\n slideNext: slideNext,\n slidePrev: slidePrev,\n slideReset: slideReset,\n slideToClosest: slideToClosest,\n slideToClickedSlide: slideToClickedSlide\n};", "import { getDocument } from 'ssr-window';\nimport $ from '../../../utils/dom';\nexport default function loopCreate() {\n var swiper = this;\n var document = getDocument();\n var params = swiper.params,\n $wrapperEl = swiper.$wrapperEl; // Remove duplicated slides\n\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass).remove();\n var slides = $wrapperEl.children(\".\" + params.slideClass);\n\n if (params.loopFillGroupWithBlank) {\n var blankSlidesNum = params.slidesPerGroup - slides.length % params.slidesPerGroup;\n\n if (blankSlidesNum !== params.slidesPerGroup) {\n for (var i = 0; i < blankSlidesNum; i += 1) {\n var blankNode = $(document.createElement('div')).addClass(params.slideClass + \" \" + params.slideBlankClass);\n $wrapperEl.append(blankNode);\n }\n\n slides = $wrapperEl.children(\".\" + params.slideClass);\n }\n }\n\n if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;\n swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));\n swiper.loopedSlides += params.loopAdditionalSlides;\n\n if (swiper.loopedSlides > slides.length) {\n swiper.loopedSlides = slides.length;\n }\n\n var prependSlides = [];\n var appendSlides = [];\n slides.each(function (el, index) {\n var slide = $(el);\n\n if (index < swiper.loopedSlides) {\n appendSlides.push(el);\n }\n\n if (index < slides.length && index >= slides.length - swiper.loopedSlides) {\n prependSlides.push(el);\n }\n\n slide.attr('data-swiper-slide-index', index);\n });\n\n for (var _i = 0; _i < appendSlides.length; _i += 1) {\n $wrapperEl.append($(appendSlides[_i].cloneNode(true)).addClass(params.slideDuplicateClass));\n }\n\n for (var _i2 = prependSlides.length - 1; _i2 >= 0; _i2 -= 1) {\n $wrapperEl.prepend($(prependSlides[_i2].cloneNode(true)).addClass(params.slideDuplicateClass));\n }\n}", "export default function loopFix() {\n var swiper = this;\n swiper.emit('beforeLoopFix');\n var activeIndex = swiper.activeIndex,\n slides = swiper.slides,\n loopedSlides = swiper.loopedSlides,\n allowSlidePrev = swiper.allowSlidePrev,\n allowSlideNext = swiper.allowSlideNext,\n snapGrid = swiper.snapGrid,\n rtl = swiper.rtlTranslate;\n var newIndex;\n swiper.allowSlidePrev = true;\n swiper.allowSlideNext = true;\n var snapTranslate = -snapGrid[activeIndex];\n var diff = snapTranslate - swiper.getTranslate(); // Fix For Negative Oversliding\n\n if (activeIndex < loopedSlides) {\n newIndex = slides.length - loopedSlides * 3 + activeIndex;\n newIndex += loopedSlides;\n var slideChanged = swiper.slideTo(newIndex, 0, false, true);\n\n if (slideChanged && diff !== 0) {\n swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);\n }\n } else if (activeIndex >= slides.length - loopedSlides) {\n // Fix For Positive Oversliding\n newIndex = -slides.length + activeIndex + loopedSlides;\n newIndex += loopedSlides;\n\n var _slideChanged = swiper.slideTo(newIndex, 0, false, true);\n\n if (_slideChanged && diff !== 0) {\n swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);\n }\n }\n\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n swiper.emit('loopFix');\n}", "export default function loopDestroy() {\n var swiper = this;\n var $wrapperEl = swiper.$wrapperEl,\n params = swiper.params,\n slides = swiper.slides;\n $wrapperEl.children(\".\" + params.slideClass + \".\" + params.slideDuplicateClass + \",.\" + params.slideClass + \".\" + params.slideBlankClass).remove();\n slides.removeAttr('data-swiper-slide-index');\n}", "import loopCreate from './loopCreate';\nimport loopFix from './loopFix';\nimport loopDestroy from './loopDestroy';\nexport default {\n loopCreate: loopCreate,\n loopFix: loopFix,\n loopDestroy: loopDestroy\n};", "export default function setGrabCursor(moving) {\n var swiper = this;\n if (swiper.support.touch || !swiper.params.simulateTouch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) return;\n var el = swiper.el;\n el.style.cursor = 'move';\n el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';\n el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';\n el.style.cursor = moving ? 'grabbing' : 'grab';\n}", "export default function unsetGrabCursor() {\n var swiper = this;\n\n if (swiper.support.touch || swiper.params.watchOverflow && swiper.isLocked || swiper.params.cssMode) {\n return;\n }\n\n swiper.el.style.cursor = '';\n}", "import setGrabCursor from './setGrabCursor';\nimport unsetGrabCursor from './unsetGrabCursor';\nexport default {\n setGrabCursor: setGrabCursor,\n unsetGrabCursor: unsetGrabCursor\n};", "export default function appendSlide(slides) {\n var swiper = this;\n var $wrapperEl = swiper.$wrapperEl,\n params = swiper.params;\n\n if (params.loop) {\n swiper.loopDestroy();\n }\n\n if (typeof slides === 'object' && 'length' in slides) {\n for (var i = 0; i < slides.length; i += 1) {\n if (slides[i]) $wrapperEl.append(slides[i]);\n }\n } else {\n $wrapperEl.append(slides);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && swiper.support.observer)) {\n swiper.update();\n }\n}", "export default function prependSlide(slides) {\n var swiper = this;\n var params = swiper.params,\n $wrapperEl = swiper.$wrapperEl,\n activeIndex = swiper.activeIndex;\n\n if (params.loop) {\n swiper.loopDestroy();\n }\n\n var newActiveIndex = activeIndex + 1;\n\n if (typeof slides === 'object' && 'length' in slides) {\n for (var i = 0; i < slides.length; i += 1) {\n if (slides[i]) $wrapperEl.prepend(slides[i]);\n }\n\n newActiveIndex = activeIndex + slides.length;\n } else {\n $wrapperEl.prepend(slides);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && swiper.support.observer)) {\n swiper.update();\n }\n\n swiper.slideTo(newActiveIndex, 0, false);\n}", "export default function addSlide(index, slides) {\n var swiper = this;\n var $wrapperEl = swiper.$wrapperEl,\n params = swiper.params,\n activeIndex = swiper.activeIndex;\n var activeIndexBuffer = activeIndex;\n\n if (params.loop) {\n activeIndexBuffer -= swiper.loopedSlides;\n swiper.loopDestroy();\n swiper.slides = $wrapperEl.children(\".\" + params.slideClass);\n }\n\n var baseLength = swiper.slides.length;\n\n if (index <= 0) {\n swiper.prependSlide(slides);\n return;\n }\n\n if (index >= baseLength) {\n swiper.appendSlide(slides);\n return;\n }\n\n var newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;\n var slidesBuffer = [];\n\n for (var i = baseLength - 1; i >= index; i -= 1) {\n var currentSlide = swiper.slides.eq(i);\n currentSlide.remove();\n slidesBuffer.unshift(currentSlide);\n }\n\n if (typeof slides === 'object' && 'length' in slides) {\n for (var _i = 0; _i < slides.length; _i += 1) {\n if (slides[_i]) $wrapperEl.append(slides[_i]);\n }\n\n newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;\n } else {\n $wrapperEl.append(slides);\n }\n\n for (var _i2 = 0; _i2 < slidesBuffer.length; _i2 += 1) {\n $wrapperEl.append(slidesBuffer[_i2]);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && swiper.support.observer)) {\n swiper.update();\n }\n\n if (params.loop) {\n swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);\n } else {\n swiper.slideTo(newActiveIndex, 0, false);\n }\n}", "export default function removeSlide(slidesIndexes) {\n var swiper = this;\n var params = swiper.params,\n $wrapperEl = swiper.$wrapperEl,\n activeIndex = swiper.activeIndex;\n var activeIndexBuffer = activeIndex;\n\n if (params.loop) {\n activeIndexBuffer -= swiper.loopedSlides;\n swiper.loopDestroy();\n swiper.slides = $wrapperEl.children(\".\" + params.slideClass);\n }\n\n var newActiveIndex = activeIndexBuffer;\n var indexToRemove;\n\n if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {\n for (var i = 0; i < slidesIndexes.length; i += 1) {\n indexToRemove = slidesIndexes[i];\n if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex -= 1;\n }\n\n newActiveIndex = Math.max(newActiveIndex, 0);\n } else {\n indexToRemove = slidesIndexes;\n if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();\n if (indexToRemove < newActiveIndex) newActiveIndex -= 1;\n newActiveIndex = Math.max(newActiveIndex, 0);\n }\n\n if (params.loop) {\n swiper.loopCreate();\n }\n\n if (!(params.observer && swiper.support.observer)) {\n swiper.update();\n }\n\n if (params.loop) {\n swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);\n } else {\n swiper.slideTo(newActiveIndex, 0, false);\n }\n}", "export default function removeAllSlides() {\n var swiper = this;\n var slidesIndexes = [];\n\n for (var i = 0; i < swiper.slides.length; i += 1) {\n slidesIndexes.push(i);\n }\n\n swiper.removeSlide(slidesIndexes);\n}", "import appendSlide from './appendSlide';\nimport prependSlide from './prependSlide';\nimport addSlide from './addSlide';\nimport removeSlide from './removeSlide';\nimport removeAllSlides from './removeAllSlides';\nexport default {\n appendSlide: appendSlide,\n prependSlide: prependSlide,\n addSlide: addSlide,\n removeSlide: removeSlide,\n removeAllSlides: removeAllSlides\n};", "import { getWindow, getDocument } from 'ssr-window';\nimport $ from '../../../utils/dom';\nimport { extend, now } from '../../../utils/utils'; // Modified from https://stackoverflow.com/questions/54520554/custom-element-getrootnode-closest-function-crossing-multiple-parent-shadowd\n\nfunction closestElement(selector, base) {\n if (base === void 0) {\n base = this;\n }\n\n function __closestFrom(el) {\n if (!el || el === getDocument() || el === getWindow()) return null;\n if (el.assignedSlot) el = el.assignedSlot;\n var found = el.closest(selector);\n return found || __closestFrom(el.getRootNode().host);\n }\n\n return __closestFrom(base);\n}\n\nexport default function onTouchStart(event) {\n var swiper = this;\n var document = getDocument();\n var window = getWindow();\n var data = swiper.touchEventsData;\n var params = swiper.params,\n touches = swiper.touches,\n enabled = swiper.enabled;\n if (!enabled) return;\n\n if (swiper.animating && params.preventInteractionOnTransition) {\n return;\n }\n\n var e = event;\n if (e.originalEvent) e = e.originalEvent;\n var $targetEl = $(e.target);\n\n if (params.touchEventsTarget === 'wrapper') {\n if (!$targetEl.closest(swiper.wrapperEl).length) return;\n }\n\n data.isTouchEvent = e.type === 'touchstart';\n if (!data.isTouchEvent && 'which' in e && e.which === 3) return;\n if (!data.isTouchEvent && 'button' in e && e.button > 0) return;\n if (data.isTouched && data.isMoved) return; // change target el for shadow root component\n\n var swipingClassHasValue = !!params.noSwipingClass && params.noSwipingClass !== '';\n\n if (swipingClassHasValue && e.target && e.target.shadowRoot && event.path && event.path[0]) {\n $targetEl = $(event.path[0]);\n }\n\n var noSwipingSelector = params.noSwipingSelector ? params.noSwipingSelector : \".\" + params.noSwipingClass;\n var isTargetShadow = !!(e.target && e.target.shadowRoot); // use closestElement for shadow root element to get the actual closest for nested shadow root element\n\n if (params.noSwiping && (isTargetShadow ? closestElement(noSwipingSelector, e.target) : $targetEl.closest(noSwipingSelector)[0])) {\n swiper.allowClick = true;\n return;\n }\n\n if (params.swipeHandler) {\n if (!$targetEl.closest(params.swipeHandler)[0]) return;\n }\n\n touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;\n touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;\n var startX = touches.currentX;\n var startY = touches.currentY; // Do NOT start if iOS edge swipe is detected. Otherwise iOS app cannot swipe-to-go-back anymore\n\n var edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;\n var edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;\n\n if (edgeSwipeDetection && (startX <= edgeSwipeThreshold || startX >= window.innerWidth - edgeSwipeThreshold)) {\n if (edgeSwipeDetection === 'prevent') {\n event.preventDefault();\n } else {\n return;\n }\n }\n\n extend(data, {\n isTouched: true,\n isMoved: false,\n allowTouchCallbacks: true,\n isScrolling: undefined,\n startMoving: undefined\n });\n touches.startX = startX;\n touches.startY = startY;\n data.touchStartTime = now();\n swiper.allowClick = true;\n swiper.updateSize();\n swiper.swipeDirection = undefined;\n if (params.threshold > 0) data.allowThresholdMove = false;\n\n if (e.type !== 'touchstart') {\n var preventDefault = true;\n if ($targetEl.is(data.focusableElements)) preventDefault = false;\n\n if (document.activeElement && $(document.activeElement).is(data.focusableElements) && document.activeElement !== $targetEl[0]) {\n document.activeElement.blur();\n }\n\n var shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;\n\n if ((params.touchStartForcePreventDefault || shouldPreventDefault) && !$targetEl[0].isContentEditable) {\n e.preventDefault();\n }\n }\n\n swiper.emit('touchStart', e);\n}", "import { getDocument } from 'ssr-window';\nimport $ from '../../../utils/dom';\nimport { extend, now } from '../../../utils/utils';\nexport default function onTouchMove(event) {\n var document = getDocument();\n var swiper = this;\n var data = swiper.touchEventsData;\n var params = swiper.params,\n touches = swiper.touches,\n rtl = swiper.rtlTranslate,\n enabled = swiper.enabled;\n if (!enabled) return;\n var e = event;\n if (e.originalEvent) e = e.originalEvent;\n\n if (!data.isTouched) {\n if (data.startMoving && data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n\n return;\n }\n\n if (data.isTouchEvent && e.type !== 'touchmove') return;\n var targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);\n var pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;\n var pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;\n\n if (e.preventedByNestedSwiper) {\n touches.startX = pageX;\n touches.startY = pageY;\n return;\n }\n\n if (!swiper.allowTouchMove) {\n // isMoved = true;\n swiper.allowClick = false;\n\n if (data.isTouched) {\n extend(touches, {\n startX: pageX,\n startY: pageY,\n currentX: pageX,\n currentY: pageY\n });\n data.touchStartTime = now();\n }\n\n return;\n }\n\n if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {\n if (swiper.isVertical()) {\n // Vertical\n if (pageY < touches.startY && swiper.translate <= swiper.maxTranslate() || pageY > touches.startY && swiper.translate >= swiper.minTranslate()) {\n data.isTouched = false;\n data.isMoved = false;\n return;\n }\n } else if (pageX < touches.startX && swiper.translate <= swiper.maxTranslate() || pageX > touches.startX && swiper.translate >= swiper.minTranslate()) {\n return;\n }\n }\n\n if (data.isTouchEvent && document.activeElement) {\n if (e.target === document.activeElement && $(e.target).is(data.focusableElements)) {\n data.isMoved = true;\n swiper.allowClick = false;\n return;\n }\n }\n\n if (data.allowTouchCallbacks) {\n swiper.emit('touchMove', e);\n }\n\n if (e.targetTouches && e.targetTouches.length > 1) return;\n touches.currentX = pageX;\n touches.currentY = pageY;\n var diffX = touches.currentX - touches.startX;\n var diffY = touches.currentY - touches.startY;\n if (swiper.params.threshold && Math.sqrt(Math.pow(diffX, 2) + Math.pow(diffY, 2)) < swiper.params.threshold) return;\n\n if (typeof data.isScrolling === 'undefined') {\n var touchAngle;\n\n if (swiper.isHorizontal() && touches.currentY === touches.startY || swiper.isVertical() && touches.currentX === touches.startX) {\n data.isScrolling = false;\n } else {\n // eslint-disable-next-line\n if (diffX * diffX + diffY * diffY >= 25) {\n touchAngle = Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180 / Math.PI;\n data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : 90 - touchAngle > params.touchAngle;\n }\n }\n }\n\n if (data.isScrolling) {\n swiper.emit('touchMoveOpposite', e);\n }\n\n if (typeof data.startMoving === 'undefined') {\n if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {\n data.startMoving = true;\n }\n }\n\n if (data.isScrolling) {\n data.isTouched = false;\n return;\n }\n\n if (!data.startMoving) {\n return;\n }\n\n swiper.allowClick = false;\n\n if (!params.cssMode && e.cancelable) {\n e.preventDefault();\n }\n\n if (params.touchMoveStopPropagation && !params.nested) {\n e.stopPropagation();\n }\n\n if (!data.isMoved) {\n if (params.loop) {\n swiper.loopFix();\n }\n\n data.startTranslate = swiper.getTranslate();\n swiper.setTransition(0);\n\n if (swiper.animating) {\n swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');\n }\n\n data.allowMomentumBounce = false; // Grab Cursor\n\n if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(true);\n }\n\n swiper.emit('sliderFirstMove', e);\n }\n\n swiper.emit('sliderMove', e);\n data.isMoved = true;\n var diff = swiper.isHorizontal() ? diffX : diffY;\n touches.diff = diff;\n diff *= params.touchRatio;\n if (rtl) diff = -diff;\n swiper.swipeDirection = diff > 0 ? 'prev' : 'next';\n data.currentTranslate = diff + data.startTranslate;\n var disableParentSwiper = true;\n var resistanceRatio = params.resistanceRatio;\n\n if (params.touchReleaseOnEdges) {\n resistanceRatio = 0;\n }\n\n if (diff > 0 && data.currentTranslate > swiper.minTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) data.currentTranslate = swiper.minTranslate() - 1 + Math.pow(-swiper.minTranslate() + data.startTranslate + diff, resistanceRatio);\n } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {\n disableParentSwiper = false;\n if (params.resistance) data.currentTranslate = swiper.maxTranslate() + 1 - Math.pow(swiper.maxTranslate() - data.startTranslate - diff, resistanceRatio);\n }\n\n if (disableParentSwiper) {\n e.preventedByNestedSwiper = true;\n } // Directions locks\n\n\n if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n\n if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {\n data.currentTranslate = data.startTranslate;\n }\n\n if (!swiper.allowSlidePrev && !swiper.allowSlideNext) {\n data.currentTranslate = data.startTranslate;\n } // Threshold\n\n\n if (params.threshold > 0) {\n if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {\n if (!data.allowThresholdMove) {\n data.allowThresholdMove = true;\n touches.startX = touches.currentX;\n touches.startY = touches.currentY;\n data.currentTranslate = data.startTranslate;\n touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;\n return;\n }\n } else {\n data.currentTranslate = data.startTranslate;\n return;\n }\n }\n\n if (!params.followFinger || params.cssMode) return; // Update active index in free mode\n\n if (params.freeMode || params.watchSlidesProgress || params.watchSlidesVisibility) {\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n\n if (params.freeMode) {\n // Velocity\n if (data.velocities.length === 0) {\n data.velocities.push({\n position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],\n time: data.touchStartTime\n });\n }\n\n data.velocities.push({\n position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],\n time: now()\n });\n } // Update progress\n\n\n swiper.updateProgress(data.currentTranslate); // Update translate\n\n swiper.setTranslate(data.currentTranslate);\n}", "import { now, nextTick } from '../../../utils/utils';\nexport default function onTouchEnd(event) {\n var swiper = this;\n var data = swiper.touchEventsData;\n var params = swiper.params,\n touches = swiper.touches,\n rtl = swiper.rtlTranslate,\n $wrapperEl = swiper.$wrapperEl,\n slidesGrid = swiper.slidesGrid,\n snapGrid = swiper.snapGrid,\n enabled = swiper.enabled;\n if (!enabled) return;\n var e = event;\n if (e.originalEvent) e = e.originalEvent;\n\n if (data.allowTouchCallbacks) {\n swiper.emit('touchEnd', e);\n }\n\n data.allowTouchCallbacks = false;\n\n if (!data.isTouched) {\n if (data.isMoved && params.grabCursor) {\n swiper.setGrabCursor(false);\n }\n\n data.isMoved = false;\n data.startMoving = false;\n return;\n } // Return Grab Cursor\n\n\n if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {\n swiper.setGrabCursor(false);\n } // Time diff\n\n\n var touchEndTime = now();\n var timeDiff = touchEndTime - data.touchStartTime; // Tap, doubleTap, Click\n\n if (swiper.allowClick) {\n swiper.updateClickedSlide(e);\n swiper.emit('tap click', e);\n\n if (timeDiff < 300 && touchEndTime - data.lastClickTime < 300) {\n swiper.emit('doubleTap doubleClick', e);\n }\n }\n\n data.lastClickTime = now();\n nextTick(function () {\n if (!swiper.destroyed) swiper.allowClick = true;\n });\n\n if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n return;\n }\n\n data.isTouched = false;\n data.isMoved = false;\n data.startMoving = false;\n var currentPos;\n\n if (params.followFinger) {\n currentPos = rtl ? swiper.translate : -swiper.translate;\n } else {\n currentPos = -data.currentTranslate;\n }\n\n if (params.cssMode) {\n return;\n }\n\n if (params.freeMode) {\n if (currentPos < -swiper.minTranslate()) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n\n if (currentPos > -swiper.maxTranslate()) {\n if (swiper.slides.length < snapGrid.length) {\n swiper.slideTo(snapGrid.length - 1);\n } else {\n swiper.slideTo(swiper.slides.length - 1);\n }\n\n return;\n }\n\n if (params.freeModeMomentum) {\n if (data.velocities.length > 1) {\n var lastMoveEvent = data.velocities.pop();\n var velocityEvent = data.velocities.pop();\n var distance = lastMoveEvent.position - velocityEvent.position;\n var time = lastMoveEvent.time - velocityEvent.time;\n swiper.velocity = distance / time;\n swiper.velocity /= 2;\n\n if (Math.abs(swiper.velocity) < params.freeModeMinimumVelocity) {\n swiper.velocity = 0;\n } // this implies that the user stopped moving a finger then released.\n // There would be no events with distance zero, so the last event is stale.\n\n\n if (time > 150 || now() - lastMoveEvent.time > 300) {\n swiper.velocity = 0;\n }\n } else {\n swiper.velocity = 0;\n }\n\n swiper.velocity *= params.freeModeMomentumVelocityRatio;\n data.velocities.length = 0;\n var momentumDuration = 1000 * params.freeModeMomentumRatio;\n var momentumDistance = swiper.velocity * momentumDuration;\n var newPosition = swiper.translate + momentumDistance;\n if (rtl) newPosition = -newPosition;\n var doBounce = false;\n var afterBouncePosition;\n var bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeModeMomentumBounceRatio;\n var needsLoopFix;\n\n if (newPosition < swiper.maxTranslate()) {\n if (params.freeModeMomentumBounce) {\n if (newPosition + swiper.maxTranslate() < -bounceAmount) {\n newPosition = swiper.maxTranslate() - bounceAmount;\n }\n\n afterBouncePosition = swiper.maxTranslate();\n doBounce = true;\n data.allowMomentumBounce = true;\n } else {\n newPosition = swiper.maxTranslate();\n }\n\n if (params.loop && params.centeredSlides) needsLoopFix = true;\n } else if (newPosition > swiper.minTranslate()) {\n if (params.freeModeMomentumBounce) {\n if (newPosition - swiper.minTranslate() > bounceAmount) {\n newPosition = swiper.minTranslate() + bounceAmount;\n }\n\n afterBouncePosition = swiper.minTranslate();\n doBounce = true;\n data.allowMomentumBounce = true;\n } else {\n newPosition = swiper.minTranslate();\n }\n\n if (params.loop && params.centeredSlides) needsLoopFix = true;\n } else if (params.freeModeSticky) {\n var nextSlide;\n\n for (var j = 0; j < snapGrid.length; j += 1) {\n if (snapGrid[j] > -newPosition) {\n nextSlide = j;\n break;\n }\n }\n\n if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {\n newPosition = snapGrid[nextSlide];\n } else {\n newPosition = snapGrid[nextSlide - 1];\n }\n\n newPosition = -newPosition;\n }\n\n if (needsLoopFix) {\n swiper.once('transitionEnd', function () {\n swiper.loopFix();\n });\n } // Fix duration\n\n\n if (swiper.velocity !== 0) {\n if (rtl) {\n momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);\n } else {\n momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);\n }\n\n if (params.freeModeSticky) {\n // If freeModeSticky is active and the user ends a swipe with a slow-velocity\n // event, then durations can be 20+ seconds to slide one (or zero!) slides.\n // It's easy to see this when simulating touch with mouse events. To fix this,\n // limit single-slide swipes to the default slide duration. This also has the\n // nice side effect of matching slide speed if the user stopped moving before\n // lifting finger or mouse vs. moving slowly before lifting the finger/mouse.\n // For faster swipes, also apply limits (albeit higher ones).\n var moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);\n var currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];\n\n if (moveDistance < currentSlideSize) {\n momentumDuration = params.speed;\n } else if (moveDistance < 2 * currentSlideSize) {\n momentumDuration = params.speed * 1.5;\n } else {\n momentumDuration = params.speed * 2.5;\n }\n }\n } else if (params.freeModeSticky) {\n swiper.slideToClosest();\n return;\n }\n\n if (params.freeModeMomentumBounce && doBounce) {\n swiper.updateProgress(afterBouncePosition);\n swiper.setTransition(momentumDuration);\n swiper.setTranslate(newPosition);\n swiper.transitionStart(true, swiper.swipeDirection);\n swiper.animating = true;\n $wrapperEl.transitionEnd(function () {\n if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;\n swiper.emit('momentumBounce');\n swiper.setTransition(params.speed);\n setTimeout(function () {\n swiper.setTranslate(afterBouncePosition);\n $wrapperEl.transitionEnd(function () {\n if (!swiper || swiper.destroyed) return;\n swiper.transitionEnd();\n });\n }, 0);\n });\n } else if (swiper.velocity) {\n swiper.updateProgress(newPosition);\n swiper.setTransition(momentumDuration);\n swiper.setTranslate(newPosition);\n swiper.transitionStart(true, swiper.swipeDirection);\n\n if (!swiper.animating) {\n swiper.animating = true;\n $wrapperEl.transitionEnd(function () {\n if (!swiper || swiper.destroyed) return;\n swiper.transitionEnd();\n });\n }\n } else {\n swiper.emit('_freeModeNoMomentumRelease');\n swiper.updateProgress(newPosition);\n }\n\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n } else if (params.freeModeSticky) {\n swiper.slideToClosest();\n return;\n } else if (params.freeMode) {\n swiper.emit('_freeModeNoMomentumRelease');\n }\n\n if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) {\n swiper.updateProgress();\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n\n return;\n } // Find current slide\n\n\n var stopIndex = 0;\n var groupSize = swiper.slidesSizesGrid[0];\n\n for (var i = 0; i < slidesGrid.length; i += i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup) {\n var _increment = i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;\n\n if (typeof slidesGrid[i + _increment] !== 'undefined') {\n if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + _increment]) {\n stopIndex = i;\n groupSize = slidesGrid[i + _increment] - slidesGrid[i];\n }\n } else if (currentPos >= slidesGrid[i]) {\n stopIndex = i;\n groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];\n }\n } // Find current slide size\n\n\n var ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;\n var increment = stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup;\n\n if (timeDiff > params.longSwipesMs) {\n // Long touches\n if (!params.longSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n\n if (swiper.swipeDirection === 'next') {\n if (ratio >= params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex);\n }\n\n if (swiper.swipeDirection === 'prev') {\n if (ratio > 1 - params.longSwipesRatio) swiper.slideTo(stopIndex + increment);else swiper.slideTo(stopIndex);\n }\n } else {\n // Short swipes\n if (!params.shortSwipes) {\n swiper.slideTo(swiper.activeIndex);\n return;\n }\n\n var isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);\n\n if (!isNavButtonTarget) {\n if (swiper.swipeDirection === 'next') {\n swiper.slideTo(stopIndex + increment);\n }\n\n if (swiper.swipeDirection === 'prev') {\n swiper.slideTo(stopIndex);\n }\n } else if (e.target === swiper.navigation.nextEl) {\n swiper.slideTo(stopIndex + increment);\n } else {\n swiper.slideTo(stopIndex);\n }\n }\n}", "export default function onResize() {\n var swiper = this;\n var params = swiper.params,\n el = swiper.el;\n if (el && el.offsetWidth === 0) return; // Breakpoints\n\n if (params.breakpoints) {\n swiper.setBreakpoint();\n } // Save locks\n\n\n var allowSlideNext = swiper.allowSlideNext,\n allowSlidePrev = swiper.allowSlidePrev,\n snapGrid = swiper.snapGrid; // Disable locks on resize\n\n swiper.allowSlideNext = true;\n swiper.allowSlidePrev = true;\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateSlidesClasses();\n\n if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.isBeginning && !swiper.params.centeredSlides) {\n swiper.slideTo(swiper.slides.length - 1, 0, false, true);\n } else {\n swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n\n if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {\n swiper.autoplay.run();\n } // Return locks after resize\n\n\n swiper.allowSlidePrev = allowSlidePrev;\n swiper.allowSlideNext = allowSlideNext;\n\n if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n}", "export default function onClick(e) {\n var swiper = this;\n if (!swiper.enabled) return;\n\n if (!swiper.allowClick) {\n if (swiper.params.preventClicks) e.preventDefault();\n\n if (swiper.params.preventClicksPropagation && swiper.animating) {\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n }\n}", "export default function onScroll() {\n var swiper = this;\n var wrapperEl = swiper.wrapperEl,\n rtlTranslate = swiper.rtlTranslate,\n enabled = swiper.enabled;\n if (!enabled) return;\n swiper.previousTranslate = swiper.translate;\n\n if (swiper.isHorizontal()) {\n if (rtlTranslate) {\n swiper.translate = wrapperEl.scrollWidth - wrapperEl.offsetWidth - wrapperEl.scrollLeft;\n } else {\n swiper.translate = -wrapperEl.scrollLeft;\n }\n } else {\n swiper.translate = -wrapperEl.scrollTop;\n } // eslint-disable-next-line\n\n\n if (swiper.translate === -0) swiper.translate = 0;\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n var newProgress;\n var translatesDiff = swiper.maxTranslate() - swiper.minTranslate();\n\n if (translatesDiff === 0) {\n newProgress = 0;\n } else {\n newProgress = (swiper.translate - swiper.minTranslate()) / translatesDiff;\n }\n\n if (newProgress !== swiper.progress) {\n swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);\n }\n\n swiper.emit('setTranslate', swiper.translate, false);\n}", "import { getDocument } from 'ssr-window';\nimport onTouchStart from './onTouchStart';\nimport onTouchMove from './onTouchMove';\nimport onTouchEnd from './onTouchEnd';\nimport onResize from './onResize';\nimport onClick from './onClick';\nimport onScroll from './onScroll';\nvar dummyEventAttached = false;\n\nfunction dummyEventListener() {}\n\nfunction attachEvents() {\n var swiper = this;\n var document = getDocument();\n var params = swiper.params,\n touchEvents = swiper.touchEvents,\n el = swiper.el,\n wrapperEl = swiper.wrapperEl,\n device = swiper.device,\n support = swiper.support;\n swiper.onTouchStart = onTouchStart.bind(swiper);\n swiper.onTouchMove = onTouchMove.bind(swiper);\n swiper.onTouchEnd = onTouchEnd.bind(swiper);\n\n if (params.cssMode) {\n swiper.onScroll = onScroll.bind(swiper);\n }\n\n swiper.onClick = onClick.bind(swiper);\n var capture = !!params.nested; // Touch Events\n\n if (!support.touch && support.pointerEvents) {\n el.addEventListener(touchEvents.start, swiper.onTouchStart, false);\n document.addEventListener(touchEvents.move, swiper.onTouchMove, capture);\n document.addEventListener(touchEvents.end, swiper.onTouchEnd, false);\n } else {\n if (support.touch) {\n var passiveListener = touchEvents.start === 'touchstart' && support.passiveListener && params.passiveListeners ? {\n passive: true,\n capture: false\n } : false;\n el.addEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);\n el.addEventListener(touchEvents.move, swiper.onTouchMove, support.passiveListener ? {\n passive: false,\n capture: capture\n } : capture);\n el.addEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);\n\n if (touchEvents.cancel) {\n el.addEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);\n }\n\n if (!dummyEventAttached) {\n document.addEventListener('touchstart', dummyEventListener);\n dummyEventAttached = true;\n }\n }\n\n if (params.simulateTouch && !device.ios && !device.android || params.simulateTouch && !support.touch && device.ios) {\n el.addEventListener('mousedown', swiper.onTouchStart, false);\n document.addEventListener('mousemove', swiper.onTouchMove, capture);\n document.addEventListener('mouseup', swiper.onTouchEnd, false);\n }\n } // Prevent Links Clicks\n\n\n if (params.preventClicks || params.preventClicksPropagation) {\n el.addEventListener('click', swiper.onClick, true);\n }\n\n if (params.cssMode) {\n wrapperEl.addEventListener('scroll', swiper.onScroll);\n } // Resize handler\n\n\n if (params.updateOnWindowResize) {\n swiper.on(device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize, true);\n } else {\n swiper.on('observerUpdate', onResize, true);\n }\n}\n\nfunction detachEvents() {\n var swiper = this;\n var document = getDocument();\n var params = swiper.params,\n touchEvents = swiper.touchEvents,\n el = swiper.el,\n wrapperEl = swiper.wrapperEl,\n device = swiper.device,\n support = swiper.support;\n var capture = !!params.nested; // Touch Events\n\n if (!support.touch && support.pointerEvents) {\n el.removeEventListener(touchEvents.start, swiper.onTouchStart, false);\n document.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);\n document.removeEventListener(touchEvents.end, swiper.onTouchEnd, false);\n } else {\n if (support.touch) {\n var passiveListener = touchEvents.start === 'onTouchStart' && support.passiveListener && params.passiveListeners ? {\n passive: true,\n capture: false\n } : false;\n el.removeEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);\n el.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);\n el.removeEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);\n\n if (touchEvents.cancel) {\n el.removeEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);\n }\n }\n\n if (params.simulateTouch && !device.ios && !device.android || params.simulateTouch && !support.touch && device.ios) {\n el.removeEventListener('mousedown', swiper.onTouchStart, false);\n document.removeEventListener('mousemove', swiper.onTouchMove, capture);\n document.removeEventListener('mouseup', swiper.onTouchEnd, false);\n }\n } // Prevent Links Clicks\n\n\n if (params.preventClicks || params.preventClicksPropagation) {\n el.removeEventListener('click', swiper.onClick, true);\n }\n\n if (params.cssMode) {\n wrapperEl.removeEventListener('scroll', swiper.onScroll);\n } // Resize handler\n\n\n swiper.off(device.ios || device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate', onResize);\n}\n\nexport default {\n attachEvents: attachEvents,\n detachEvents: detachEvents\n};", "import { extend } from '../../../utils/utils';\nexport default function setBreakpoint() {\n var swiper = this;\n var activeIndex = swiper.activeIndex,\n initialized = swiper.initialized,\n _swiper$loopedSlides = swiper.loopedSlides,\n loopedSlides = _swiper$loopedSlides === void 0 ? 0 : _swiper$loopedSlides,\n params = swiper.params,\n $el = swiper.$el;\n var breakpoints = params.breakpoints;\n if (!breakpoints || breakpoints && Object.keys(breakpoints).length === 0) return; // Get breakpoint for window width and update parameters\n\n var breakpoint = swiper.getBreakpoint(breakpoints, swiper.params.breakpointsBase, swiper.el);\n if (!breakpoint || swiper.currentBreakpoint === breakpoint) return;\n var breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;\n\n if (breakpointOnlyParams) {\n ['slidesPerView', 'spaceBetween', 'slidesPerGroup', 'slidesPerGroupSkip', 'slidesPerColumn'].forEach(function (param) {\n var paramValue = breakpointOnlyParams[param];\n if (typeof paramValue === 'undefined') return;\n\n if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {\n breakpointOnlyParams[param] = 'auto';\n } else if (param === 'slidesPerView') {\n breakpointOnlyParams[param] = parseFloat(paramValue);\n } else {\n breakpointOnlyParams[param] = parseInt(paramValue, 10);\n }\n });\n }\n\n var breakpointParams = breakpointOnlyParams || swiper.originalParams;\n var wasMultiRow = params.slidesPerColumn > 1;\n var isMultiRow = breakpointParams.slidesPerColumn > 1;\n var wasEnabled = params.enabled;\n\n if (wasMultiRow && !isMultiRow) {\n $el.removeClass(params.containerModifierClass + \"multirow \" + params.containerModifierClass + \"multirow-column\");\n swiper.emitContainerClasses();\n } else if (!wasMultiRow && isMultiRow) {\n $el.addClass(params.containerModifierClass + \"multirow\");\n\n if (breakpointParams.slidesPerColumnFill && breakpointParams.slidesPerColumnFill === 'column' || !breakpointParams.slidesPerColumnFill && params.slidesPerColumnFill === 'column') {\n $el.addClass(params.containerModifierClass + \"multirow-column\");\n }\n\n swiper.emitContainerClasses();\n }\n\n var directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;\n var needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);\n\n if (directionChanged && initialized) {\n swiper.changeDirection();\n }\n\n extend(swiper.params, breakpointParams);\n var isEnabled = swiper.params.enabled;\n extend(swiper, {\n allowTouchMove: swiper.params.allowTouchMove,\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev\n });\n\n if (wasEnabled && !isEnabled) {\n swiper.disable();\n } else if (!wasEnabled && isEnabled) {\n swiper.enable();\n }\n\n swiper.currentBreakpoint = breakpoint;\n swiper.emit('_beforeBreakpoint', breakpointParams);\n\n if (needsReLoop && initialized) {\n swiper.loopDestroy();\n swiper.loopCreate();\n swiper.updateSlides();\n swiper.slideTo(activeIndex - loopedSlides + swiper.loopedSlides, 0, false);\n }\n\n swiper.emit('breakpoint', breakpointParams);\n}", "import { getWindow } from 'ssr-window';\nexport default function getBreakpoint(breakpoints, base, containerEl) {\n if (base === void 0) {\n base = 'window';\n }\n\n if (!breakpoints || base === 'container' && !containerEl) return undefined;\n var breakpoint = false;\n var window = getWindow();\n var currentHeight = base === 'window' ? window.innerHeight : containerEl.clientHeight;\n var points = Object.keys(breakpoints).map(function (point) {\n if (typeof point === 'string' && point.indexOf('@') === 0) {\n var minRatio = parseFloat(point.substr(1));\n var value = currentHeight * minRatio;\n return {\n value: value,\n point: point\n };\n }\n\n return {\n value: point,\n point: point\n };\n });\n points.sort(function (a, b) {\n return parseInt(a.value, 10) - parseInt(b.value, 10);\n });\n\n for (var i = 0; i < points.length; i += 1) {\n var _points$i = points[i],\n point = _points$i.point,\n value = _points$i.value;\n\n if (base === 'window') {\n if (window.matchMedia(\"(min-width: \" + value + \"px)\").matches) {\n breakpoint = point;\n }\n } else if (value <= containerEl.clientWidth) {\n breakpoint = point;\n }\n }\n\n return breakpoint || 'max';\n}", "import setBreakpoint from './setBreakpoint';\nimport getBreakpoint from './getBreakpoint';\nexport default {\n setBreakpoint: setBreakpoint,\n getBreakpoint: getBreakpoint\n};", "function prepareClasses(entries, prefix) {\n var resultClasses = [];\n entries.forEach(function (item) {\n if (typeof item === 'object') {\n Object.keys(item).forEach(function (classNames) {\n if (item[classNames]) {\n resultClasses.push(prefix + classNames);\n }\n });\n } else if (typeof item === 'string') {\n resultClasses.push(prefix + item);\n }\n });\n return resultClasses;\n}\n\nexport default function addClasses() {\n var swiper = this;\n var classNames = swiper.classNames,\n params = swiper.params,\n rtl = swiper.rtl,\n $el = swiper.$el,\n device = swiper.device,\n support = swiper.support; // prettier-ignore\n\n var suffixes = prepareClasses(['initialized', params.direction, {\n 'pointer-events': support.pointerEvents && !support.touch\n }, {\n 'free-mode': params.freeMode\n }, {\n 'autoheight': params.autoHeight\n }, {\n 'rtl': rtl\n }, {\n 'multirow': params.slidesPerColumn > 1\n }, {\n 'multirow-column': params.slidesPerColumn > 1 && params.slidesPerColumnFill === 'column'\n }, {\n 'android': device.android\n }, {\n 'ios': device.ios\n }, {\n 'css-mode': params.cssMode\n }], params.containerModifierClass);\n classNames.push.apply(classNames, suffixes);\n $el.addClass([].concat(classNames).join(' '));\n swiper.emitContainerClasses();\n}", "export default function removeClasses() {\n var swiper = this;\n var $el = swiper.$el,\n classNames = swiper.classNames;\n $el.removeClass(classNames.join(' '));\n swiper.emitContainerClasses();\n}", "import addClasses from './addClasses';\nimport removeClasses from './removeClasses';\nexport default {\n addClasses: addClasses,\n removeClasses: removeClasses\n};", "import { getWindow } from 'ssr-window';\nimport $ from '../../../utils/dom';\nexport default function loadImage(imageEl, src, srcset, sizes, checkForComplete, callback) {\n var window = getWindow();\n var image;\n\n function onReady() {\n if (callback) callback();\n }\n\n var isPicture = $(imageEl).parent('picture')[0];\n\n if (!isPicture && (!imageEl.complete || !checkForComplete)) {\n if (src) {\n image = new window.Image();\n image.onload = onReady;\n image.onerror = onReady;\n\n if (sizes) {\n image.sizes = sizes;\n }\n\n if (srcset) {\n image.srcset = srcset;\n }\n\n if (src) {\n image.src = src;\n }\n } else {\n onReady();\n }\n } else {\n // image already loaded...\n onReady();\n }\n}", "export default function preloadImages() {\n var swiper = this;\n swiper.imagesToLoad = swiper.$el.find('img');\n\n function onReady() {\n if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;\n if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;\n\n if (swiper.imagesLoaded === swiper.imagesToLoad.length) {\n if (swiper.params.updateOnImagesReady) swiper.update();\n swiper.emit('imagesReady');\n }\n }\n\n for (var i = 0; i < swiper.imagesToLoad.length; i += 1) {\n var imageEl = swiper.imagesToLoad[i];\n swiper.loadImage(imageEl, imageEl.currentSrc || imageEl.getAttribute('src'), imageEl.srcset || imageEl.getAttribute('srcset'), imageEl.sizes || imageEl.getAttribute('sizes'), true, onReady);\n }\n}", "import loadImage from './loadImage';\nimport preloadImages from './preloadImages';\nexport default {\n loadImage: loadImage,\n preloadImages: preloadImages\n};", "function checkOverflow() {\n var swiper = this;\n var params = swiper.params;\n var wasLocked = swiper.isLocked;\n var lastSlidePosition = swiper.slides.length > 0 && params.slidesOffsetBefore + params.spaceBetween * (swiper.slides.length - 1) + swiper.slides[0].offsetWidth * swiper.slides.length;\n\n if (params.slidesOffsetBefore && params.slidesOffsetAfter && lastSlidePosition) {\n swiper.isLocked = lastSlidePosition <= swiper.size;\n } else {\n swiper.isLocked = swiper.snapGrid.length === 1;\n }\n\n swiper.allowSlideNext = !swiper.isLocked;\n swiper.allowSlidePrev = !swiper.isLocked; // events\n\n if (wasLocked !== swiper.isLocked) swiper.emit(swiper.isLocked ? 'lock' : 'unlock');\n\n if (wasLocked && wasLocked !== swiper.isLocked) {\n swiper.isEnd = false;\n if (swiper.navigation) swiper.navigation.update();\n }\n}\n\nexport default {\n checkOverflow: checkOverflow\n};", "export default {\n init: true,\n direction: 'horizontal',\n touchEventsTarget: 'container',\n initialSlide: 0,\n speed: 300,\n cssMode: false,\n updateOnWindowResize: true,\n resizeObserver: false,\n nested: false,\n createElements: false,\n enabled: true,\n focusableElements: 'input, select, option, textarea, button, video, label',\n // Overrides\n width: null,\n height: null,\n //\n preventInteractionOnTransition: false,\n // ssr\n userAgent: null,\n url: null,\n // To support iOS's swipe-to-go-back gesture (when being used in-app).\n edgeSwipeDetection: false,\n edgeSwipeThreshold: 20,\n // Free mode\n freeMode: false,\n freeModeMomentum: true,\n freeModeMomentumRatio: 1,\n freeModeMomentumBounce: true,\n freeModeMomentumBounceRatio: 1,\n freeModeMomentumVelocityRatio: 1,\n freeModeSticky: false,\n freeModeMinimumVelocity: 0.02,\n // Autoheight\n autoHeight: false,\n // Set wrapper width\n setWrapperSize: false,\n // Virtual Translate\n virtualTranslate: false,\n // Effects\n effect: 'slide',\n // 'slide' or 'fade' or 'cube' or 'coverflow' or 'flip'\n // Breakpoints\n breakpoints: undefined,\n breakpointsBase: 'window',\n // Slides grid\n spaceBetween: 0,\n slidesPerView: 1,\n slidesPerColumn: 1,\n slidesPerColumnFill: 'column',\n slidesPerGroup: 1,\n slidesPerGroupSkip: 0,\n centeredSlides: false,\n centeredSlidesBounds: false,\n slidesOffsetBefore: 0,\n // in px\n slidesOffsetAfter: 0,\n // in px\n normalizeSlideIndex: true,\n centerInsufficientSlides: false,\n // Disable swiper and hide navigation when container not overflow\n watchOverflow: false,\n // Round length\n roundLengths: false,\n // Touches\n touchRatio: 1,\n touchAngle: 45,\n simulateTouch: true,\n shortSwipes: true,\n longSwipes: true,\n longSwipesRatio: 0.5,\n longSwipesMs: 300,\n followFinger: true,\n allowTouchMove: true,\n threshold: 0,\n touchMoveStopPropagation: false,\n touchStartPreventDefault: true,\n touchStartForcePreventDefault: false,\n touchReleaseOnEdges: false,\n // Unique Navigation Elements\n uniqueNavElements: true,\n // Resistance\n resistance: true,\n resistanceRatio: 0.85,\n // Progress\n watchSlidesProgress: false,\n watchSlidesVisibility: false,\n // Cursor\n grabCursor: false,\n // Clicks\n preventClicks: true,\n preventClicksPropagation: true,\n slideToClickedSlide: false,\n // Images\n preloadImages: true,\n updateOnImagesReady: true,\n // loop\n loop: false,\n loopAdditionalSlides: 0,\n loopedSlides: null,\n loopFillGroupWithBlank: false,\n loopPreventsSlide: true,\n // Swiping/no swiping\n allowSlidePrev: true,\n allowSlideNext: true,\n swipeHandler: null,\n // '.swipe-handler',\n noSwiping: true,\n noSwipingClass: 'swiper-no-swiping',\n noSwipingSelector: null,\n // Passive Listeners\n passiveListeners: true,\n // NS\n containerModifierClass: 'swiper-container-',\n // NEW\n slideClass: 'swiper-slide',\n slideBlankClass: 'swiper-slide-invisible-blank',\n slideActiveClass: 'swiper-slide-active',\n slideDuplicateActiveClass: 'swiper-slide-duplicate-active',\n slideVisibleClass: 'swiper-slide-visible',\n slideDuplicateClass: 'swiper-slide-duplicate',\n slideNextClass: 'swiper-slide-next',\n slideDuplicateNextClass: 'swiper-slide-duplicate-next',\n slidePrevClass: 'swiper-slide-prev',\n slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',\n wrapperClass: 'swiper-wrapper',\n // Callbacks\n runCallbacksOnInit: true,\n // Internals\n _emitClasses: false\n};", "function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/* eslint no-param-reassign: \"off\" */\nimport { getDocument } from 'ssr-window';\nimport $ from '../../utils/dom';\nimport { extend, now, deleteProps } from '../../utils/utils';\nimport { getSupport } from '../../utils/get-support';\nimport { getDevice } from '../../utils/get-device';\nimport { getBrowser } from '../../utils/get-browser';\nimport Resize from '../../modules/resize/resize';\nimport Observer from '../../modules/observer/observer';\nimport modular from './modular';\nimport eventsEmitter from './events-emitter';\nimport update from './update/index';\nimport translate from './translate/index';\nimport transition from './transition/index';\nimport slide from './slide/index';\nimport loop from './loop/index';\nimport grabCursor from './grab-cursor/index';\nimport manipulation from './manipulation/index';\nimport events from './events/index';\nimport breakpoints from './breakpoints/index';\nimport classes from './classes/index';\nimport images from './images/index';\nimport checkOverflow from './check-overflow/index';\nimport defaults from './defaults';\nvar prototypes = {\n modular: modular,\n eventsEmitter: eventsEmitter,\n update: update,\n translate: translate,\n transition: transition,\n slide: slide,\n loop: loop,\n grabCursor: grabCursor,\n manipulation: manipulation,\n events: events,\n breakpoints: breakpoints,\n checkOverflow: checkOverflow,\n classes: classes,\n images: images\n};\nvar extendedDefaults = {};\n\nvar Swiper = /*#__PURE__*/function () {\n function Swiper() {\n var el;\n var params;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (args.length === 1 && args[0].constructor && Object.prototype.toString.call(args[0]).slice(8, -1) === 'Object') {\n params = args[0];\n } else {\n el = args[0];\n params = args[1];\n }\n\n if (!params) params = {};\n params = extend({}, params);\n if (el && !params.el) params.el = el;\n\n if (params.el && $(params.el).length > 1) {\n var swipers = [];\n $(params.el).each(function (containerEl) {\n var newParams = extend({}, params, {\n el: containerEl\n });\n swipers.push(new Swiper(newParams));\n });\n return swipers;\n } // Swiper Instance\n\n\n var swiper = this;\n swiper.__swiper__ = true;\n swiper.support = getSupport();\n swiper.device = getDevice({\n userAgent: params.userAgent\n });\n swiper.browser = getBrowser();\n swiper.eventsListeners = {};\n swiper.eventsAnyListeners = [];\n\n if (typeof swiper.modules === 'undefined') {\n swiper.modules = {};\n }\n\n Object.keys(swiper.modules).forEach(function (moduleName) {\n var module = swiper.modules[moduleName];\n\n if (module.params) {\n var moduleParamName = Object.keys(module.params)[0];\n var moduleParams = module.params[moduleParamName];\n if (typeof moduleParams !== 'object' || moduleParams === null) return;\n\n if (['navigation', 'pagination', 'scrollbar'].indexOf(moduleParamName) >= 0 && params[moduleParamName] === true) {\n params[moduleParamName] = {\n auto: true\n };\n }\n\n if (!(moduleParamName in params && 'enabled' in moduleParams)) return;\n\n if (params[moduleParamName] === true) {\n params[moduleParamName] = {\n enabled: true\n };\n }\n\n if (typeof params[moduleParamName] === 'object' && !('enabled' in params[moduleParamName])) {\n params[moduleParamName].enabled = true;\n }\n\n if (!params[moduleParamName]) params[moduleParamName] = {\n enabled: false\n };\n }\n }); // Extend defaults with modules params\n\n var swiperParams = extend({}, defaults);\n swiper.useParams(swiperParams); // Extend defaults with passed params\n\n swiper.params = extend({}, swiperParams, extendedDefaults, params);\n swiper.originalParams = extend({}, swiper.params);\n swiper.passedParams = extend({}, params); // add event listeners\n\n if (swiper.params && swiper.params.on) {\n Object.keys(swiper.params.on).forEach(function (eventName) {\n swiper.on(eventName, swiper.params.on[eventName]);\n });\n }\n\n if (swiper.params && swiper.params.onAny) {\n swiper.onAny(swiper.params.onAny);\n } // Save Dom lib\n\n\n swiper.$ = $; // Extend Swiper\n\n extend(swiper, {\n enabled: swiper.params.enabled,\n el: el,\n // Classes\n classNames: [],\n // Slides\n slides: $(),\n slidesGrid: [],\n snapGrid: [],\n slidesSizesGrid: [],\n // isDirection\n isHorizontal: function isHorizontal() {\n return swiper.params.direction === 'horizontal';\n },\n isVertical: function isVertical() {\n return swiper.params.direction === 'vertical';\n },\n // Indexes\n activeIndex: 0,\n realIndex: 0,\n //\n isBeginning: true,\n isEnd: false,\n // Props\n translate: 0,\n previousTranslate: 0,\n progress: 0,\n velocity: 0,\n animating: false,\n // Locks\n allowSlideNext: swiper.params.allowSlideNext,\n allowSlidePrev: swiper.params.allowSlidePrev,\n // Touch Events\n touchEvents: function touchEvents() {\n var touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];\n var desktop = ['mousedown', 'mousemove', 'mouseup'];\n\n if (swiper.support.pointerEvents) {\n desktop = ['pointerdown', 'pointermove', 'pointerup'];\n }\n\n swiper.touchEventsTouch = {\n start: touch[0],\n move: touch[1],\n end: touch[2],\n cancel: touch[3]\n };\n swiper.touchEventsDesktop = {\n start: desktop[0],\n move: desktop[1],\n end: desktop[2]\n };\n return swiper.support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;\n }(),\n touchEventsData: {\n isTouched: undefined,\n isMoved: undefined,\n allowTouchCallbacks: undefined,\n touchStartTime: undefined,\n isScrolling: undefined,\n currentTranslate: undefined,\n startTranslate: undefined,\n allowThresholdMove: undefined,\n // Form elements to match\n focusableElements: swiper.params.focusableElements,\n // Last click time\n lastClickTime: now(),\n clickTimeout: undefined,\n // Velocities\n velocities: [],\n allowMomentumBounce: undefined,\n isTouchEvent: undefined,\n startMoving: undefined\n },\n // Clicks\n allowClick: true,\n // Touches\n allowTouchMove: swiper.params.allowTouchMove,\n touches: {\n startX: 0,\n startY: 0,\n currentX: 0,\n currentY: 0,\n diff: 0\n },\n // Images\n imagesToLoad: [],\n imagesLoaded: 0\n }); // Install Modules\n\n swiper.useModules();\n swiper.emit('_swiper'); // Init\n\n if (swiper.params.init) {\n swiper.init();\n } // Return app instance\n\n\n return swiper;\n }\n\n var _proto = Swiper.prototype;\n\n _proto.enable = function enable() {\n var swiper = this;\n if (swiper.enabled) return;\n swiper.enabled = true;\n\n if (swiper.params.grabCursor) {\n swiper.setGrabCursor();\n }\n\n swiper.emit('enable');\n };\n\n _proto.disable = function disable() {\n var swiper = this;\n if (!swiper.enabled) return;\n swiper.enabled = false;\n\n if (swiper.params.grabCursor) {\n swiper.unsetGrabCursor();\n }\n\n swiper.emit('disable');\n };\n\n _proto.setProgress = function setProgress(progress, speed) {\n var swiper = this;\n progress = Math.min(Math.max(progress, 0), 1);\n var min = swiper.minTranslate();\n var max = swiper.maxTranslate();\n var current = (max - min) * progress + min;\n swiper.translateTo(current, typeof speed === 'undefined' ? 0 : speed);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n };\n\n _proto.emitContainerClasses = function emitContainerClasses() {\n var swiper = this;\n if (!swiper.params._emitClasses || !swiper.el) return;\n var classes = swiper.el.className.split(' ').filter(function (className) {\n return className.indexOf('swiper-container') === 0 || className.indexOf(swiper.params.containerModifierClass) === 0;\n });\n swiper.emit('_containerClasses', classes.join(' '));\n };\n\n _proto.getSlideClasses = function getSlideClasses(slideEl) {\n var swiper = this;\n return slideEl.className.split(' ').filter(function (className) {\n return className.indexOf('swiper-slide') === 0 || className.indexOf(swiper.params.slideClass) === 0;\n }).join(' ');\n };\n\n _proto.emitSlidesClasses = function emitSlidesClasses() {\n var swiper = this;\n if (!swiper.params._emitClasses || !swiper.el) return;\n var updates = [];\n swiper.slides.each(function (slideEl) {\n var classNames = swiper.getSlideClasses(slideEl);\n updates.push({\n slideEl: slideEl,\n classNames: classNames\n });\n swiper.emit('_slideClass', slideEl, classNames);\n });\n swiper.emit('_slideClasses', updates);\n };\n\n _proto.slidesPerViewDynamic = function slidesPerViewDynamic() {\n var swiper = this;\n var params = swiper.params,\n slides = swiper.slides,\n slidesGrid = swiper.slidesGrid,\n swiperSize = swiper.size,\n activeIndex = swiper.activeIndex;\n var spv = 1;\n\n if (params.centeredSlides) {\n var slideSize = slides[activeIndex].swiperSlideSize;\n var breakLoop;\n\n for (var i = activeIndex + 1; i < slides.length; i += 1) {\n if (slides[i] && !breakLoop) {\n slideSize += slides[i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n\n for (var _i = activeIndex - 1; _i >= 0; _i -= 1) {\n if (slides[_i] && !breakLoop) {\n slideSize += slides[_i].swiperSlideSize;\n spv += 1;\n if (slideSize > swiperSize) breakLoop = true;\n }\n }\n } else {\n for (var _i2 = activeIndex + 1; _i2 < slides.length; _i2 += 1) {\n if (slidesGrid[_i2] - slidesGrid[activeIndex] < swiperSize) {\n spv += 1;\n }\n }\n }\n\n return spv;\n };\n\n _proto.update = function update() {\n var swiper = this;\n if (!swiper || swiper.destroyed) return;\n var snapGrid = swiper.snapGrid,\n params = swiper.params; // Breakpoints\n\n if (params.breakpoints) {\n swiper.setBreakpoint();\n }\n\n swiper.updateSize();\n swiper.updateSlides();\n swiper.updateProgress();\n swiper.updateSlidesClasses();\n\n function setTranslate() {\n var translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;\n var newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());\n swiper.setTranslate(newTranslate);\n swiper.updateActiveIndex();\n swiper.updateSlidesClasses();\n }\n\n var translated;\n\n if (swiper.params.freeMode) {\n setTranslate();\n\n if (swiper.params.autoHeight) {\n swiper.updateAutoHeight();\n }\n } else {\n if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {\n translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);\n } else {\n translated = swiper.slideTo(swiper.activeIndex, 0, false, true);\n }\n\n if (!translated) {\n setTranslate();\n }\n }\n\n if (params.watchOverflow && snapGrid !== swiper.snapGrid) {\n swiper.checkOverflow();\n }\n\n swiper.emit('update');\n };\n\n _proto.changeDirection = function changeDirection(newDirection, needUpdate) {\n if (needUpdate === void 0) {\n needUpdate = true;\n }\n\n var swiper = this;\n var currentDirection = swiper.params.direction;\n\n if (!newDirection) {\n // eslint-disable-next-line\n newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';\n }\n\n if (newDirection === currentDirection || newDirection !== 'horizontal' && newDirection !== 'vertical') {\n return swiper;\n }\n\n swiper.$el.removeClass(\"\" + swiper.params.containerModifierClass + currentDirection).addClass(\"\" + swiper.params.containerModifierClass + newDirection);\n swiper.emitContainerClasses();\n swiper.params.direction = newDirection;\n swiper.slides.each(function (slideEl) {\n if (newDirection === 'vertical') {\n slideEl.style.width = '';\n } else {\n slideEl.style.height = '';\n }\n });\n swiper.emit('changeDirection');\n if (needUpdate) swiper.update();\n return swiper;\n };\n\n _proto.mount = function mount(el) {\n var swiper = this;\n if (swiper.mounted) return true; // Find el\n\n var $el = $(el || swiper.params.el);\n el = $el[0];\n\n if (!el) {\n return false;\n }\n\n el.swiper = swiper;\n\n var getWrapperSelector = function getWrapperSelector() {\n return \".\" + (swiper.params.wrapperClass || '').trim().split(' ').join('.');\n };\n\n var getWrapper = function getWrapper() {\n if (el && el.shadowRoot && el.shadowRoot.querySelector) {\n var res = $(el.shadowRoot.querySelector(getWrapperSelector())); // Children needs to return slot items\n\n res.children = function (options) {\n return $el.children(options);\n };\n\n return res;\n }\n\n return $el.children(getWrapperSelector());\n }; // Find Wrapper\n\n\n var $wrapperEl = getWrapper();\n\n if ($wrapperEl.length === 0 && swiper.params.createElements) {\n var document = getDocument();\n var wrapper = document.createElement('div');\n $wrapperEl = $(wrapper);\n wrapper.className = swiper.params.wrapperClass;\n $el.append(wrapper);\n $el.children(\".\" + swiper.params.slideClass).each(function (slideEl) {\n $wrapperEl.append(slideEl);\n });\n }\n\n extend(swiper, {\n $el: $el,\n el: el,\n $wrapperEl: $wrapperEl,\n wrapperEl: $wrapperEl[0],\n mounted: true,\n // RTL\n rtl: el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl',\n rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),\n wrongRTL: $wrapperEl.css('display') === '-webkit-box'\n });\n return true;\n };\n\n _proto.init = function init(el) {\n var swiper = this;\n if (swiper.initialized) return swiper;\n var mounted = swiper.mount(el);\n if (mounted === false) return swiper;\n swiper.emit('beforeInit'); // Set breakpoint\n\n if (swiper.params.breakpoints) {\n swiper.setBreakpoint();\n } // Add Classes\n\n\n swiper.addClasses(); // Create loop\n\n if (swiper.params.loop) {\n swiper.loopCreate();\n } // Update size\n\n\n swiper.updateSize(); // Update slides\n\n swiper.updateSlides();\n\n if (swiper.params.watchOverflow) {\n swiper.checkOverflow();\n } // Set Grab Cursor\n\n\n if (swiper.params.grabCursor && swiper.enabled) {\n swiper.setGrabCursor();\n }\n\n if (swiper.params.preloadImages) {\n swiper.preloadImages();\n } // Slide To Initial Slide\n\n\n if (swiper.params.loop) {\n swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit, false, true);\n } else {\n swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit, false, true);\n } // Attach events\n\n\n swiper.attachEvents(); // Init Flag\n\n swiper.initialized = true; // Emit\n\n swiper.emit('init');\n swiper.emit('afterInit');\n return swiper;\n };\n\n _proto.destroy = function destroy(deleteInstance, cleanStyles) {\n if (deleteInstance === void 0) {\n deleteInstance = true;\n }\n\n if (cleanStyles === void 0) {\n cleanStyles = true;\n }\n\n var swiper = this;\n var params = swiper.params,\n $el = swiper.$el,\n $wrapperEl = swiper.$wrapperEl,\n slides = swiper.slides;\n\n if (typeof swiper.params === 'undefined' || swiper.destroyed) {\n return null;\n }\n\n swiper.emit('beforeDestroy'); // Init Flag\n\n swiper.initialized = false; // Detach events\n\n swiper.detachEvents(); // Destroy loop\n\n if (params.loop) {\n swiper.loopDestroy();\n } // Cleanup styles\n\n\n if (cleanStyles) {\n swiper.removeClasses();\n $el.removeAttr('style');\n $wrapperEl.removeAttr('style');\n\n if (slides && slides.length) {\n slides.removeClass([params.slideVisibleClass, params.slideActiveClass, params.slideNextClass, params.slidePrevClass].join(' ')).removeAttr('style').removeAttr('data-swiper-slide-index');\n }\n }\n\n swiper.emit('destroy'); // Detach emitter events\n\n Object.keys(swiper.eventsListeners).forEach(function (eventName) {\n swiper.off(eventName);\n });\n\n if (deleteInstance !== false) {\n swiper.$el[0].swiper = null;\n deleteProps(swiper);\n }\n\n swiper.destroyed = true;\n return null;\n };\n\n Swiper.extendDefaults = function extendDefaults(newDefaults) {\n extend(extendedDefaults, newDefaults);\n };\n\n Swiper.installModule = function installModule(module) {\n if (!Swiper.prototype.modules) Swiper.prototype.modules = {};\n var name = module.name || Object.keys(Swiper.prototype.modules).length + \"_\" + now();\n Swiper.prototype.modules[name] = module;\n };\n\n Swiper.use = function use(module) {\n if (Array.isArray(module)) {\n module.forEach(function (m) {\n return Swiper.installModule(m);\n });\n return Swiper;\n }\n\n Swiper.installModule(module);\n return Swiper;\n };\n\n _createClass(Swiper, null, [{\n key: \"extendedDefaults\",\n get: function get() {\n return extendedDefaults;\n }\n }, {\n key: \"defaults\",\n get: function get() {\n return defaults;\n }\n }]);\n\n return Swiper;\n}();\n\nObject.keys(prototypes).forEach(function (prototypeGroup) {\n Object.keys(prototypes[prototypeGroup]).forEach(function (protoMethod) {\n Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];\n });\n});\nSwiper.use([Resize, Observer]);\nexport default Swiper;", "function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport $ from '../../utils/dom';\nimport { extend, bindModuleMethods, createElementIfNotDefined } from '../../utils/utils';\nvar Navigation = {\n toggleEl: function toggleEl($el, disabled) {\n $el[disabled ? 'addClass' : 'removeClass'](this.params.navigation.disabledClass);\n if ($el[0] && $el[0].tagName === 'BUTTON') $el[0].disabled = disabled;\n },\n update: function update() {\n // Update Navigation Buttons\n var swiper = this;\n var params = swiper.params.navigation;\n var toggleEl = swiper.navigation.toggleEl;\n if (swiper.params.loop) return;\n var _swiper$navigation = swiper.navigation,\n $nextEl = _swiper$navigation.$nextEl,\n $prevEl = _swiper$navigation.$prevEl;\n\n if ($prevEl && $prevEl.length > 0) {\n if (swiper.isBeginning) {\n toggleEl($prevEl, true);\n } else {\n toggleEl($prevEl, false);\n }\n\n if (swiper.params.watchOverflow && swiper.enabled) {\n $prevEl[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);\n }\n }\n\n if ($nextEl && $nextEl.length > 0) {\n if (swiper.isEnd) {\n toggleEl($nextEl, true);\n } else {\n toggleEl($nextEl, false);\n }\n\n if (swiper.params.watchOverflow && swiper.enabled) {\n $nextEl[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);\n }\n }\n },\n onPrevClick: function onPrevClick(e) {\n var swiper = this;\n e.preventDefault();\n if (swiper.isBeginning && !swiper.params.loop) return;\n swiper.slidePrev();\n },\n onNextClick: function onNextClick(e) {\n var swiper = this;\n e.preventDefault();\n if (swiper.isEnd && !swiper.params.loop) return;\n swiper.slideNext();\n },\n init: function init() {\n var swiper = this;\n var params = swiper.params.navigation;\n swiper.params.navigation = createElementIfNotDefined(swiper.$el, swiper.params.navigation, swiper.params.createElements, {\n nextEl: 'swiper-button-next',\n prevEl: 'swiper-button-prev'\n });\n if (!(params.nextEl || params.prevEl)) return;\n var $nextEl;\n var $prevEl;\n\n if (params.nextEl) {\n $nextEl = $(params.nextEl);\n\n if (swiper.params.uniqueNavElements && typeof params.nextEl === 'string' && $nextEl.length > 1 && swiper.$el.find(params.nextEl).length === 1) {\n $nextEl = swiper.$el.find(params.nextEl);\n }\n }\n\n if (params.prevEl) {\n $prevEl = $(params.prevEl);\n\n if (swiper.params.uniqueNavElements && typeof params.prevEl === 'string' && $prevEl.length > 1 && swiper.$el.find(params.prevEl).length === 1) {\n $prevEl = swiper.$el.find(params.prevEl);\n }\n }\n\n if ($nextEl && $nextEl.length > 0) {\n $nextEl.on('click', swiper.navigation.onNextClick);\n }\n\n if ($prevEl && $prevEl.length > 0) {\n $prevEl.on('click', swiper.navigation.onPrevClick);\n }\n\n extend(swiper.navigation, {\n $nextEl: $nextEl,\n nextEl: $nextEl && $nextEl[0],\n $prevEl: $prevEl,\n prevEl: $prevEl && $prevEl[0]\n });\n\n if (!swiper.enabled) {\n if ($nextEl) $nextEl.addClass(params.lockClass);\n if ($prevEl) $prevEl.addClass(params.lockClass);\n }\n },\n destroy: function destroy() {\n var swiper = this;\n var _swiper$navigation2 = swiper.navigation,\n $nextEl = _swiper$navigation2.$nextEl,\n $prevEl = _swiper$navigation2.$prevEl;\n\n if ($nextEl && $nextEl.length) {\n $nextEl.off('click', swiper.navigation.onNextClick);\n $nextEl.removeClass(swiper.params.navigation.disabledClass);\n }\n\n if ($prevEl && $prevEl.length) {\n $prevEl.off('click', swiper.navigation.onPrevClick);\n $prevEl.removeClass(swiper.params.navigation.disabledClass);\n }\n }\n};\nexport default {\n name: 'navigation',\n params: {\n navigation: {\n nextEl: null,\n prevEl: null,\n hideOnClick: false,\n disabledClass: 'swiper-button-disabled',\n hiddenClass: 'swiper-button-hidden',\n lockClass: 'swiper-button-lock'\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n navigation: _extends({}, Navigation)\n });\n },\n on: {\n init: function init(swiper) {\n swiper.navigation.init();\n swiper.navigation.update();\n },\n toEdge: function toEdge(swiper) {\n swiper.navigation.update();\n },\n fromEdge: function fromEdge(swiper) {\n swiper.navigation.update();\n },\n destroy: function destroy(swiper) {\n swiper.navigation.destroy();\n },\n 'enable disable': function enableDisable(swiper) {\n var _swiper$navigation3 = swiper.navigation,\n $nextEl = _swiper$navigation3.$nextEl,\n $prevEl = _swiper$navigation3.$prevEl;\n\n if ($nextEl) {\n $nextEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass);\n }\n\n if ($prevEl) {\n $prevEl[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.navigation.lockClass);\n }\n },\n click: function click(swiper, e) {\n var _swiper$navigation4 = swiper.navigation,\n $nextEl = _swiper$navigation4.$nextEl,\n $prevEl = _swiper$navigation4.$prevEl;\n var targetEl = e.target;\n\n if (swiper.params.navigation.hideOnClick && !$(targetEl).is($prevEl) && !$(targetEl).is($nextEl)) {\n if (swiper.pagination && swiper.params.pagination && swiper.params.pagination.clickable && (swiper.pagination.el === targetEl || swiper.pagination.el.contains(targetEl))) return;\n var isHidden;\n\n if ($nextEl) {\n isHidden = $nextEl.hasClass(swiper.params.navigation.hiddenClass);\n } else if ($prevEl) {\n isHidden = $prevEl.hasClass(swiper.params.navigation.hiddenClass);\n }\n\n if (isHidden === true) {\n swiper.emit('navigationShow');\n } else {\n swiper.emit('navigationHide');\n }\n\n if ($nextEl) {\n $nextEl.toggleClass(swiper.params.navigation.hiddenClass);\n }\n\n if ($prevEl) {\n $prevEl.toggleClass(swiper.params.navigation.hiddenClass);\n }\n }\n }\n }\n};", "function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nimport $ from '../../utils/dom';\nimport { extend, bindModuleMethods, classesToSelector, createElementIfNotDefined } from '../../utils/utils';\nvar Pagination = {\n update: function update() {\n // Render || Update Pagination bullets/items\n var swiper = this;\n var rtl = swiper.rtl;\n var params = swiper.params.pagination;\n if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;\n var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;\n var $el = swiper.pagination.$el; // Current/Total\n\n var current;\n var total = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;\n\n if (swiper.params.loop) {\n current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup);\n\n if (current > slidesLength - 1 - swiper.loopedSlides * 2) {\n current -= slidesLength - swiper.loopedSlides * 2;\n }\n\n if (current > total - 1) current -= total;\n if (current < 0 && swiper.params.paginationType !== 'bullets') current = total + current;\n } else if (typeof swiper.snapIndex !== 'undefined') {\n current = swiper.snapIndex;\n } else {\n current = swiper.activeIndex || 0;\n } // Types\n\n\n if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {\n var bullets = swiper.pagination.bullets;\n var firstIndex;\n var lastIndex;\n var midIndex;\n\n if (params.dynamicBullets) {\n swiper.pagination.bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true);\n $el.css(swiper.isHorizontal() ? 'width' : 'height', swiper.pagination.bulletSize * (params.dynamicMainBullets + 4) + \"px\");\n\n if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {\n swiper.pagination.dynamicBulletIndex += current - swiper.previousIndex;\n\n if (swiper.pagination.dynamicBulletIndex > params.dynamicMainBullets - 1) {\n swiper.pagination.dynamicBulletIndex = params.dynamicMainBullets - 1;\n } else if (swiper.pagination.dynamicBulletIndex < 0) {\n swiper.pagination.dynamicBulletIndex = 0;\n }\n }\n\n firstIndex = current - swiper.pagination.dynamicBulletIndex;\n lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);\n midIndex = (lastIndex + firstIndex) / 2;\n }\n\n bullets.removeClass(params.bulletActiveClass + \" \" + params.bulletActiveClass + \"-next \" + params.bulletActiveClass + \"-next-next \" + params.bulletActiveClass + \"-prev \" + params.bulletActiveClass + \"-prev-prev \" + params.bulletActiveClass + \"-main\");\n\n if ($el.length > 1) {\n bullets.each(function (bullet) {\n var $bullet = $(bullet);\n var bulletIndex = $bullet.index();\n\n if (bulletIndex === current) {\n $bullet.addClass(params.bulletActiveClass);\n }\n\n if (params.dynamicBullets) {\n if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {\n $bullet.addClass(params.bulletActiveClass + \"-main\");\n }\n\n if (bulletIndex === firstIndex) {\n $bullet.prev().addClass(params.bulletActiveClass + \"-prev\").prev().addClass(params.bulletActiveClass + \"-prev-prev\");\n }\n\n if (bulletIndex === lastIndex) {\n $bullet.next().addClass(params.bulletActiveClass + \"-next\").next().addClass(params.bulletActiveClass + \"-next-next\");\n }\n }\n });\n } else {\n var $bullet = bullets.eq(current);\n var bulletIndex = $bullet.index();\n $bullet.addClass(params.bulletActiveClass);\n\n if (params.dynamicBullets) {\n var $firstDisplayedBullet = bullets.eq(firstIndex);\n var $lastDisplayedBullet = bullets.eq(lastIndex);\n\n for (var i = firstIndex; i <= lastIndex; i += 1) {\n bullets.eq(i).addClass(params.bulletActiveClass + \"-main\");\n }\n\n if (swiper.params.loop) {\n if (bulletIndex >= bullets.length - params.dynamicMainBullets) {\n for (var _i = params.dynamicMainBullets; _i >= 0; _i -= 1) {\n bullets.eq(bullets.length - _i).addClass(params.bulletActiveClass + \"-main\");\n }\n\n bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(params.bulletActiveClass + \"-prev\");\n } else {\n $firstDisplayedBullet.prev().addClass(params.bulletActiveClass + \"-prev\").prev().addClass(params.bulletActiveClass + \"-prev-prev\");\n $lastDisplayedBullet.next().addClass(params.bulletActiveClass + \"-next\").next().addClass(params.bulletActiveClass + \"-next-next\");\n }\n } else {\n $firstDisplayedBullet.prev().addClass(params.bulletActiveClass + \"-prev\").prev().addClass(params.bulletActiveClass + \"-prev-prev\");\n $lastDisplayedBullet.next().addClass(params.bulletActiveClass + \"-next\").next().addClass(params.bulletActiveClass + \"-next-next\");\n }\n }\n }\n\n if (params.dynamicBullets) {\n var dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);\n var bulletsOffset = (swiper.pagination.bulletSize * dynamicBulletsLength - swiper.pagination.bulletSize) / 2 - midIndex * swiper.pagination.bulletSize;\n var offsetProp = rtl ? 'right' : 'left';\n bullets.css(swiper.isHorizontal() ? offsetProp : 'top', bulletsOffset + \"px\");\n }\n }\n\n if (params.type === 'fraction') {\n $el.find(classesToSelector(params.currentClass)).text(params.formatFractionCurrent(current + 1));\n $el.find(classesToSelector(params.totalClass)).text(params.formatFractionTotal(total));\n }\n\n if (params.type === 'progressbar') {\n var progressbarDirection;\n\n if (params.progressbarOpposite) {\n progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';\n } else {\n progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';\n }\n\n var scale = (current + 1) / total;\n var scaleX = 1;\n var scaleY = 1;\n\n if (progressbarDirection === 'horizontal') {\n scaleX = scale;\n } else {\n scaleY = scale;\n }\n\n $el.find(classesToSelector(params.progressbarFillClass)).transform(\"translate3d(0,0,0) scaleX(\" + scaleX + \") scaleY(\" + scaleY + \")\").transition(swiper.params.speed);\n }\n\n if (params.type === 'custom' && params.renderCustom) {\n $el.html(params.renderCustom(swiper, current + 1, total));\n swiper.emit('paginationRender', $el[0]);\n } else {\n swiper.emit('paginationUpdate', $el[0]);\n }\n\n if (swiper.params.watchOverflow && swiper.enabled) {\n $el[swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);\n }\n },\n render: function render() {\n // Render Container\n var swiper = this;\n var params = swiper.params.pagination;\n if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;\n var slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;\n var $el = swiper.pagination.$el;\n var paginationHTML = '';\n\n if (params.type === 'bullets') {\n var numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - swiper.loopedSlides * 2) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;\n\n if (swiper.params.freeMode && !swiper.params.loop && numberOfBullets > slidesLength) {\n numberOfBullets = slidesLength;\n }\n\n for (var i = 0; i < numberOfBullets; i += 1) {\n if (params.renderBullet) {\n paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);\n } else {\n paginationHTML += \"<\" + params.bulletElement + \" class=\\\"\" + params.bulletClass + \"\\\"></\" + params.bulletElement + \">\";\n }\n }\n\n $el.html(paginationHTML);\n swiper.pagination.bullets = $el.find(classesToSelector(params.bulletClass));\n }\n\n if (params.type === 'fraction') {\n if (params.renderFraction) {\n paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);\n } else {\n paginationHTML = \"<span class=\\\"\" + params.currentClass + \"\\\"></span>\" + ' / ' + (\"<span class=\\\"\" + params.totalClass + \"\\\"></span>\");\n }\n\n $el.html(paginationHTML);\n }\n\n if (params.type === 'progressbar') {\n if (params.renderProgressbar) {\n paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);\n } else {\n paginationHTML = \"<span class=\\\"\" + params.progressbarFillClass + \"\\\"></span>\";\n }\n\n $el.html(paginationHTML);\n }\n\n if (params.type !== 'custom') {\n swiper.emit('paginationRender', swiper.pagination.$el[0]);\n }\n },\n init: function init() {\n var swiper = this;\n swiper.params.pagination = createElementIfNotDefined(swiper.$el, swiper.params.pagination, swiper.params.createElements, {\n el: 'swiper-pagination'\n });\n var params = swiper.params.pagination;\n if (!params.el) return;\n var $el = $(params.el);\n if ($el.length === 0) return;\n\n if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1) {\n $el = swiper.$el.find(params.el);\n }\n\n if (params.type === 'bullets' && params.clickable) {\n $el.addClass(params.clickableClass);\n }\n\n $el.addClass(params.modifierClass + params.type);\n\n if (params.type === 'bullets' && params.dynamicBullets) {\n $el.addClass(\"\" + params.modifierClass + params.type + \"-dynamic\");\n swiper.pagination.dynamicBulletIndex = 0;\n\n if (params.dynamicMainBullets < 1) {\n params.dynamicMainBullets = 1;\n }\n }\n\n if (params.type === 'progressbar' && params.progressbarOpposite) {\n $el.addClass(params.progressbarOppositeClass);\n }\n\n if (params.clickable) {\n $el.on('click', classesToSelector(params.bulletClass), function onClick(e) {\n e.preventDefault();\n var index = $(this).index() * swiper.params.slidesPerGroup;\n if (swiper.params.loop) index += swiper.loopedSlides;\n swiper.slideTo(index);\n });\n }\n\n extend(swiper.pagination, {\n $el: $el,\n el: $el[0]\n });\n\n if (!swiper.enabled) {\n $el.addClass(params.lockClass);\n }\n },\n destroy: function destroy() {\n var swiper = this;\n var params = swiper.params.pagination;\n if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;\n var $el = swiper.pagination.$el;\n $el.removeClass(params.hiddenClass);\n $el.removeClass(params.modifierClass + params.type);\n if (swiper.pagination.bullets) swiper.pagination.bullets.removeClass(params.bulletActiveClass);\n\n if (params.clickable) {\n $el.off('click', classesToSelector(params.bulletClass));\n }\n }\n};\nexport default {\n name: 'pagination',\n params: {\n pagination: {\n el: null,\n bulletElement: 'span',\n clickable: false,\n hideOnClick: false,\n renderBullet: null,\n renderProgressbar: null,\n renderFraction: null,\n renderCustom: null,\n progressbarOpposite: false,\n type: 'bullets',\n // 'bullets' or 'progressbar' or 'fraction' or 'custom'\n dynamicBullets: false,\n dynamicMainBullets: 1,\n formatFractionCurrent: function formatFractionCurrent(number) {\n return number;\n },\n formatFractionTotal: function formatFractionTotal(number) {\n return number;\n },\n bulletClass: 'swiper-pagination-bullet',\n bulletActiveClass: 'swiper-pagination-bullet-active',\n modifierClass: 'swiper-pagination-',\n // NEW\n currentClass: 'swiper-pagination-current',\n totalClass: 'swiper-pagination-total',\n hiddenClass: 'swiper-pagination-hidden',\n progressbarFillClass: 'swiper-pagination-progressbar-fill',\n progressbarOppositeClass: 'swiper-pagination-progressbar-opposite',\n clickableClass: 'swiper-pagination-clickable',\n // NEW\n lockClass: 'swiper-pagination-lock'\n }\n },\n create: function create() {\n var swiper = this;\n bindModuleMethods(swiper, {\n pagination: _extends({\n dynamicBulletIndex: 0\n }, Pagination)\n });\n },\n on: {\n init: function init(swiper) {\n swiper.pagination.init();\n swiper.pagination.render();\n swiper.pagination.update();\n },\n activeIndexChange: function activeIndexChange(swiper) {\n if (swiper.params.loop) {\n swiper.pagination.update();\n } else if (typeof swiper.snapIndex === 'undefined') {\n swiper.pagination.update();\n }\n },\n snapIndexChange: function snapIndexChange(swiper) {\n if (!swiper.params.loop) {\n swiper.pagination.update();\n }\n },\n slidesLengthChange: function slidesLengthChange(swiper) {\n if (swiper.params.loop) {\n swiper.pagination.render();\n swiper.pagination.update();\n }\n },\n snapGridLengthChange: function snapGridLengthChange(swiper) {\n if (!swiper.params.loop) {\n swiper.pagination.render();\n swiper.pagination.update();\n }\n },\n destroy: function destroy(swiper) {\n swiper.pagination.destroy();\n },\n 'enable disable': function enableDisable(swiper) {\n var $el = swiper.pagination.$el;\n\n if ($el) {\n $el[swiper.enabled ? 'removeClass' : 'addClass'](swiper.params.pagination.lockClass);\n }\n },\n click: function click(swiper, e) {\n var targetEl = e.target;\n\n if (swiper.params.pagination.el && swiper.params.pagination.hideOnClick && swiper.pagination.$el.length > 0 && !$(targetEl).hasClass(swiper.params.pagination.bulletClass)) {\n if (swiper.navigation && (swiper.navigation.nextEl && targetEl === swiper.navigation.nextEl || swiper.navigation.prevEl && targetEl === swiper.navigation.prevEl)) return;\n var isHidden = swiper.pagination.$el.hasClass(swiper.params.pagination.hiddenClass);\n\n if (isHidden === true) {\n swiper.emit('paginationShow');\n } else {\n swiper.emit('paginationHide');\n }\n\n swiper.pagination.$el.toggleClass(swiper.params.pagination.hiddenClass);\n }\n }\n }\n};", "import { number } from 'jquery';\r\nimport Swiper from 'swiper';\r\nimport SwiperCore, { Navigation, Pagination } from \"swiper/core\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport * as basicLightbox from 'basiclightbox';\r\n\r\nSwiperCore.use([Navigation, Pagination]);\r\n\r\n@ModuleName(\"AxProdDetail\")\r\nexport class AxProdDetail implements AxInit {\r\n private Swiper: Swiper;\r\n private Swiper2: Swiper;\r\n private SwiperModal: Swiper;\r\n\r\n AxInit(init: any): void {\r\n const observer = new IntersectionObserver(\r\n ([e]) => {\r\n e.target.toggleAttribute('stuck', e.intersectionRatio < 1)\r\n },\r\n { threshold: [1] }\r\n );\r\n let count: number = init.count;\r\n observer.observe(document.querySelector('.ax-pill_menu'));\r\n observer.observe(document.querySelector('.details__hero-price'));\r\n this.Swiper = new Swiper('.swiper1', {\r\n pagination: {\r\n el: \".swiper-pagination\",\r\n clickable: true\r\n },\r\n breakpoints: {\r\n 576: {\r\n slidesPerView: 'auto', \r\n pagination: {\r\n el: \".swiper-pagination\",\r\n clickable: true\r\n }\r\n },\r\n 120: {\r\n spaceBetween: 0,\r\n pagination: {\r\n el: \".swiper-pagination\",\r\n clickable: true\r\n }\r\n\r\n }\r\n }\r\n });\r\n if (count > 1) {\r\n this.Swiper2 = new Swiper('.swiper2', {\r\n //pagination: {\r\n // el: \".swiper-pagination\",\r\n // clickable: true\r\n //},\r\n breakpoints: {\r\n 768: {\r\n spaceBetween: 20,\r\n slidesPerView: 'auto',\r\n centeredSlides: true,\r\n roundLengths: false,\r\n loop: true,\r\n loopAdditionalSlides: 20,\r\n navigation: {\r\n nextEl: \".swiper-button-next\",\r\n prevEl: \".swiper-button-prev\",\r\n },\r\n pagination: {\r\n el: \".swiper-pagination\",\r\n clickable: true\r\n }\r\n },\r\n 120: {\r\n slidesPerView: 'auto',\r\n centeredSlides: true,\r\n loop: true,\r\n loopAdditionalSlides: 5,\r\n spaceBetween: 0\r\n }\r\n }\r\n\r\n });\r\n } else {\r\n this.Swiper2 = new Swiper('.swiper2', {\r\n breakpoints: {\r\n 768: {\r\n slidesPerView: 'auto',\r\n centeredSlides: true,\r\n roundLengths: false,\r\n navigation: {\r\n nextEl: \".swiper-button-next\",\r\n prevEl: \".swiper-button-prev\",\r\n },\r\n pagination: {\r\n el: \".swiper-pagination\",\r\n clickable: true\r\n }\r\n },\r\n 120: {\r\n spaceBetween: 0,\r\n }\r\n }\r\n\r\n });\r\n }\r\n if (count > 1) {\r\n this.SwiperModal = new Swiper('.swiper-Modal', {\r\n breakpoints: {\r\n 700: {\r\n spaceBetween: 20,\r\n slidesPerView: 'auto',\r\n centeredSlides: true,\r\n roundLengths: false,\r\n loop: true,\r\n loopAdditionalSlides: 20,\r\n navigation: {\r\n nextEl: \".swiper-button-next\",\r\n prevEl: \".swiper-button-prev\",\r\n },\r\n pagination: {\r\n el: \".swiper-pagination\",\r\n clickable: true\r\n }\r\n },\r\n 120: {\r\n slidesPerView: 'auto',\r\n centeredSlides: true,\r\n loop: true,\r\n loopAdditionalSlides: 5,\r\n spaceBetween: 0,\r\n pagination: {\r\n el: \".swiper-pagination\",\r\n clickable: true\r\n }\r\n }\r\n }\r\n });\r\n } else {\r\n this.SwiperModal = new Swiper('.swiper-Modal', {\r\n breakpoints: {\r\n 700: {\r\n slidesPerView: 'auto',\r\n centeredSlides: true,\r\n roundLengths: false,\r\n navigation: {\r\n nextEl: \".swiper-button-next\",\r\n prevEl: \".swiper-button-prev\",\r\n },\r\n pagination: {\r\n el: \".swiper-pagination\",\r\n clickable: true\r\n }\r\n },\r\n 120: {\r\n spaceBetween: 0,\r\n }\r\n }\r\n\r\n });\r\n } \r\n let modalOpenBtn = $('.swiper-vid-expand-btn');\r\n modalOpenBtn.on('click', () => {\r\n $('.swiper-modal').attr('style', '');\r\n });\r\n let mediaPoint = window.matchMedia(\"(max-width: 768px)\");\r\n mediaPoint.addListener(() => changeMediaPoint());\r\n changeMediaPoint();\r\n $(\".ax-scroll-btn\").on('click', () => { topFunction(); });\r\n window.onscroll = function () { scrollFunction() };\r\n setIndex();\r\n this.Swiper2.on('slideChangeTransitionEnd', () => {\r\n setIndex();\r\n }); \r\n function setIndex() {\r\n let contentCount = $('.content-count-span');\r\n let numb: number = +$('.swiper-slide-active').get(1).getAttribute('data-swiper-slide-index') + 1;\r\n contentCount.text(numb + '/' + count);\r\n }\r\n function changeMediaPoint() {\r\n let imageContainer = $('.imageContainer');\r\n let videoContainer = $('.videoContainer');\r\n let imageContainerModal = $('.imageContainer-modal');\r\n let videoContainerModal = $('.videoContainer-modal');\r\n let modal = $('.swiper-modal');\r\n let modalClose = $('.close-vid-modal');\r\n let modalExpand = $('.swiper-vid-expand-btn');\r\n let modalCount = $('.swiper-content-count');\r\n if (!window.matchMedia(\"(max-width: 768px)\").matches) {\r\n modalClose.click((e) => { modal.attr('style', 'display:none;') });\r\n modalExpand.attr('style', 'display:none;');\r\n modalCount.attr('style', 'display:none;');\r\n modal.attr('style', 'display:none;');\r\n if (imageContainer.length > 0) {\r\n imageContainer.each((i, e) => {\r\n $(e).unbind('click');\r\n $(e).click((e) => {\r\n bslContent(e.currentTarget as HTMLElement);\r\n });\r\n });\r\n }\r\n if (videoContainer.length > 0) {\r\n videoContainer.each((i, e) => {\r\n $(e).unbind('click');\r\n $(e).click((e) => {\r\n bslContent(e.currentTarget as HTMLElement);\r\n });\r\n });\r\n }\r\n } else if (window.matchMedia(\"(max-width: 768px)\").matches) {\r\n modalExpand.removeAttr('style');\r\n modalCount.removeAttr('style');\r\n modalClose.click((e) => { modal.attr('style', 'display:none;') });\r\n imageContainerModal.click(e => {\r\n bslContentModal(e.currentTarget as HTMLElement);\r\n });\r\n videoContainerModal.click((e) => {\r\n bslContentModal(e.currentTarget as HTMLElement);\r\n });\r\n\r\n if (imageContainer.length > 0) {\r\n imageContainer.each((i, e) => {\r\n $(e).unbind('click');\r\n $(e).click((e) => {\r\n modal.removeAttr('style');\r\n });\r\n });\r\n }\r\n if (videoContainer.length > 0) {\r\n videoContainer.each((i, e) => {\r\n $(e).unbind('click');\r\n $(e).click((e) => {\r\n modal.removeAttr('style');\r\n });\r\n });\r\n }\r\n }\r\n }\r\n function scrollFunction() {\r\n let scrollBtn = $(\".ax-scroll-btn\").get(0);\r\n if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {\r\n scrollBtn.style.display = \"\";\r\n } else {\r\n scrollBtn.style.display = \"none\";\r\n }\r\n }\r\n function topFunction() {\r\n document.body.scrollTop = 0;\r\n document.documentElement.scrollTop = 0;\r\n }\r\n function bslContentModal(html: HTMLElement) {\r\n let outer = document.createElement('div');\r\n const btnClose = document.createElement('div');\r\n btnClose.setAttribute('class', 'close-vid-btn cursor');\r\n let ele: HTMLMediaElement;\r\n console.log(html);\r\n if (html.hasChildNodes && html.children[0] != null || html.children[0] != undefined) {\r\n ele = html.children[0] as HTMLMediaElement;\r\n html.appendChild(btnClose);\r\n }\r\n else {\r\n ele = html as HTMLMediaElement;\r\n html.appendChild(btnClose);\r\n }\r\n let clonedNode = null;\r\n outer.appendChild(html.cloneNode(true)); \r\n html.removeChild(btnClose);\r\n if (ele.tagName.toLowerCase() == 'video') {\r\n clonedNode = outer.querySelector('video') as HTMLVideoElement;\r\n }\r\n else {\r\n clonedNode = outer.querySelector('img') as HTMLImageElement;\r\n } \r\n \r\n if (clonedNode.tagName.toLowerCase() == 'video') {\r\n if (clonedNode != null) {\r\n clonedNode.classList.remove('vid-shadow');\r\n clonedNode.setAttribute('autoplay', \"\");\r\n clonedNode.setAttribute('muted', \"\"); \r\n }\r\n }\r\n clonedNode.setAttribute(\"style\", \"z-index:9999 !important;\");\r\n const instance = basicLightbox.create(outer.innerHTML, {\r\n onShow: (instance) => {\r\n $(document).keyup(function (e) {\r\n if (e.key == \"Escape\") {\r\n instance.close();\r\n }\r\n });\r\n instance.element().querySelector('.close-vid-btn').onclick = () => instance.close();\r\n if (ele.tagName.toLowerCase() == 'video') {\r\n setupVidControlsModal(instance.element().querySelector('.videoContainer-modal'));\r\n }\r\n },\r\n onClose: (instance) => {\r\n if (clonedNode != null && clonedNode.tagName.toLowerCase() == 'video') {\r\n clonedNode.pause();\r\n clonedNode.remove();\r\n btnClose.remove();\r\n }\r\n outer.remove();\r\n }\r\n });\r\n instance.show();\r\n const bslightbox = $('.basicLightbox');\r\n if (bslightbox != null) {\r\n bslightbox.attr('style', 'z-index:9000 !important;'); \r\n }\r\n if (clonedNode != null) {\r\n clonedNode.removeAttribute('autoplay');\r\n clonedNode.removeAttribute('controls');\r\n clonedNode.removeAttribute('style');\r\n }\r\n }\r\n function bslContent(html: HTMLElement) {\r\n let outer = document.createElement('div');\r\n const btnClose = document.createElement('div');\r\n btnClose.setAttribute('class', 'close-vid-btn cursor');\r\n let ele: HTMLElement;\r\n if ((html.hasChildNodes && html.children[0] != null || html.children[0] != undefined) && html.children[0].tagName.toLowerCase() == 'video') {\r\n ele = html.children[0] as HTMLMediaElement;\r\n html.appendChild(btnClose); \r\n }\r\n else {\r\n ele = html.children[0] as HTMLElement;\r\n html.appendChild(btnClose);\r\n }\r\n let clonedNode= null; \r\n outer.appendChild(html.cloneNode(true)); \r\n html.removeChild(btnClose);\r\n if (ele.tagName.toLowerCase() == 'video') {\r\n clonedNode = outer.querySelector('video') as HTMLVideoElement;\r\n }\r\n else { \r\n clonedNode = outer.querySelector('img') as HTMLElement;\r\n } \r\n let figure = outer.querySelector('figure');\r\n figure.classList.remove('figure-swiper'); \r\n if (clonedNode.tagName.toLowerCase() == 'video') {\r\n if (clonedNode != null) {\r\n clonedNode.classList.remove('vid-shadow'); \r\n figure.classList.add('figure-swiper-lightbox-vid');\r\n clonedNode.setAttribute('autoplay', \"\");\r\n clonedNode.setAttribute('muted', \"\");\r\n clonedNode.classList.remove('vid');\r\n clonedNode.classList.add('vid-lightbox');\r\n clonedNode.classList.add('vid-lightbox');\r\n }\r\n }\r\n if (clonedNode.tagName.toLowerCase() == 'img') {\r\n let imgEle = html.querySelector('img.img-vid') as HTMLElement;\r\n let styleUri = imgEle.style.backgroundImage; \r\n figure.classList.add('figure-swiper-lightbox-img');\r\n clonedNode.classList.remove('img-vid');\r\n clonedNode.style.backgroundImage = styleUri;\r\n }\r\n clonedNode.style.zIndex = '9999 !important';\r\n const instance = basicLightbox.create(outer.innerHTML, {\r\n onShow: (instance) => {\r\n $(document).keyup(function (e) {\r\n if (e.key == \"Escape\") {\r\n instance.close();\r\n }\r\n });\r\n instance.element().querySelector('.close-vid-btn').onclick = () => instance.close();\r\n if (ele.tagName.toLowerCase() == 'video') {\r\n setupVidControls(instance.element().querySelector('.videoContainer'));\r\n }\r\n },\r\n onClose: (instance) => {\r\n if (clonedNode != null && clonedNode.tagName.toLowerCase() == 'video') {\r\n clonedNode.pause();\r\n clonedNode.remove();\r\n btnClose.remove();\r\n }\r\n outer.remove();\r\n }\r\n });\r\n instance.show();\r\n const bslightbox = $('.basicLightbox');\r\n if (bslightbox != null) {\r\n bslightbox.attr('style', 'z-index:9000 !important;');\r\n const placeholder = $('.basicLightbox__placeholder');\r\n if (placeholder != null) {\r\n placeholder.attr('style', ' max-width: 95% !important; transform: scale(.9)!important; ')\r\n }\r\n }\r\n if (clonedNode != null) {\r\n clonedNode.removeAttribute('autoplay');\r\n clonedNode.removeAttribute('controls');\r\n clonedNode.removeAttribute('style');\r\n }\r\n }\r\n function setupVidControlsModal(container: HTMLElement) {\r\n const video = container.querySelector(\".vid-modal\") as unknown as HTMLMediaElement;\r\n const playpauseVidBtn = container.querySelector(\".playpause-vid-btn\") as unknown as HTMLElement;\r\n playpauseVidBtn.setAttribute(\"style\", \"display:none;\");\r\n video.controls = true;\r\n video.preload = 'metadata';\r\n video.addEventListener(\"touchstart\", (e) => {\r\n if (video.paused || video.ended) {\r\n \r\n video.play();\r\n } else {\r\n \r\n video.pause();\r\n }\r\n });\r\n }\r\n function setupVidControls(container: HTMLElement) {\r\n const supportsVideo = !!document.createElement(\"video\").canPlayType;\r\n if (supportsVideo) {\r\n const videoContainer = container as HTMLElement;\r\n videoContainer.removeAttribute(\"display\");\r\n //const video = container.querySelector(\".vid\") as unknown as HTMLMediaElement;\r\n const video = container.querySelector(\".vid-lightbox\") as unknown as HTMLMediaElement;\r\n const videoControls = container.querySelector(\".video-controls\") as unknown as HTMLElement;\r\n const playpauseVidBtn = container.querySelector(\".playpause-vid-btn\") as unknown as HTMLElement;\r\n //videoControls.setAttribute(\"style\", \"display:none;\");\r\n playpauseVidBtn.setAttribute(\"style\", \"display:none;\");\r\n //video.controls = false;\r\n video.controls = true;\r\n video.preload = 'metadata';\r\n //videoControls.style.display = \"flex\";\r\n videoControls.style.display = \"none\";\r\n const playpause = container.querySelector(\".playpause\") as unknown as HTMLElement;\r\n playpause.setAttribute('data-state', 'pause');\r\n const stop = container.querySelector(\".stop\") as unknown as HTMLElement;\r\n const mute = container.querySelector(\".mute\") as unknown as HTMLElement;\r\n const volinc = container.querySelector(\".volinc\") as unknown as HTMLElement;\r\n const voldec = container.querySelector(\".voldec\") as unknown as HTMLElement;\r\n const progress = container.querySelector(\".progress-id\") as unknown as HTMLProgressElement;\r\n const progressBar = container.querySelector(\".progress-bar\") as unknown as HTMLElement;\r\n const fullscreen = container.querySelector(\".fs\") as unknown as HTMLElement;\r\n video.addEventListener(\"touchstart\", (e) => {\r\n if (video.paused || video.ended) {\r\n playpause.setAttribute('data-state', 'pause');\r\n video.play();\r\n } else {\r\n playpause.setAttribute('data-state', 'play');\r\n video.pause();\r\n }\r\n });\r\n playpause.addEventListener(\"click\", (e) => {\r\n if (video.paused || video.ended) {\r\n playpause.setAttribute('data-state', 'pause');\r\n video.play();\r\n } else {\r\n playpause.setAttribute('data-state', 'play');\r\n video.pause();\r\n }\r\n });\r\n stop.addEventListener(\"click\", (e) => {\r\n video.pause();\r\n //video.currentTime = 0;\r\n //progress.value = 0;\r\n });\r\n mute.addEventListener(\"click\", (e) => {\r\n video.muted = !video.muted;\r\n });\r\n volinc.addEventListener(\"click\", (e) => {\r\n alterVolume(\"+\", video, videoContainer);\r\n });\r\n voldec.addEventListener(\"click\", (e) => {\r\n alterVolume(\"-\", video, videoContainer);\r\n });\r\n\r\n video.addEventListener(\"loadedmetadata\", () => {\r\n progress.setAttribute(\"max\", video.duration.toString());\r\n });\r\n video.addEventListener(\"timeupdate\", () => {\r\n progress.value = video.currentTime;\r\n progressBar.style.width = `${Math.floor(\r\n (video.currentTime * 100) / video.duration\r\n )}%`;\r\n });\r\n video.addEventListener(\"timeupdate\", () => {\r\n if (!progress.getAttribute(\"max\"))\r\n progress.setAttribute(\"max\", video.duration.toString());\r\n progress.value = video.currentTime;\r\n progressBar.style.width = `${Math.floor(\r\n (video.currentTime * 100) / video.duration\r\n )}%`;\r\n });\r\n progress.addEventListener(\"click\", (e) => {\r\n const rect = progress.getBoundingClientRect();\r\n const pos = (e.pageX - rect.left) / progress.offsetWidth;\r\n video.currentTime = pos * video.duration;\r\n });\r\n if (!document?.fullscreenEnabled) {\r\n fullscreen.style.display = \"none\";\r\n }\r\n fullscreen.addEventListener(\"click\", (e) => {\r\n handleFullscreen(videoContainer);\r\n });\r\n }\r\n }\r\n function alterVolume(dir: string, video: HTMLMediaElement, videoContainer: HTMLElement) {\r\n const currentVolume = Math.floor(video.volume * 10) / 10;\r\n if (dir === \"+\" && currentVolume < 1) {\r\n video.volume += 0.1;\r\n } else if (dir === \"-\" && currentVolume > 0) {\r\n video.volume -= 0.1;\r\n }\r\n document.addEventListener(\"fullscreenchange\", (e) => {\r\n setFullscreenData(!!document.fullscreenElement, videoContainer);\r\n });\r\n }\r\n function handleFullscreen(videoContainer: HTMLElement) {\r\n if (document.fullscreenElement !== null) {\r\n document.exitFullscreen();\r\n setFullscreenData(false, videoContainer);\r\n } else {\r\n videoContainer.requestFullscreen();\r\n setFullscreenData(true, videoContainer);\r\n }\r\n }\r\n function setFullscreenData(state: boolean, videoContainer: HTMLElement) {\r\n let stateString = state.toString()\r\n videoContainer.setAttribute(\"data-fullscreen\", stateString);\r\n }\r\n }\r\n}\r\n", "/*!\n * Glide.js v3.4.1\n * (c) 2013-2019 J\u0119drzej Cha\u0142ubek <jedrzej.chalubek@gmail.com> (http://jedrzejchalubek.com/)\n * Released under the MIT License.\n */\n\nvar defaults = {\n /**\n * Type of the movement.\n *\n * Available types:\n * `slider` - Rewinds slider to the start/end when it reaches the first or last slide.\n * `carousel` - Changes slides without starting over when it reaches the first or last slide.\n *\n * @type {String}\n */\n type: 'slider',\n\n /**\n * Start at specific slide number defined with zero-based index.\n *\n * @type {Number}\n */\n startAt: 0,\n\n /**\n * A number of slides visible on the single viewport.\n *\n * @type {Number}\n */\n perView: 1,\n\n /**\n * Focus currently active slide at a specified position in the track.\n *\n * Available inputs:\n * `center` - Current slide will be always focused at the center of a track.\n * `0,1,2,3...` - Current slide will be focused on the specified zero-based index.\n *\n * @type {String|Number}\n */\n focusAt: 0,\n\n /**\n * A size of the gap added between slides.\n *\n * @type {Number}\n */\n gap: 10,\n\n /**\n * Change slides after a specified interval. Use `false` for turning off autoplay.\n *\n * @type {Number|Boolean}\n */\n autoplay: false,\n\n /**\n * Stop autoplay on mouseover event.\n *\n * @type {Boolean}\n */\n hoverpause: true,\n\n /**\n * Allow for changing slides with left and right keyboard arrows.\n *\n * @type {Boolean}\n */\n keyboard: true,\n\n /**\n * Stop running `perView` number of slides from the end. Use this\n * option if you don't want to have an empty space after\n * a slider. Works only with `slider` type and a\n * non-centered `focusAt` setting.\n *\n * @type {Boolean}\n */\n bound: false,\n\n /**\n * Minimal swipe distance needed to change the slide. Use `false` for turning off a swiping.\n *\n * @type {Number|Boolean}\n */\n swipeThreshold: 80,\n\n /**\n * Minimal mouse drag distance needed to change the slide. Use `false` for turning off a dragging.\n *\n * @type {Number|Boolean}\n */\n dragThreshold: 120,\n\n /**\n * A maximum number of slides to which movement will be made on swiping or dragging. Use `false` for unlimited.\n *\n * @type {Number|Boolean}\n */\n perTouch: false,\n\n /**\n * Moving distance ratio of the slides on a swiping and dragging.\n *\n * @type {Number}\n */\n touchRatio: 0.5,\n\n /**\n * Angle required to activate slides moving on swiping or dragging.\n *\n * @type {Number}\n */\n touchAngle: 45,\n\n /**\n * Duration of the animation in milliseconds.\n *\n * @type {Number}\n */\n animationDuration: 400,\n\n /**\n * Allows looping the `slider` type. Slider will rewind to the first/last slide when it's at the start/end.\n *\n * @type {Boolean}\n */\n rewind: true,\n\n /**\n * Duration of the rewinding animation of the `slider` type in milliseconds.\n *\n * @type {Number}\n */\n rewindDuration: 800,\n\n /**\n * Easing function for the animation.\n *\n * @type {String}\n */\n animationTimingFunc: 'cubic-bezier(.165, .840, .440, 1)',\n\n /**\n * Throttle costly events at most once per every wait milliseconds.\n *\n * @type {Number}\n */\n throttle: 10,\n\n /**\n * Moving direction mode.\n *\n * Available inputs:\n * - 'ltr' - left to right movement,\n * - 'rtl' - right to left movement.\n *\n * @type {String}\n */\n direction: 'ltr',\n\n /**\n * The distance value of the next and previous viewports which\n * have to peek in the current view. Accepts number and\n * pixels as a string. Left and right peeking can be\n * set up separately with a directions object.\n *\n * For example:\n * `100` - Peek 100px on the both sides.\n * { before: 100, after: 50 }` - Peek 100px on the left side and 50px on the right side.\n *\n * @type {Number|String|Object}\n */\n peek: 0,\n\n /**\n * Collection of options applied at specified media breakpoints.\n * For example: display two slides per view under 800px.\n * `{\n * '800px': {\n * perView: 2\n * }\n * }`\n */\n breakpoints: {},\n\n /**\n * Collection of internally used HTML classes.\n *\n * @todo Refactor `slider` and `carousel` properties to single `type: { slider: '', carousel: '' }` object\n * @type {Object}\n */\n classes: {\n direction: {\n ltr: 'glide--ltr',\n rtl: 'glide--rtl'\n },\n slider: 'glide--slider',\n carousel: 'glide--carousel',\n swipeable: 'glide--swipeable',\n dragging: 'glide--dragging',\n cloneSlide: 'glide__slide--clone',\n activeNav: 'glide__bullet--active',\n activeSlide: 'glide__slide--active',\n disabledArrow: 'glide__arrow--disabled'\n }\n};\n\n/**\n * Outputs warning message to the bowser console.\n *\n * @param {String} msg\n * @return {Void}\n */\nfunction warn(msg) {\n console.error(\"[Glide warn]: \" + msg);\n}\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\nvar get = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if (\"value\" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};\n\nvar inherits = function (subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n};\n\nvar possibleConstructorReturn = function (self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n};\n\n/**\n * Converts value entered as number\n * or string to integer value.\n *\n * @param {String} value\n * @returns {Number}\n */\nfunction toInt(value) {\n return parseInt(value);\n}\n\n/**\n * Converts value entered as number\n * or string to flat value.\n *\n * @param {String} value\n * @returns {Number}\n */\nfunction toFloat(value) {\n return parseFloat(value);\n}\n\n/**\n * Indicates whether the specified value is a string.\n *\n * @param {*} value\n * @return {Boolean}\n */\nfunction isString(value) {\n return typeof value === 'string';\n}\n\n/**\n * Indicates whether the specified value is an object.\n *\n * @param {*} value\n * @return {Boolean}\n *\n * @see https://github.com/jashkenas/underscore\n */\nfunction isObject(value) {\n var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n\n return type === 'function' || type === 'object' && !!value; // eslint-disable-line no-mixed-operators\n}\n\n/**\n * Indicates whether the specified value is a number.\n *\n * @param {*} value\n * @return {Boolean}\n */\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n\n/**\n * Indicates whether the specified value is a function.\n *\n * @param {*} value\n * @return {Boolean}\n */\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n\n/**\n * Indicates whether the specified value is undefined.\n *\n * @param {*} value\n * @return {Boolean}\n */\nfunction isUndefined(value) {\n return typeof value === 'undefined';\n}\n\n/**\n * Indicates whether the specified value is an array.\n *\n * @param {*} value\n * @return {Boolean}\n */\nfunction isArray(value) {\n return value.constructor === Array;\n}\n\n/**\n * Creates and initializes specified collection of extensions.\n * Each extension receives access to instance of glide and rest of components.\n *\n * @param {Object} glide\n * @param {Object} extensions\n *\n * @returns {Object}\n */\nfunction mount(glide, extensions, events) {\n var components = {};\n\n for (var name in extensions) {\n if (isFunction(extensions[name])) {\n components[name] = extensions[name](glide, components, events);\n } else {\n warn('Extension must be a function');\n }\n }\n\n for (var _name in components) {\n if (isFunction(components[_name].mount)) {\n components[_name].mount();\n }\n }\n\n return components;\n}\n\n/**\n * Defines getter and setter property on the specified object.\n *\n * @param {Object} obj Object where property has to be defined.\n * @param {String} prop Name of the defined property.\n * @param {Object} definition Get and set definitions for the property.\n * @return {Void}\n */\nfunction define(obj, prop, definition) {\n Object.defineProperty(obj, prop, definition);\n}\n\n/**\n * Sorts aphabetically object keys.\n *\n * @param {Object} obj\n * @return {Object}\n */\nfunction sortKeys(obj) {\n return Object.keys(obj).sort().reduce(function (r, k) {\n r[k] = obj[k];\n\n return r[k], r;\n }, {});\n}\n\n/**\n * Merges passed settings object with default options.\n *\n * @param {Object} defaults\n * @param {Object} settings\n * @return {Object}\n */\nfunction mergeOptions(defaults, settings) {\n var options = _extends({}, defaults, settings);\n\n // `Object.assign` do not deeply merge objects, so we\n // have to do it manually for every nested object\n // in options. Although it does not look smart,\n // it's smaller and faster than some fancy\n // merging deep-merge algorithm script.\n if (settings.hasOwnProperty('classes')) {\n options.classes = _extends({}, defaults.classes, settings.classes);\n\n if (settings.classes.hasOwnProperty('direction')) {\n options.classes.direction = _extends({}, defaults.classes.direction, settings.classes.direction);\n }\n }\n\n if (settings.hasOwnProperty('breakpoints')) {\n options.breakpoints = _extends({}, defaults.breakpoints, settings.breakpoints);\n }\n\n return options;\n}\n\nvar EventsBus = function () {\n /**\n * Construct a EventBus instance.\n *\n * @param {Object} events\n */\n function EventsBus() {\n var events = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n classCallCheck(this, EventsBus);\n\n this.events = events;\n this.hop = events.hasOwnProperty;\n }\n\n /**\n * Adds listener to the specifed event.\n *\n * @param {String|Array} event\n * @param {Function} handler\n */\n\n\n createClass(EventsBus, [{\n key: 'on',\n value: function on(event, handler) {\n if (isArray(event)) {\n for (var i = 0; i < event.length; i++) {\n this.on(event[i], handler);\n }\n }\n\n // Create the event's object if not yet created\n if (!this.hop.call(this.events, event)) {\n this.events[event] = [];\n }\n\n // Add the handler to queue\n var index = this.events[event].push(handler) - 1;\n\n // Provide handle back for removal of event\n return {\n remove: function remove() {\n delete this.events[event][index];\n }\n };\n }\n\n /**\n * Runs registered handlers for specified event.\n *\n * @param {String|Array} event\n * @param {Object=} context\n */\n\n }, {\n key: 'emit',\n value: function emit(event, context) {\n if (isArray(event)) {\n for (var i = 0; i < event.length; i++) {\n this.emit(event[i], context);\n }\n }\n\n // If the event doesn't exist, or there's no handlers in queue, just leave\n if (!this.hop.call(this.events, event)) {\n return;\n }\n\n // Cycle through events queue, fire!\n this.events[event].forEach(function (item) {\n item(context || {});\n });\n }\n }]);\n return EventsBus;\n}();\n\nvar Glide = function () {\n /**\r\n * Construct glide.\r\n *\r\n * @param {String} selector\r\n * @param {Object} options\r\n */\n function Glide(selector) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n classCallCheck(this, Glide);\n\n this._c = {};\n this._t = [];\n this._e = new EventsBus();\n\n this.disabled = false;\n this.selector = selector;\n this.settings = mergeOptions(defaults, options);\n this.index = this.settings.startAt;\n }\n\n /**\r\n * Initializes glide.\r\n *\r\n * @param {Object} extensions Collection of extensions to initialize.\r\n * @return {Glide}\r\n */\n\n\n createClass(Glide, [{\n key: 'mount',\n value: function mount$$1() {\n var extensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this._e.emit('mount.before');\n\n if (isObject(extensions)) {\n this._c = mount(this, extensions, this._e);\n } else {\n warn('You need to provide a object on `mount()`');\n }\n\n this._e.emit('mount.after');\n\n return this;\n }\n\n /**\r\n * Collects an instance `translate` transformers.\r\n *\r\n * @param {Array} transformers Collection of transformers.\r\n * @return {Void}\r\n */\n\n }, {\n key: 'mutate',\n value: function mutate() {\n var transformers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if (isArray(transformers)) {\n this._t = transformers;\n } else {\n warn('You need to provide a array on `mutate()`');\n }\n\n return this;\n }\n\n /**\r\n * Updates glide with specified settings.\r\n *\r\n * @param {Object} settings\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'update',\n value: function update() {\n var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n this.settings = mergeOptions(this.settings, settings);\n\n if (settings.hasOwnProperty('startAt')) {\n this.index = settings.startAt;\n }\n\n this._e.emit('update');\n\n return this;\n }\n\n /**\r\n * Change slide with specified pattern. A pattern must be in the special format:\r\n * `>` - Move one forward\r\n * `<` - Move one backward\r\n * `={i}` - Go to {i} zero-based slide (eq. '=1', will go to second slide)\r\n * `>>` - Rewinds to end (last slide)\r\n * `<<` - Rewinds to start (first slide)\r\n *\r\n * @param {String} pattern\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'go',\n value: function go(pattern) {\n this._c.Run.make(pattern);\n\n return this;\n }\n\n /**\r\n * Move track by specified distance.\r\n *\r\n * @param {String} distance\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'move',\n value: function move(distance) {\n this._c.Transition.disable();\n this._c.Move.make(distance);\n\n return this;\n }\n\n /**\r\n * Destroy instance and revert all changes done by this._c.\r\n *\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n this._e.emit('destroy');\n\n return this;\n }\n\n /**\r\n * Start instance autoplaying.\r\n *\r\n * @param {Boolean|Number} interval Run autoplaying with passed interval regardless of `autoplay` settings\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'play',\n value: function play() {\n var interval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (interval) {\n this.settings.autoplay = interval;\n }\n\n this._e.emit('play');\n\n return this;\n }\n\n /**\r\n * Stop instance autoplaying.\r\n *\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'pause',\n value: function pause() {\n this._e.emit('pause');\n\n return this;\n }\n\n /**\r\n * Sets glide into a idle status.\r\n *\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'disable',\n value: function disable() {\n this.disabled = true;\n\n return this;\n }\n\n /**\r\n * Sets glide into a active status.\r\n *\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'enable',\n value: function enable() {\n this.disabled = false;\n\n return this;\n }\n\n /**\r\n * Adds cuutom event listener with handler.\r\n *\r\n * @param {String|Array} event\r\n * @param {Function} handler\r\n * @return {Glide}\r\n */\n\n }, {\n key: 'on',\n value: function on(event, handler) {\n this._e.on(event, handler);\n\n return this;\n }\n\n /**\r\n * Checks if glide is a precised type.\r\n *\r\n * @param {String} name\r\n * @return {Boolean}\r\n */\n\n }, {\n key: 'isType',\n value: function isType(name) {\n return this.settings.type === name;\n }\n\n /**\r\n * Gets value of the core options.\r\n *\r\n * @return {Object}\r\n */\n\n }, {\n key: 'settings',\n get: function get$$1() {\n return this._o;\n }\n\n /**\r\n * Sets value of the core options.\r\n *\r\n * @param {Object} o\r\n * @return {Void}\r\n */\n ,\n set: function set$$1(o) {\n if (isObject(o)) {\n this._o = o;\n } else {\n warn('Options must be an `object` instance.');\n }\n }\n\n /**\r\n * Gets current index of the slider.\r\n *\r\n * @return {Object}\r\n */\n\n }, {\n key: 'index',\n get: function get$$1() {\n return this._i;\n }\n\n /**\r\n * Sets current index a slider.\r\n *\r\n * @return {Object}\r\n */\n ,\n set: function set$$1(i) {\n this._i = toInt(i);\n }\n\n /**\r\n * Gets type name of the slider.\r\n *\r\n * @return {String}\r\n */\n\n }, {\n key: 'type',\n get: function get$$1() {\n return this.settings.type;\n }\n\n /**\r\n * Gets value of the idle status.\r\n *\r\n * @return {Boolean}\r\n */\n\n }, {\n key: 'disabled',\n get: function get$$1() {\n return this._d;\n }\n\n /**\r\n * Sets value of the idle status.\r\n *\r\n * @return {Boolean}\r\n */\n ,\n set: function set$$1(status) {\n this._d = !!status;\n }\n }]);\n return Glide;\n}();\n\nfunction Run (Glide, Components, Events) {\n var Run = {\n /**\n * Initializes autorunning of the glide.\n *\n * @return {Void}\n */\n mount: function mount() {\n this._o = false;\n },\n\n\n /**\n * Makes glides running based on the passed moving schema.\n *\n * @param {String} move\n */\n make: function make(move) {\n var _this = this;\n\n if (!Glide.disabled) {\n Glide.disable();\n\n this.move = move;\n\n Events.emit('run.before', this.move);\n\n this.calculate();\n\n Events.emit('run', this.move);\n\n Components.Transition.after(function () {\n if (_this.isStart()) {\n Events.emit('run.start', _this.move);\n }\n\n if (_this.isEnd()) {\n Events.emit('run.end', _this.move);\n }\n\n if (_this.isOffset('<') || _this.isOffset('>')) {\n _this._o = false;\n\n Events.emit('run.offset', _this.move);\n }\n\n Events.emit('run.after', _this.move);\n\n Glide.enable();\n });\n }\n },\n\n\n /**\n * Calculates current index based on defined move.\n *\n * @return {Void}\n */\n calculate: function calculate() {\n var move = this.move,\n length = this.length;\n var steps = move.steps,\n direction = move.direction;\n\n\n var countableSteps = isNumber(toInt(steps)) && toInt(steps) !== 0;\n\n switch (direction) {\n case '>':\n if (steps === '>') {\n Glide.index = length;\n } else if (this.isEnd()) {\n if (!(Glide.isType('slider') && !Glide.settings.rewind)) {\n this._o = true;\n\n Glide.index = 0;\n }\n } else if (countableSteps) {\n Glide.index += Math.min(length - Glide.index, -toInt(steps));\n } else {\n Glide.index++;\n }\n break;\n\n case '<':\n if (steps === '<') {\n Glide.index = 0;\n } else if (this.isStart()) {\n if (!(Glide.isType('slider') && !Glide.settings.rewind)) {\n this._o = true;\n\n Glide.index = length;\n }\n } else if (countableSteps) {\n Glide.index -= Math.min(Glide.index, toInt(steps));\n } else {\n Glide.index--;\n }\n break;\n\n case '=':\n Glide.index = steps;\n break;\n\n default:\n warn('Invalid direction pattern [' + direction + steps + '] has been used');\n break;\n }\n },\n\n\n /**\n * Checks if we are on the first slide.\n *\n * @return {Boolean}\n */\n isStart: function isStart() {\n return Glide.index === 0;\n },\n\n\n /**\n * Checks if we are on the last slide.\n *\n * @return {Boolean}\n */\n isEnd: function isEnd() {\n return Glide.index === this.length;\n },\n\n\n /**\n * Checks if we are making a offset run.\n *\n * @param {String} direction\n * @return {Boolean}\n */\n isOffset: function isOffset(direction) {\n return this._o && this.move.direction === direction;\n }\n };\n\n define(Run, 'move', {\n /**\n * Gets value of the move schema.\n *\n * @returns {Object}\n */\n get: function get() {\n return this._m;\n },\n\n\n /**\n * Sets value of the move schema.\n *\n * @returns {Object}\n */\n set: function set(value) {\n var step = value.substr(1);\n\n this._m = {\n direction: value.substr(0, 1),\n steps: step ? toInt(step) ? toInt(step) : step : 0\n };\n }\n });\n\n define(Run, 'length', {\n /**\n * Gets value of the running distance based\n * on zero-indexing number of slides.\n *\n * @return {Number}\n */\n get: function get() {\n var settings = Glide.settings;\n var length = Components.Html.slides.length;\n\n // If the `bound` option is acitve, a maximum running distance should be\n // reduced by `perView` and `focusAt` settings. Running distance\n // should end before creating an empty space after instance.\n\n if (Glide.isType('slider') && settings.focusAt !== 'center' && settings.bound) {\n return length - 1 - (toInt(settings.perView) - 1) + toInt(settings.focusAt);\n }\n\n return length - 1;\n }\n });\n\n define(Run, 'offset', {\n /**\n * Gets status of the offsetting flag.\n *\n * @return {Boolean}\n */\n get: function get() {\n return this._o;\n }\n });\n\n return Run;\n}\n\n/**\n * Returns a current time.\n *\n * @return {Number}\n */\nfunction now() {\n return new Date().getTime();\n}\n\n/**\n * Returns a function, that, when invoked, will only be triggered\n * at most once during a given window of time.\n *\n * @param {Function} func\n * @param {Number} wait\n * @param {Object=} options\n * @return {Function}\n *\n * @see https://github.com/jashkenas/underscore\n */\nfunction throttle(func, wait, options) {\n var timeout = void 0,\n context = void 0,\n args = void 0,\n result = void 0;\n var previous = 0;\n if (!options) options = {};\n\n var later = function later() {\n previous = options.leading === false ? 0 : now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function throttled() {\n var at = now();\n if (!previous && options.leading === false) previous = at;\n var remaining = wait - (at - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = at;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function () {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n}\n\nvar MARGIN_TYPE = {\n ltr: ['marginLeft', 'marginRight'],\n rtl: ['marginRight', 'marginLeft']\n};\n\nfunction Gaps (Glide, Components, Events) {\n var Gaps = {\n /**\n * Applies gaps between slides. First and last\n * slides do not receive it's edge margins.\n *\n * @param {HTMLCollection} slides\n * @return {Void}\n */\n apply: function apply(slides) {\n for (var i = 0, len = slides.length; i < len; i++) {\n var style = slides[i].style;\n var direction = Components.Direction.value;\n\n if (i !== 0) {\n style[MARGIN_TYPE[direction][0]] = this.value / 2 + 'px';\n } else {\n style[MARGIN_TYPE[direction][0]] = '';\n }\n\n if (i !== slides.length - 1) {\n style[MARGIN_TYPE[direction][1]] = this.value / 2 + 'px';\n } else {\n style[MARGIN_TYPE[direction][1]] = '';\n }\n }\n },\n\n\n /**\n * Removes gaps from the slides.\n *\n * @param {HTMLCollection} slides\n * @returns {Void}\n */\n remove: function remove(slides) {\n for (var i = 0, len = slides.length; i < len; i++) {\n var style = slides[i].style;\n\n style.marginLeft = '';\n style.marginRight = '';\n }\n }\n };\n\n define(Gaps, 'value', {\n /**\n * Gets value of the gap.\n *\n * @returns {Number}\n */\n get: function get() {\n return toInt(Glide.settings.gap);\n }\n });\n\n define(Gaps, 'grow', {\n /**\n * Gets additional dimentions value caused by gaps.\n * Used to increase width of the slides wrapper.\n *\n * @returns {Number}\n */\n get: function get() {\n return Gaps.value * (Components.Sizes.length - 1);\n }\n });\n\n define(Gaps, 'reductor', {\n /**\n * Gets reduction value caused by gaps.\n * Used to subtract width of the slides.\n *\n * @returns {Number}\n */\n get: function get() {\n var perView = Glide.settings.perView;\n\n return Gaps.value * (perView - 1) / perView;\n }\n });\n\n /**\n * Apply calculated gaps:\n * - after building, so slides (including clones) will receive proper margins\n * - on updating via API, to recalculate gaps with new options\n */\n Events.on(['build.after', 'update'], throttle(function () {\n Gaps.apply(Components.Html.wrapper.children);\n }, 30));\n\n /**\n * Remove gaps:\n * - on destroying to bring markup to its inital state\n */\n Events.on('destroy', function () {\n Gaps.remove(Components.Html.wrapper.children);\n });\n\n return Gaps;\n}\n\n/**\n * Finds siblings nodes of the passed node.\n *\n * @param {Element} node\n * @return {Array}\n */\nfunction siblings(node) {\n if (node && node.parentNode) {\n var n = node.parentNode.firstChild;\n var matched = [];\n\n for (; n; n = n.nextSibling) {\n if (n.nodeType === 1 && n !== node) {\n matched.push(n);\n }\n }\n\n return matched;\n }\n\n return [];\n}\n\n/**\n * Checks if passed node exist and is a valid element.\n *\n * @param {Element} node\n * @return {Boolean}\n */\nfunction exist(node) {\n if (node && node instanceof window.HTMLElement) {\n return true;\n }\n\n return false;\n}\n\nvar TRACK_SELECTOR = '[data-glide-el=\"track\"]';\n\nfunction Html (Glide, Components) {\n var Html = {\n /**\n * Setup slider HTML nodes.\n *\n * @param {Glide} glide\n */\n mount: function mount() {\n this.root = Glide.selector;\n this.track = this.root.querySelector(TRACK_SELECTOR);\n this.slides = Array.prototype.slice.call(this.wrapper.children).filter(function (slide) {\n return !slide.classList.contains(Glide.settings.classes.cloneSlide);\n });\n }\n };\n\n define(Html, 'root', {\n /**\n * Gets node of the glide main element.\n *\n * @return {Object}\n */\n get: function get() {\n return Html._r;\n },\n\n\n /**\n * Sets node of the glide main element.\n *\n * @return {Object}\n */\n set: function set(r) {\n if (isString(r)) {\n r = document.querySelector(r);\n }\n\n if (exist(r)) {\n Html._r = r;\n } else {\n warn('Root element must be a existing Html node');\n }\n }\n });\n\n define(Html, 'track', {\n /**\n * Gets node of the glide track with slides.\n *\n * @return {Object}\n */\n get: function get() {\n return Html._t;\n },\n\n\n /**\n * Sets node of the glide track with slides.\n *\n * @return {Object}\n */\n set: function set(t) {\n if (exist(t)) {\n Html._t = t;\n } else {\n warn('Could not find track element. Please use ' + TRACK_SELECTOR + ' attribute.');\n }\n }\n });\n\n define(Html, 'wrapper', {\n /**\n * Gets node of the slides wrapper.\n *\n * @return {Object}\n */\n get: function get() {\n return Html.track.children[0];\n }\n });\n\n return Html;\n}\n\nfunction Peek (Glide, Components, Events) {\n var Peek = {\n /**\n * Setups how much to peek based on settings.\n *\n * @return {Void}\n */\n mount: function mount() {\n this.value = Glide.settings.peek;\n }\n };\n\n define(Peek, 'value', {\n /**\n * Gets value of the peek.\n *\n * @returns {Number|Object}\n */\n get: function get() {\n return Peek._v;\n },\n\n\n /**\n * Sets value of the peek.\n *\n * @param {Number|Object} value\n * @return {Void}\n */\n set: function set(value) {\n if (isObject(value)) {\n value.before = toInt(value.before);\n value.after = toInt(value.after);\n } else {\n value = toInt(value);\n }\n\n Peek._v = value;\n }\n });\n\n define(Peek, 'reductor', {\n /**\n * Gets reduction value caused by peek.\n *\n * @returns {Number}\n */\n get: function get() {\n var value = Peek.value;\n var perView = Glide.settings.perView;\n\n if (isObject(value)) {\n return value.before / perView + value.after / perView;\n }\n\n return value * 2 / perView;\n }\n });\n\n /**\n * Recalculate peeking sizes on:\n * - when resizing window to update to proper percents\n */\n Events.on(['resize', 'update'], function () {\n Peek.mount();\n });\n\n return Peek;\n}\n\nfunction Move (Glide, Components, Events) {\n var Move = {\n /**\n * Constructs move component.\n *\n * @returns {Void}\n */\n mount: function mount() {\n this._o = 0;\n },\n\n\n /**\n * Calculates a movement value based on passed offset and currently active index.\n *\n * @param {Number} offset\n * @return {Void}\n */\n make: function make() {\n var _this = this;\n\n var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n this.offset = offset;\n\n Events.emit('move', {\n movement: this.value\n });\n\n Components.Transition.after(function () {\n Events.emit('move.after', {\n movement: _this.value\n });\n });\n }\n };\n\n define(Move, 'offset', {\n /**\n * Gets an offset value used to modify current translate.\n *\n * @return {Object}\n */\n get: function get() {\n return Move._o;\n },\n\n\n /**\n * Sets an offset value used to modify current translate.\n *\n * @return {Object}\n */\n set: function set(value) {\n Move._o = !isUndefined(value) ? toInt(value) : 0;\n }\n });\n\n define(Move, 'translate', {\n /**\n * Gets a raw movement value.\n *\n * @return {Number}\n */\n get: function get() {\n return Components.Sizes.slideWidth * Glide.index;\n }\n });\n\n define(Move, 'value', {\n /**\n * Gets an actual movement value corrected by offset.\n *\n * @return {Number}\n */\n get: function get() {\n var offset = this.offset;\n var translate = this.translate;\n\n if (Components.Direction.is('rtl')) {\n return translate + offset;\n }\n\n return translate - offset;\n }\n });\n\n /**\n * Make movement to proper slide on:\n * - before build, so glide will start at `startAt` index\n * - on each standard run to move to newly calculated index\n */\n Events.on(['build.before', 'run'], function () {\n Move.make();\n });\n\n return Move;\n}\n\nfunction Sizes (Glide, Components, Events) {\n var Sizes = {\n /**\n * Setups dimentions of slides.\n *\n * @return {Void}\n */\n setupSlides: function setupSlides() {\n var width = this.slideWidth + 'px';\n var slides = Components.Html.slides;\n\n for (var i = 0; i < slides.length; i++) {\n slides[i].style.width = width;\n }\n },\n\n\n /**\n * Setups dimentions of slides wrapper.\n *\n * @return {Void}\n */\n setupWrapper: function setupWrapper(dimention) {\n Components.Html.wrapper.style.width = this.wrapperSize + 'px';\n },\n\n\n /**\n * Removes applied styles from HTML elements.\n *\n * @returns {Void}\n */\n remove: function remove() {\n var slides = Components.Html.slides;\n\n for (var i = 0; i < slides.length; i++) {\n slides[i].style.width = '';\n }\n\n Components.Html.wrapper.style.width = '';\n }\n };\n\n define(Sizes, 'length', {\n /**\n * Gets count number of the slides.\n *\n * @return {Number}\n */\n get: function get() {\n return Components.Html.slides.length;\n }\n });\n\n define(Sizes, 'width', {\n /**\n * Gets width value of the glide.\n *\n * @return {Number}\n */\n get: function get() {\n return Components.Html.root.offsetWidth;\n }\n });\n\n define(Sizes, 'wrapperSize', {\n /**\n * Gets size of the slides wrapper.\n *\n * @return {Number}\n */\n get: function get() {\n return Sizes.slideWidth * Sizes.length + Components.Gaps.grow + Components.Clones.grow;\n }\n });\n\n define(Sizes, 'slideWidth', {\n /**\n * Gets width value of the single slide.\n *\n * @return {Number}\n */\n get: function get() {\n return Sizes.width / Glide.settings.perView - Components.Peek.reductor - Components.Gaps.reductor;\n }\n });\n\n /**\n * Apply calculated glide's dimensions:\n * - before building, so other dimentions (e.g. translate) will be calculated propertly\n * - when resizing window to recalculate sildes dimensions\n * - on updating via API, to calculate dimensions based on new options\n */\n Events.on(['build.before', 'resize', 'update'], function () {\n Sizes.setupSlides();\n Sizes.setupWrapper();\n });\n\n /**\n * Remove calculated glide's dimensions:\n * - on destoting to bring markup to its inital state\n */\n Events.on('destroy', function () {\n Sizes.remove();\n });\n\n return Sizes;\n}\n\nfunction Build (Glide, Components, Events) {\n var Build = {\n /**\n * Init glide building. Adds classes, sets\n * dimensions and setups initial state.\n *\n * @return {Void}\n */\n mount: function mount() {\n Events.emit('build.before');\n\n this.typeClass();\n this.activeClass();\n\n Events.emit('build.after');\n },\n\n\n /**\n * Adds `type` class to the glide element.\n *\n * @return {Void}\n */\n typeClass: function typeClass() {\n Components.Html.root.classList.add(Glide.settings.classes[Glide.settings.type]);\n },\n\n\n /**\n * Sets active class to current slide.\n *\n * @return {Void}\n */\n activeClass: function activeClass() {\n var classes = Glide.settings.classes;\n var slide = Components.Html.slides[Glide.index];\n\n if (slide) {\n slide.classList.add(classes.activeSlide);\n\n siblings(slide).forEach(function (sibling) {\n sibling.classList.remove(classes.activeSlide);\n });\n }\n },\n\n\n /**\n * Removes HTML classes applied at building.\n *\n * @return {Void}\n */\n removeClasses: function removeClasses() {\n var classes = Glide.settings.classes;\n\n Components.Html.root.classList.remove(classes[Glide.settings.type]);\n\n Components.Html.slides.forEach(function (sibling) {\n sibling.classList.remove(classes.activeSlide);\n });\n }\n };\n\n /**\n * Clear building classes:\n * - on destroying to bring HTML to its initial state\n * - on updating to remove classes before remounting component\n */\n Events.on(['destroy', 'update'], function () {\n Build.removeClasses();\n });\n\n /**\n * Remount component:\n * - on resizing of the window to calculate new dimentions\n * - on updating settings via API\n */\n Events.on(['resize', 'update'], function () {\n Build.mount();\n });\n\n /**\n * Swap active class of current slide:\n * - after each move to the new index\n */\n Events.on('move.after', function () {\n Build.activeClass();\n });\n\n return Build;\n}\n\nfunction Clones (Glide, Components, Events) {\n var Clones = {\n /**\n * Create pattern map and collect slides to be cloned.\n */\n mount: function mount() {\n this.items = [];\n\n if (Glide.isType('carousel')) {\n this.items = this.collect();\n }\n },\n\n\n /**\n * Collect clones with pattern.\n *\n * @return {Void}\n */\n collect: function collect() {\n var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var slides = Components.Html.slides;\n var _Glide$settings = Glide.settings,\n perView = _Glide$settings.perView,\n classes = _Glide$settings.classes;\n\n\n var peekIncrementer = +!!Glide.settings.peek;\n var part = perView + peekIncrementer;\n var start = slides.slice(0, part);\n var end = slides.slice(-part);\n\n for (var r = 0; r < Math.max(1, Math.floor(perView / slides.length)); r++) {\n for (var i = 0; i < start.length; i++) {\n var clone = start[i].cloneNode(true);\n\n clone.classList.add(classes.cloneSlide);\n\n items.push(clone);\n }\n\n for (var _i = 0; _i < end.length; _i++) {\n var _clone = end[_i].cloneNode(true);\n\n _clone.classList.add(classes.cloneSlide);\n\n items.unshift(_clone);\n }\n }\n\n return items;\n },\n\n\n /**\n * Append cloned slides with generated pattern.\n *\n * @return {Void}\n */\n append: function append() {\n var items = this.items;\n var _Components$Html = Components.Html,\n wrapper = _Components$Html.wrapper,\n slides = _Components$Html.slides;\n\n\n var half = Math.floor(items.length / 2);\n var prepend = items.slice(0, half).reverse();\n var append = items.slice(half, items.length);\n var width = Components.Sizes.slideWidth + 'px';\n\n for (var i = 0; i < append.length; i++) {\n wrapper.appendChild(append[i]);\n }\n\n for (var _i2 = 0; _i2 < prepend.length; _i2++) {\n wrapper.insertBefore(prepend[_i2], slides[0]);\n }\n\n for (var _i3 = 0; _i3 < items.length; _i3++) {\n items[_i3].style.width = width;\n }\n },\n\n\n /**\n * Remove all cloned slides.\n *\n * @return {Void}\n */\n remove: function remove() {\n var items = this.items;\n\n\n for (var i = 0; i < items.length; i++) {\n Components.Html.wrapper.removeChild(items[i]);\n }\n }\n };\n\n define(Clones, 'grow', {\n /**\n * Gets additional dimentions value caused by clones.\n *\n * @return {Number}\n */\n get: function get() {\n return (Components.Sizes.slideWidth + Components.Gaps.value) * Clones.items.length;\n }\n });\n\n /**\n * Append additional slide's clones:\n * - while glide's type is `carousel`\n */\n Events.on('update', function () {\n Clones.remove();\n Clones.mount();\n Clones.append();\n });\n\n /**\n * Append additional slide's clones:\n * - while glide's type is `carousel`\n */\n Events.on('build.before', function () {\n if (Glide.isType('carousel')) {\n Clones.append();\n }\n });\n\n /**\n * Remove clones HTMLElements:\n * - on destroying, to bring HTML to its initial state\n */\n Events.on('destroy', function () {\n Clones.remove();\n });\n\n return Clones;\n}\n\nvar EventsBinder = function () {\n /**\n * Construct a EventsBinder instance.\n */\n function EventsBinder() {\n var listeners = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n classCallCheck(this, EventsBinder);\n\n this.listeners = listeners;\n }\n\n /**\n * Adds events listeners to arrows HTML elements.\n *\n * @param {String|Array} events\n * @param {Element|Window|Document} el\n * @param {Function} closure\n * @param {Boolean|Object} capture\n * @return {Void}\n */\n\n\n createClass(EventsBinder, [{\n key: 'on',\n value: function on(events, el, closure) {\n var capture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n if (isString(events)) {\n events = [events];\n }\n\n for (var i = 0; i < events.length; i++) {\n this.listeners[events[i]] = closure;\n\n el.addEventListener(events[i], this.listeners[events[i]], capture);\n }\n }\n\n /**\n * Removes event listeners from arrows HTML elements.\n *\n * @param {String|Array} events\n * @param {Element|Window|Document} el\n * @param {Boolean|Object} capture\n * @return {Void}\n */\n\n }, {\n key: 'off',\n value: function off(events, el) {\n var capture = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (isString(events)) {\n events = [events];\n }\n\n for (var i = 0; i < events.length; i++) {\n el.removeEventListener(events[i], this.listeners[events[i]], capture);\n }\n }\n\n /**\n * Destroy collected listeners.\n *\n * @returns {Void}\n */\n\n }, {\n key: 'destroy',\n value: function destroy() {\n delete this.listeners;\n }\n }]);\n return EventsBinder;\n}();\n\nfunction Resize (Glide, Components, Events) {\n /**\n * Instance of the binder for DOM Events.\n *\n * @type {EventsBinder}\n */\n var Binder = new EventsBinder();\n\n var Resize = {\n /**\n * Initializes window bindings.\n */\n mount: function mount() {\n this.bind();\n },\n\n\n /**\n * Binds `rezsize` listener to the window.\n * It's a costly event, so we are debouncing it.\n *\n * @return {Void}\n */\n bind: function bind() {\n Binder.on('resize', window, throttle(function () {\n Events.emit('resize');\n }, Glide.settings.throttle));\n },\n\n\n /**\n * Unbinds listeners from the window.\n *\n * @return {Void}\n */\n unbind: function unbind() {\n Binder.off('resize', window);\n }\n };\n\n /**\n * Remove bindings from window:\n * - on destroying, to remove added EventListener\n */\n Events.on('destroy', function () {\n Resize.unbind();\n Binder.destroy();\n });\n\n return Resize;\n}\n\nvar VALID_DIRECTIONS = ['ltr', 'rtl'];\nvar FLIPED_MOVEMENTS = {\n '>': '<',\n '<': '>',\n '=': '='\n};\n\nfunction Direction (Glide, Components, Events) {\n var Direction = {\n /**\n * Setups gap value based on settings.\n *\n * @return {Void}\n */\n mount: function mount() {\n this.value = Glide.settings.direction;\n },\n\n\n /**\n * Resolves pattern based on direction value\n *\n * @param {String} pattern\n * @returns {String}\n */\n resolve: function resolve(pattern) {\n var token = pattern.slice(0, 1);\n\n if (this.is('rtl')) {\n return pattern.split(token).join(FLIPED_MOVEMENTS[token]);\n }\n\n return pattern;\n },\n\n\n /**\n * Checks value of direction mode.\n *\n * @param {String} direction\n * @returns {Boolean}\n */\n is: function is(direction) {\n return this.value === direction;\n },\n\n\n /**\n * Applies direction class to the root HTML element.\n *\n * @return {Void}\n */\n addClass: function addClass() {\n Components.Html.root.classList.add(Glide.settings.classes.direction[this.value]);\n },\n\n\n /**\n * Removes direction class from the root HTML element.\n *\n * @return {Void}\n */\n removeClass: function removeClass() {\n Components.Html.root.classList.remove(Glide.settings.classes.direction[this.value]);\n }\n };\n\n define(Direction, 'value', {\n /**\n * Gets value of the direction.\n *\n * @returns {Number}\n */\n get: function get() {\n return Direction._v;\n },\n\n\n /**\n * Sets value of the direction.\n *\n * @param {String} value\n * @return {Void}\n */\n set: function set(value) {\n if (VALID_DIRECTIONS.indexOf(value) > -1) {\n Direction._v = value;\n } else {\n warn('Direction value must be `ltr` or `rtl`');\n }\n }\n });\n\n /**\n * Clear direction class:\n * - on destroy to bring HTML to its initial state\n * - on update to remove class before reappling bellow\n */\n Events.on(['destroy', 'update'], function () {\n Direction.removeClass();\n });\n\n /**\n * Remount component:\n * - on update to reflect changes in direction value\n */\n Events.on('update', function () {\n Direction.mount();\n });\n\n /**\n * Apply direction class:\n * - before building to apply class for the first time\n * - on updating to reapply direction class that may changed\n */\n Events.on(['build.before', 'update'], function () {\n Direction.addClass();\n });\n\n return Direction;\n}\n\n/**\n * Reflects value of glide movement.\n *\n * @param {Object} Glide\n * @param {Object} Components\n * @return {Object}\n */\nfunction Rtl (Glide, Components) {\n return {\n /**\n * Negates the passed translate if glide is in RTL option.\n *\n * @param {Number} translate\n * @return {Number}\n */\n modify: function modify(translate) {\n if (Components.Direction.is('rtl')) {\n return -translate;\n }\n\n return translate;\n }\n };\n}\n\n/**\n * Updates glide movement with a `gap` settings.\n *\n * @param {Object} Glide\n * @param {Object} Components\n * @return {Object}\n */\nfunction Gap (Glide, Components) {\n return {\n /**\n * Modifies passed translate value with number in the `gap` settings.\n *\n * @param {Number} translate\n * @return {Number}\n */\n modify: function modify(translate) {\n return translate + Components.Gaps.value * Glide.index;\n }\n };\n}\n\n/**\n * Updates glide movement with width of additional clones width.\n *\n * @param {Object} Glide\n * @param {Object} Components\n * @return {Object}\n */\nfunction Grow (Glide, Components) {\n return {\n /**\n * Adds to the passed translate width of the half of clones.\n *\n * @param {Number} translate\n * @return {Number}\n */\n modify: function modify(translate) {\n return translate + Components.Clones.grow / 2;\n }\n };\n}\n\n/**\n * Updates glide movement with a `peek` settings.\n *\n * @param {Object} Glide\n * @param {Object} Components\n * @return {Object}\n */\nfunction Peeking (Glide, Components) {\n return {\n /**\n * Modifies passed translate value with a `peek` setting.\n *\n * @param {Number} translate\n * @return {Number}\n */\n modify: function modify(translate) {\n if (Glide.settings.focusAt >= 0) {\n var peek = Components.Peek.value;\n\n if (isObject(peek)) {\n return translate - peek.before;\n }\n\n return translate - peek;\n }\n\n return translate;\n }\n };\n}\n\n/**\n * Updates glide movement with a `focusAt` settings.\n *\n * @param {Object} Glide\n * @param {Object} Components\n * @return {Object}\n */\nfunction Focusing (Glide, Components) {\n return {\n /**\n * Modifies passed translate value with index in the `focusAt` setting.\n *\n * @param {Number} translate\n * @return {Number}\n */\n modify: function modify(translate) {\n var gap = Components.Gaps.value;\n var width = Components.Sizes.width;\n var focusAt = Glide.settings.focusAt;\n var slideWidth = Components.Sizes.slideWidth;\n\n if (focusAt === 'center') {\n return translate - (width / 2 - slideWidth / 2);\n }\n\n return translate - slideWidth * focusAt - gap * focusAt;\n }\n };\n}\n\n/**\n * Applies diffrent transformers on translate value.\n *\n * @param {Object} Glide\n * @param {Object} Components\n * @return {Object}\n */\nfunction mutator (Glide, Components, Events) {\n /**\n * Merge instance transformers with collection of default transformers.\n * It's important that the Rtl component be last on the list,\n * so it reflects all previous transformations.\n *\n * @type {Array}\n */\n var TRANSFORMERS = [Gap, Grow, Peeking, Focusing].concat(Glide._t, [Rtl]);\n\n return {\n /**\n * Piplines translate value with registered transformers.\n *\n * @param {Number} translate\n * @return {Number}\n */\n mutate: function mutate(translate) {\n for (var i = 0; i < TRANSFORMERS.length; i++) {\n var transformer = TRANSFORMERS[i];\n\n if (isFunction(transformer) && isFunction(transformer().modify)) {\n translate = transformer(Glide, Components, Events).modify(translate);\n } else {\n warn('Transformer should be a function that returns an object with `modify()` method');\n }\n }\n\n return translate;\n }\n };\n}\n\nfunction Translate (Glide, Components, Events) {\n var Translate = {\n /**\n * Sets value of translate on HTML element.\n *\n * @param {Number} value\n * @return {Void}\n */\n set: function set(value) {\n var transform = mutator(Glide, Components).mutate(value);\n\n Components.Html.wrapper.style.transform = 'translate3d(' + -1 * transform + 'px, 0px, 0px)';\n },\n\n\n /**\n * Removes value of translate from HTML element.\n *\n * @return {Void}\n */\n remove: function remove() {\n Components.Html.wrapper.style.transform = '';\n }\n };\n\n /**\n * Set new translate value:\n * - on move to reflect index change\n * - on updating via API to reflect possible changes in options\n */\n Events.on('move', function (context) {\n var gap = Components.Gaps.value;\n var length = Components.Sizes.length;\n var width = Components.Sizes.slideWidth;\n\n if (Glide.isType('carousel') && Components.Run.isOffset('<')) {\n Components.Transition.after(function () {\n Events.emit('translate.jump');\n\n Translate.set(width * (length - 1));\n });\n\n return Translate.set(-width - gap * length);\n }\n\n if (Glide.isType('carousel') && Components.Run.isOffset('>')) {\n Components.Transition.after(function () {\n Events.emit('translate.jump');\n\n Translate.set(0);\n });\n\n return Translate.set(width * length + gap * length);\n }\n\n return Translate.set(context.movement);\n });\n\n /**\n * Remove translate:\n * - on destroying to bring markup to its inital state\n */\n Events.on('destroy', function () {\n Translate.remove();\n });\n\n return Translate;\n}\n\nfunction Transition (Glide, Components, Events) {\n /**\n * Holds inactivity status of transition.\n * When true transition is not applied.\n *\n * @type {Boolean}\n */\n var disabled = false;\n\n var Transition = {\n /**\n * Composes string of the CSS transition.\n *\n * @param {String} property\n * @return {String}\n */\n compose: function compose(property) {\n var settings = Glide.settings;\n\n if (!disabled) {\n return property + ' ' + this.duration + 'ms ' + settings.animationTimingFunc;\n }\n\n return property + ' 0ms ' + settings.animationTimingFunc;\n },\n\n\n /**\n * Sets value of transition on HTML element.\n *\n * @param {String=} property\n * @return {Void}\n */\n set: function set() {\n var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';\n\n Components.Html.wrapper.style.transition = this.compose(property);\n },\n\n\n /**\n * Removes value of transition from HTML element.\n *\n * @return {Void}\n */\n remove: function remove() {\n Components.Html.wrapper.style.transition = '';\n },\n\n\n /**\n * Runs callback after animation.\n *\n * @param {Function} callback\n * @return {Void}\n */\n after: function after(callback) {\n setTimeout(function () {\n callback();\n }, this.duration);\n },\n\n\n /**\n * Enable transition.\n *\n * @return {Void}\n */\n enable: function enable() {\n disabled = false;\n\n this.set();\n },\n\n\n /**\n * Disable transition.\n *\n * @return {Void}\n */\n disable: function disable() {\n disabled = true;\n\n this.set();\n }\n };\n\n define(Transition, 'duration', {\n /**\n * Gets duration of the transition based\n * on currently running animation type.\n *\n * @return {Number}\n */\n get: function get() {\n var settings = Glide.settings;\n\n if (Glide.isType('slider') && Components.Run.offset) {\n return settings.rewindDuration;\n }\n\n return settings.animationDuration;\n }\n });\n\n /**\n * Set transition `style` value:\n * - on each moving, because it may be cleared by offset move\n */\n Events.on('move', function () {\n Transition.set();\n });\n\n /**\n * Disable transition:\n * - before initial build to avoid transitioning from `0` to `startAt` index\n * - while resizing window and recalculating dimentions\n * - on jumping from offset transition at start and end edges in `carousel` type\n */\n Events.on(['build.before', 'resize', 'translate.jump'], function () {\n Transition.disable();\n });\n\n /**\n * Enable transition:\n * - on each running, because it may be disabled by offset move\n */\n Events.on('run', function () {\n Transition.enable();\n });\n\n /**\n * Remove transition:\n * - on destroying to bring markup to its inital state\n */\n Events.on('destroy', function () {\n Transition.remove();\n });\n\n return Transition;\n}\n\n/**\n * Test via a getter in the options object to see\n * if the passive property is accessed.\n *\n * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection\n */\n\nvar supportsPassive = false;\n\ntry {\n var opts = Object.defineProperty({}, 'passive', {\n get: function get() {\n supportsPassive = true;\n }\n });\n\n window.addEventListener('testPassive', null, opts);\n window.removeEventListener('testPassive', null, opts);\n} catch (e) {}\n\nvar supportsPassive$1 = supportsPassive;\n\nvar START_EVENTS = ['touchstart', 'mousedown'];\nvar MOVE_EVENTS = ['touchmove', 'mousemove'];\nvar END_EVENTS = ['touchend', 'touchcancel', 'mouseup', 'mouseleave'];\nvar MOUSE_EVENTS = ['mousedown', 'mousemove', 'mouseup', 'mouseleave'];\n\nfunction Swipe (Glide, Components, Events) {\n /**\n * Instance of the binder for DOM Events.\n *\n * @type {EventsBinder}\n */\n var Binder = new EventsBinder();\n\n var swipeSin = 0;\n var swipeStartX = 0;\n var swipeStartY = 0;\n var disabled = false;\n var capture = supportsPassive$1 ? { passive: true } : false;\n\n var Swipe = {\n /**\n * Initializes swipe bindings.\n *\n * @return {Void}\n */\n mount: function mount() {\n this.bindSwipeStart();\n },\n\n\n /**\n * Handler for `swipestart` event. Calculates entry points of the user's tap.\n *\n * @param {Object} event\n * @return {Void}\n */\n start: function start(event) {\n if (!disabled && !Glide.disabled) {\n this.disable();\n\n var swipe = this.touches(event);\n\n swipeSin = null;\n swipeStartX = toInt(swipe.pageX);\n swipeStartY = toInt(swipe.pageY);\n\n this.bindSwipeMove();\n this.bindSwipeEnd();\n\n Events.emit('swipe.start');\n }\n },\n\n\n /**\n * Handler for `swipemove` event. Calculates user's tap angle and distance.\n *\n * @param {Object} event\n */\n move: function move(event) {\n if (!Glide.disabled) {\n var _Glide$settings = Glide.settings,\n touchAngle = _Glide$settings.touchAngle,\n touchRatio = _Glide$settings.touchRatio,\n classes = _Glide$settings.classes;\n\n\n var swipe = this.touches(event);\n\n var subExSx = toInt(swipe.pageX) - swipeStartX;\n var subEySy = toInt(swipe.pageY) - swipeStartY;\n var powEX = Math.abs(subExSx << 2);\n var powEY = Math.abs(subEySy << 2);\n var swipeHypotenuse = Math.sqrt(powEX + powEY);\n var swipeCathetus = Math.sqrt(powEY);\n\n swipeSin = Math.asin(swipeCathetus / swipeHypotenuse);\n\n if (swipeSin * 180 / Math.PI < touchAngle) {\n event.stopPropagation();\n\n Components.Move.make(subExSx * toFloat(touchRatio));\n\n Components.Html.root.classList.add(classes.dragging);\n\n Events.emit('swipe.move');\n } else {\n return false;\n }\n }\n },\n\n\n /**\n * Handler for `swipeend` event. Finitializes user's tap and decides about glide move.\n *\n * @param {Object} event\n * @return {Void}\n */\n end: function end(event) {\n if (!Glide.disabled) {\n var settings = Glide.settings;\n\n var swipe = this.touches(event);\n var threshold = this.threshold(event);\n\n var swipeDistance = swipe.pageX - swipeStartX;\n var swipeDeg = swipeSin * 180 / Math.PI;\n var steps = Math.round(swipeDistance / Components.Sizes.slideWidth);\n\n this.enable();\n\n if (swipeDistance > threshold && swipeDeg < settings.touchAngle) {\n // While swipe is positive and greater than threshold move backward.\n if (settings.perTouch) {\n steps = Math.min(steps, toInt(settings.perTouch));\n }\n\n if (Components.Direction.is('rtl')) {\n steps = -steps;\n }\n\n Components.Run.make(Components.Direction.resolve('<' + steps));\n } else if (swipeDistance < -threshold && swipeDeg < settings.touchAngle) {\n // While swipe is negative and lower than negative threshold move forward.\n if (settings.perTouch) {\n steps = Math.max(steps, -toInt(settings.perTouch));\n }\n\n if (Components.Direction.is('rtl')) {\n steps = -steps;\n }\n\n Components.Run.make(Components.Direction.resolve('>' + steps));\n } else {\n // While swipe don't reach distance apply previous transform.\n Components.Move.make();\n }\n\n Components.Html.root.classList.remove(settings.classes.dragging);\n\n this.unbindSwipeMove();\n this.unbindSwipeEnd();\n\n Events.emit('swipe.end');\n }\n },\n\n\n /**\n * Binds swipe's starting event.\n *\n * @return {Void}\n */\n bindSwipeStart: function bindSwipeStart() {\n var _this = this;\n\n var settings = Glide.settings;\n\n if (settings.swipeThreshold) {\n Binder.on(START_EVENTS[0], Components.Html.wrapper, function (event) {\n _this.start(event);\n }, capture);\n }\n\n if (settings.dragThreshold) {\n Binder.on(START_EVENTS[1], Components.Html.wrapper, function (event) {\n _this.start(event);\n }, capture);\n }\n },\n\n\n /**\n * Unbinds swipe's starting event.\n *\n * @return {Void}\n */\n unbindSwipeStart: function unbindSwipeStart() {\n Binder.off(START_EVENTS[0], Components.Html.wrapper, capture);\n Binder.off(START_EVENTS[1], Components.Html.wrapper, capture);\n },\n\n\n /**\n * Binds swipe's moving event.\n *\n * @return {Void}\n */\n bindSwipeMove: function bindSwipeMove() {\n var _this2 = this;\n\n Binder.on(MOVE_EVENTS, Components.Html.wrapper, throttle(function (event) {\n _this2.move(event);\n }, Glide.settings.throttle), capture);\n },\n\n\n /**\n * Unbinds swipe's moving event.\n *\n * @return {Void}\n */\n unbindSwipeMove: function unbindSwipeMove() {\n Binder.off(MOVE_EVENTS, Components.Html.wrapper, capture);\n },\n\n\n /**\n * Binds swipe's ending event.\n *\n * @return {Void}\n */\n bindSwipeEnd: function bindSwipeEnd() {\n var _this3 = this;\n\n Binder.on(END_EVENTS, Components.Html.wrapper, function (event) {\n _this3.end(event);\n });\n },\n\n\n /**\n * Unbinds swipe's ending event.\n *\n * @return {Void}\n */\n unbindSwipeEnd: function unbindSwipeEnd() {\n Binder.off(END_EVENTS, Components.Html.wrapper);\n },\n\n\n /**\n * Normalizes event touches points accorting to different types.\n *\n * @param {Object} event\n */\n touches: function touches(event) {\n if (MOUSE_EVENTS.indexOf(event.type) > -1) {\n return event;\n }\n\n return event.touches[0] || event.changedTouches[0];\n },\n\n\n /**\n * Gets value of minimum swipe distance settings based on event type.\n *\n * @return {Number}\n */\n threshold: function threshold(event) {\n var settings = Glide.settings;\n\n if (MOUSE_EVENTS.indexOf(event.type) > -1) {\n return settings.dragThreshold;\n }\n\n return settings.swipeThreshold;\n },\n\n\n /**\n * Enables swipe event.\n *\n * @return {self}\n */\n enable: function enable() {\n disabled = false;\n\n Components.Transition.enable();\n\n return this;\n },\n\n\n /**\n * Disables swipe event.\n *\n * @return {self}\n */\n disable: function disable() {\n disabled = true;\n\n Components.Transition.disable();\n\n return this;\n }\n };\n\n /**\n * Add component class:\n * - after initial building\n */\n Events.on('build.after', function () {\n Components.Html.root.classList.add(Glide.settings.classes.swipeable);\n });\n\n /**\n * Remove swiping bindings:\n * - on destroying, to remove added EventListeners\n */\n Events.on('destroy', function () {\n Swipe.unbindSwipeStart();\n Swipe.unbindSwipeMove();\n Swipe.unbindSwipeEnd();\n Binder.destroy();\n });\n\n return Swipe;\n}\n\nfunction Images (Glide, Components, Events) {\n /**\n * Instance of the binder for DOM Events.\n *\n * @type {EventsBinder}\n */\n var Binder = new EventsBinder();\n\n var Images = {\n /**\n * Binds listener to glide wrapper.\n *\n * @return {Void}\n */\n mount: function mount() {\n this.bind();\n },\n\n\n /**\n * Binds `dragstart` event on wrapper to prevent dragging images.\n *\n * @return {Void}\n */\n bind: function bind() {\n Binder.on('dragstart', Components.Html.wrapper, this.dragstart);\n },\n\n\n /**\n * Unbinds `dragstart` event on wrapper.\n *\n * @return {Void}\n */\n unbind: function unbind() {\n Binder.off('dragstart', Components.Html.wrapper);\n },\n\n\n /**\n * Event handler. Prevents dragging.\n *\n * @return {Void}\n */\n dragstart: function dragstart(event) {\n event.preventDefault();\n }\n };\n\n /**\n * Remove bindings from images:\n * - on destroying, to remove added EventListeners\n */\n Events.on('destroy', function () {\n Images.unbind();\n Binder.destroy();\n });\n\n return Images;\n}\n\nfunction Anchors (Glide, Components, Events) {\n /**\n * Instance of the binder for DOM Events.\n *\n * @type {EventsBinder}\n */\n var Binder = new EventsBinder();\n\n /**\n * Holds detaching status of anchors.\n * Prevents detaching of already detached anchors.\n *\n * @private\n * @type {Boolean}\n */\n var detached = false;\n\n /**\n * Holds preventing status of anchors.\n * If `true` redirection after click will be disabled.\n *\n * @private\n * @type {Boolean}\n */\n var prevented = false;\n\n var Anchors = {\n /**\n * Setups a initial state of anchors component.\n *\n * @returns {Void}\n */\n mount: function mount() {\n /**\n * Holds collection of anchors elements.\n *\n * @private\n * @type {HTMLCollection}\n */\n this._a = Components.Html.wrapper.querySelectorAll('a');\n\n this.bind();\n },\n\n\n /**\n * Binds events to anchors inside a track.\n *\n * @return {Void}\n */\n bind: function bind() {\n Binder.on('click', Components.Html.wrapper, this.click);\n },\n\n\n /**\n * Unbinds events attached to anchors inside a track.\n *\n * @return {Void}\n */\n unbind: function unbind() {\n Binder.off('click', Components.Html.wrapper);\n },\n\n\n /**\n * Handler for click event. Prevents clicks when glide is in `prevent` status.\n *\n * @param {Object} event\n * @return {Void}\n */\n click: function click(event) {\n if (prevented) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n\n\n /**\n * Detaches anchors click event inside glide.\n *\n * @return {self}\n */\n detach: function detach() {\n prevented = true;\n\n if (!detached) {\n for (var i = 0; i < this.items.length; i++) {\n this.items[i].draggable = false;\n\n this.items[i].setAttribute('data-href', this.items[i].getAttribute('href'));\n\n this.items[i].removeAttribute('href');\n }\n\n detached = true;\n }\n\n return this;\n },\n\n\n /**\n * Attaches anchors click events inside glide.\n *\n * @return {self}\n */\n attach: function attach() {\n prevented = false;\n\n if (detached) {\n for (var i = 0; i < this.items.length; i++) {\n this.items[i].draggable = true;\n\n this.items[i].setAttribute('href', this.items[i].getAttribute('data-href'));\n }\n\n detached = false;\n }\n\n return this;\n }\n };\n\n define(Anchors, 'items', {\n /**\n * Gets collection of the arrows HTML elements.\n *\n * @return {HTMLElement[]}\n */\n get: function get() {\n return Anchors._a;\n }\n });\n\n /**\n * Detach anchors inside slides:\n * - on swiping, so they won't redirect to its `href` attributes\n */\n Events.on('swipe.move', function () {\n Anchors.detach();\n });\n\n /**\n * Attach anchors inside slides:\n * - after swiping and transitions ends, so they can redirect after click again\n */\n Events.on('swipe.end', function () {\n Components.Transition.after(function () {\n Anchors.attach();\n });\n });\n\n /**\n * Unbind anchors inside slides:\n * - on destroying, to bring anchors to its initial state\n */\n Events.on('destroy', function () {\n Anchors.attach();\n Anchors.unbind();\n Binder.destroy();\n });\n\n return Anchors;\n}\n\nvar NAV_SELECTOR = '[data-glide-el=\"controls[nav]\"]';\nvar CONTROLS_SELECTOR = '[data-glide-el^=\"controls\"]';\n\nfunction Controls (Glide, Components, Events) {\n /**\n * Instance of the binder for DOM Events.\n *\n * @type {EventsBinder}\n */\n var Binder = new EventsBinder();\n\n var capture = supportsPassive$1 ? { passive: true } : false;\n\n var Controls = {\n /**\n * Inits arrows. Binds events listeners\n * to the arrows HTML elements.\n *\n * @return {Void}\n */\n mount: function mount() {\n /**\n * Collection of navigation HTML elements.\n *\n * @private\n * @type {HTMLCollection}\n */\n this._n = Components.Html.root.querySelectorAll(NAV_SELECTOR);\n\n /**\n * Collection of controls HTML elements.\n *\n * @private\n * @type {HTMLCollection}\n */\n this._c = Components.Html.root.querySelectorAll(CONTROLS_SELECTOR);\n\n this.addBindings();\n },\n\n\n /**\n * Sets active class to current slide.\n *\n * @return {Void}\n */\n setActive: function setActive() {\n for (var i = 0; i < this._n.length; i++) {\n this.addClass(this._n[i].children);\n }\n },\n\n\n /**\n * Removes active class to current slide.\n *\n * @return {Void}\n */\n removeActive: function removeActive() {\n for (var i = 0; i < this._n.length; i++) {\n this.removeClass(this._n[i].children);\n }\n },\n\n\n /**\n * Toggles active class on items inside navigation.\n *\n * @param {HTMLElement} controls\n * @return {Void}\n */\n addClass: function addClass(controls) {\n var settings = Glide.settings;\n var item = controls[Glide.index];\n\n if (item) {\n item.classList.add(settings.classes.activeNav);\n\n siblings(item).forEach(function (sibling) {\n sibling.classList.remove(settings.classes.activeNav);\n });\n }\n },\n\n\n /**\n * Removes active class from active control.\n *\n * @param {HTMLElement} controls\n * @return {Void}\n */\n removeClass: function removeClass(controls) {\n var item = controls[Glide.index];\n\n if (item) {\n item.classList.remove(Glide.settings.classes.activeNav);\n }\n },\n\n\n /**\n * Adds handles to the each group of controls.\n *\n * @return {Void}\n */\n addBindings: function addBindings() {\n for (var i = 0; i < this._c.length; i++) {\n this.bind(this._c[i].children);\n }\n },\n\n\n /**\n * Removes handles from the each group of controls.\n *\n * @return {Void}\n */\n removeBindings: function removeBindings() {\n for (var i = 0; i < this._c.length; i++) {\n this.unbind(this._c[i].children);\n }\n },\n\n\n /**\n * Binds events to arrows HTML elements.\n *\n * @param {HTMLCollection} elements\n * @return {Void}\n */\n bind: function bind(elements) {\n for (var i = 0; i < elements.length; i++) {\n Binder.on('click', elements[i], this.click);\n Binder.on('touchstart', elements[i], this.click, capture);\n }\n },\n\n\n /**\n * Unbinds events binded to the arrows HTML elements.\n *\n * @param {HTMLCollection} elements\n * @return {Void}\n */\n unbind: function unbind(elements) {\n for (var i = 0; i < elements.length; i++) {\n Binder.off(['click', 'touchstart'], elements[i]);\n }\n },\n\n\n /**\n * Handles `click` event on the arrows HTML elements.\n * Moves slider in driection precised in\n * `data-glide-dir` attribute.\n *\n * @param {Object} event\n * @return {Void}\n */\n click: function click(event) {\n event.preventDefault();\n\n Components.Run.make(Components.Direction.resolve(event.currentTarget.getAttribute('data-glide-dir')));\n }\n };\n\n define(Controls, 'items', {\n /**\n * Gets collection of the controls HTML elements.\n *\n * @return {HTMLElement[]}\n */\n get: function get() {\n return Controls._c;\n }\n });\n\n /**\n * Swap active class of current navigation item:\n * - after mounting to set it to initial index\n * - after each move to the new index\n */\n Events.on(['mount.after', 'move.after'], function () {\n Controls.setActive();\n });\n\n /**\n * Remove bindings and HTML Classes:\n * - on destroying, to bring markup to its initial state\n */\n Events.on('destroy', function () {\n Controls.removeBindings();\n Controls.removeActive();\n Binder.destroy();\n });\n\n return Controls;\n}\n\nfunction Keyboard (Glide, Components, Events) {\n /**\n * Instance of the binder for DOM Events.\n *\n * @type {EventsBinder}\n */\n var Binder = new EventsBinder();\n\n var Keyboard = {\n /**\n * Binds keyboard events on component mount.\n *\n * @return {Void}\n */\n mount: function mount() {\n if (Glide.settings.keyboard) {\n this.bind();\n }\n },\n\n\n /**\n * Adds keyboard press events.\n *\n * @return {Void}\n */\n bind: function bind() {\n Binder.on('keyup', document, this.press);\n },\n\n\n /**\n * Removes keyboard press events.\n *\n * @return {Void}\n */\n unbind: function unbind() {\n Binder.off('keyup', document);\n },\n\n\n /**\n * Handles keyboard's arrows press and moving glide foward and backward.\n *\n * @param {Object} event\n * @return {Void}\n */\n press: function press(event) {\n if (event.keyCode === 39) {\n Components.Run.make(Components.Direction.resolve('>'));\n }\n\n if (event.keyCode === 37) {\n Components.Run.make(Components.Direction.resolve('<'));\n }\n }\n };\n\n /**\n * Remove bindings from keyboard:\n * - on destroying to remove added events\n * - on updating to remove events before remounting\n */\n Events.on(['destroy', 'update'], function () {\n Keyboard.unbind();\n });\n\n /**\n * Remount component\n * - on updating to reflect potential changes in settings\n */\n Events.on('update', function () {\n Keyboard.mount();\n });\n\n /**\n * Destroy binder:\n * - on destroying to remove listeners\n */\n Events.on('destroy', function () {\n Binder.destroy();\n });\n\n return Keyboard;\n}\n\nfunction Autoplay (Glide, Components, Events) {\n /**\n * Instance of the binder for DOM Events.\n *\n * @type {EventsBinder}\n */\n var Binder = new EventsBinder();\n\n var Autoplay = {\n /**\n * Initializes autoplaying and events.\n *\n * @return {Void}\n */\n mount: function mount() {\n this.start();\n\n if (Glide.settings.hoverpause) {\n this.bind();\n }\n },\n\n\n /**\n * Starts autoplaying in configured interval.\n *\n * @param {Boolean|Number} force Run autoplaying with passed interval regardless of `autoplay` settings\n * @return {Void}\n */\n start: function start() {\n var _this = this;\n\n if (Glide.settings.autoplay) {\n if (isUndefined(this._i)) {\n this._i = setInterval(function () {\n _this.stop();\n\n Components.Run.make('>');\n\n _this.start();\n }, this.time);\n }\n }\n },\n\n\n /**\n * Stops autorunning of the glide.\n *\n * @return {Void}\n */\n stop: function stop() {\n this._i = clearInterval(this._i);\n },\n\n\n /**\n * Stops autoplaying while mouse is over glide's area.\n *\n * @return {Void}\n */\n bind: function bind() {\n var _this2 = this;\n\n Binder.on('mouseover', Components.Html.root, function () {\n _this2.stop();\n });\n\n Binder.on('mouseout', Components.Html.root, function () {\n _this2.start();\n });\n },\n\n\n /**\n * Unbind mouseover events.\n *\n * @returns {Void}\n */\n unbind: function unbind() {\n Binder.off(['mouseover', 'mouseout'], Components.Html.root);\n }\n };\n\n define(Autoplay, 'time', {\n /**\n * Gets time period value for the autoplay interval. Prioritizes\n * times in `data-glide-autoplay` attrubutes over options.\n *\n * @return {Number}\n */\n get: function get() {\n var autoplay = Components.Html.slides[Glide.index].getAttribute('data-glide-autoplay');\n\n if (autoplay) {\n return toInt(autoplay);\n }\n\n return toInt(Glide.settings.autoplay);\n }\n });\n\n /**\n * Stop autoplaying and unbind events:\n * - on destroying, to clear defined interval\n * - on updating via API to reset interval that may changed\n */\n Events.on(['destroy', 'update'], function () {\n Autoplay.unbind();\n });\n\n /**\n * Stop autoplaying:\n * - before each run, to restart autoplaying\n * - on pausing via API\n * - on destroying, to clear defined interval\n * - while starting a swipe\n * - on updating via API to reset interval that may changed\n */\n Events.on(['run.before', 'pause', 'destroy', 'swipe.start', 'update'], function () {\n Autoplay.stop();\n });\n\n /**\n * Start autoplaying:\n * - after each run, to restart autoplaying\n * - on playing via API\n * - while ending a swipe\n */\n Events.on(['run.after', 'play', 'swipe.end'], function () {\n Autoplay.start();\n });\n\n /**\n * Remount autoplaying:\n * - on updating via API to reset interval that may changed\n */\n Events.on('update', function () {\n Autoplay.mount();\n });\n\n /**\n * Destroy a binder:\n * - on destroying glide instance to clearup listeners\n */\n Events.on('destroy', function () {\n Binder.destroy();\n });\n\n return Autoplay;\n}\n\n/**\n * Sorts keys of breakpoint object so they will be ordered from lower to bigger.\n *\n * @param {Object} points\n * @returns {Object}\n */\nfunction sortBreakpoints(points) {\n if (isObject(points)) {\n return sortKeys(points);\n } else {\n warn('Breakpoints option must be an object');\n }\n\n return {};\n}\n\nfunction Breakpoints (Glide, Components, Events) {\n /**\n * Instance of the binder for DOM Events.\n *\n * @type {EventsBinder}\n */\n var Binder = new EventsBinder();\n\n /**\n * Holds reference to settings.\n *\n * @type {Object}\n */\n var settings = Glide.settings;\n\n /**\n * Holds reference to breakpoints object in settings. Sorts breakpoints\n * from smaller to larger. It is required in order to proper\n * matching currently active breakpoint settings.\n *\n * @type {Object}\n */\n var points = sortBreakpoints(settings.breakpoints);\n\n /**\n * Cache initial settings before overwritting.\n *\n * @type {Object}\n */\n var defaults = _extends({}, settings);\n\n var Breakpoints = {\n /**\n * Matches settings for currectly matching media breakpoint.\n *\n * @param {Object} points\n * @returns {Object}\n */\n match: function match(points) {\n if (typeof window.matchMedia !== 'undefined') {\n for (var point in points) {\n if (points.hasOwnProperty(point)) {\n if (window.matchMedia('(max-width: ' + point + 'px)').matches) {\n return points[point];\n }\n }\n }\n }\n\n return defaults;\n }\n };\n\n /**\n * Overwrite instance settings with currently matching breakpoint settings.\n * This happens right after component initialization.\n */\n _extends(settings, Breakpoints.match(points));\n\n /**\n * Update glide with settings of matched brekpoint:\n * - window resize to update slider\n */\n Binder.on('resize', window, throttle(function () {\n Glide.settings = mergeOptions(settings, Breakpoints.match(points));\n }, Glide.settings.throttle));\n\n /**\n * Resort and update default settings:\n * - on reinit via API, so breakpoint matching will be performed with options\n */\n Events.on('update', function () {\n points = sortBreakpoints(points);\n\n defaults = _extends({}, settings);\n });\n\n /**\n * Unbind resize listener:\n * - on destroying, to bring markup to its initial state\n */\n Events.on('destroy', function () {\n Binder.off('resize', window);\n });\n\n return Breakpoints;\n}\n\nvar COMPONENTS = {\n // Required\n Html: Html,\n Translate: Translate,\n Transition: Transition,\n Direction: Direction,\n Peek: Peek,\n Sizes: Sizes,\n Gaps: Gaps,\n Move: Move,\n Clones: Clones,\n Resize: Resize,\n Build: Build,\n Run: Run,\n\n // Optional\n Swipe: Swipe,\n Images: Images,\n Anchors: Anchors,\n Controls: Controls,\n Keyboard: Keyboard,\n Autoplay: Autoplay,\n Breakpoints: Breakpoints\n};\n\nvar Glide$1 = function (_Core) {\n inherits(Glide$$1, _Core);\n\n function Glide$$1() {\n classCallCheck(this, Glide$$1);\n return possibleConstructorReturn(this, (Glide$$1.__proto__ || Object.getPrototypeOf(Glide$$1)).apply(this, arguments));\n }\n\n createClass(Glide$$1, [{\n key: 'mount',\n value: function mount() {\n var extensions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n return get(Glide$$1.prototype.__proto__ || Object.getPrototypeOf(Glide$$1.prototype), 'mount', this).call(this, _extends({}, COMPONENTS, extensions));\n }\n }]);\n return Glide$$1;\n}(Glide);\n\nexport default Glide$1;\n", "import { ComponentFunction } from \"@glidejs/glide\";\r\nimport Glide from \"@glidejs/glide\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"AxProdMain\")\r\nexport class AxProdMain implements AxInit {\r\n private Glides: Map<string, Glide.Static> = new Map<string, Glide.Static>();\r\n\r\n constructor() { }\r\n\r\n AxInit(init: any): void {\r\n\r\n $('.ax-products__groupList[data-display-mode=\"swiper\"]').each((i, x) => {\r\n let glideID: string = $(x).attr('id');\r\n let rows: number = $(x).data('rows');\r\n\r\n let glide = new Glide('#' + glideID, {\r\n type: 'slider',\r\n perView: rows,\r\n rewind: false,\r\n bound: true,\r\n animationDuration: 300,\r\n breakpoints: {\r\n 800: {\r\n perView: 2\r\n },\r\n 480: {\r\n perView: 1\r\n }\r\n },\r\n classes: {\r\n activeSlide: 'glide__slide--active',\r\n disabledArrow: 'glide__arrow--disabled'\r\n },\r\n gap: 0\r\n });\r\n\r\n this.Glides.set(glideID, glide);\r\n\r\n glide.on('run.before', e => {\r\n e.steps = e.direction === '>' ? -glide.settings.perView : glide.settings.perView\r\n })\r\n glide.mount({\r\n 'DisableControls': this.updateGlideFunc\r\n });\r\n });\r\n }\r\n\r\n private updateGlideFunc: ComponentFunction = (glide: Glide.Static, Components: any, Events: any) => {\r\n\r\n const PREV_CONTROL_SELECTOR = \"[data-glide-dir='<']\";\r\n const NEXT_CONTROL_SELECTOR = \"[data-glide-dir='>']\";\r\n const component = {\r\n buildAfter() {\r\n this.prevBtn = Components.Html.root.querySelector(PREV_CONTROL_SELECTOR);\r\n this.nextBtn = Components.Html.root.querySelector(NEXT_CONTROL_SELECTOR);\r\n },\r\n handleDisable() {\r\n const perView = glide.settings.perView;\r\n const slidesCount = Components.Html.slides.length;\r\n\r\n this.prevBtn.disabled = (glide.index <= 0);\r\n this.nextBtn.disabled = (glide.index >= slidesCount - perView);\r\n },\r\n mount() {\r\n }\r\n };\r\n\r\n Events.on(\"build.after\", function () {\r\n component.buildAfter();\r\n component.handleDisable();\r\n });\r\n Events.on(\"run.after\", function () {\r\n component.handleDisable();\r\n });\r\n return component;\r\n }\r\n}\r\n\r\ninterface GliderMovement {\r\n direction: string;\r\n steps: string;\r\n}\r\n", "import { PackagePosition } from \"../../Models/Package/PackagePosition\";\r\nimport { PersonType } from \"../../Models/Tickets/PersonType\";\r\nimport { Product } from \"../../Models/Tickets/Product\";\r\n\r\nexport class ProductMapper {\r\n GetPersonTypeList(productList: Product[]): PersonType[] {\r\n let personTypes: PersonType[] = [];\r\n for (let prod of productList) {\r\n if (prod.Quantity > 0) {\r\n personTypes.push({\r\n PersonTypeId: prod.SubProductIdentifier,\r\n Quantity: prod.Quantity\r\n });\r\n }\r\n }\r\n return personTypes;\r\n }\r\n\r\n GetPackagePositionList(productList: Product[]): PackagePosition[] {\r\n let positions: PackagePosition[] = [];\r\n for (let prod of productList) {\r\n positions.push({\r\n PackPos: prod.SubProductIdentifier,\r\n Quantity: prod.Quantity,\r\n PackSort: prod.Sort\r\n });\r\n }\r\n return positions;\r\n }\r\n}", "import { Map } from \"../Types/Map\";\r\n\r\nexport class I18nHelper {\r\n static TransList: Map<string> = new Map<string>();\r\n private static Loaded: boolean = false;\r\n\r\n constructor() {\r\n if (!I18nHelper.Loaded) {\r\n if (typeof Translation == 'undefined' || Translation == null) {\r\n return;\r\n }\r\n\r\n for (let trans of Translation) {\r\n I18nHelper.TransList.add(trans[0].charAt(0).toUpperCase() + trans[0].slice(1), trans[1]);\r\n }\r\n }\r\n }\r\n\r\n GetTranslation(key: Translations, ...args: any[]): string {\r\n let translation = I18nHelper.TransList.get(Translations[key]);\r\n return (translation || \"\").replace(/\\{[0-9]\\}/g, (substring) => args[substring.substring(1, substring.length - 1)] ?? '');\r\n }\r\n}\r\n\r\n//Always Uppercase\r\nexport enum Translations {\r\n Ticket,\r\n Tickets,\r\n Reserve,\r\n Summary,\r\n Checkout,\r\n Timings,\r\n QuantityDate,\r\n Error,\r\n TicketVerification,\r\n ReservationManagement,\r\n DateTimeReservation,\r\n Confirmation,\r\n Next,\r\n CountAvailable,\r\n AreYouSure,\r\n OneWayReservation,\r\n ConfirmReservation,\r\n DeleteReservationPopup,\r\n DeleteConfirmationPopup,\r\n NotValidSerialNumber,\r\n ValueMissing,\r\n CartAdd,\r\n OnlyNumbers,\r\n NotValidWtp,\r\n DrpZneDefaultMessage,\r\n Various,\r\n People,\r\n DrpZneFallbackMessage,\r\n Location,\r\n DrpZneFallbackText,\r\n DrpZneFileTooBig,\r\n DrpZneInvalidFileType,\r\n SlotsN,\r\n WTPNumberNotFound,\r\n LevelsAll,\r\n DrpZneResponseError,\r\n DrpZneCancelUpload,\r\n DrpZneCancelUploadConfirmation,\r\n DrpZneRemoveFile,\r\n DrpZneMaxFilesExceeded,\r\n Success,\r\n FeldErforderlich,\r\n AddressPleaseAdd,\r\n BookNow,\r\n PasswordNotValid,\r\n PasswordUnequal,\r\n SelectTicket,\r\n AmountAndDesign,\r\n Personalize,\r\n ValidationMail,\r\n From,\r\n To,\r\n Message,\r\n PleaseSelectGiftCardTemplate,\r\n Cancel,\r\n SelectCard,\r\n SlotsAvailable,\r\n DeviceNotSupported,\r\n ServerErrorText1,\r\n ServerErrorText2,\r\n Oops,\r\n Ok,\r\n OutOfX,\r\n VoucherCurrentlyNotRedeemable,\r\n VoucherNotPartlyRedeemable,\r\n CartCart,\r\n ProductSelectionRequired,\r\n WtpPleaseInsert,\r\n ShowXResults,\r\n LegitimationCheckError,\r\n SelectDate,\r\n Continue,\r\n SelectAtLeastOneTicket,\r\n State,\r\n LoginCredentialsWrong,\r\n LoginSuccess,\r\n AddCoverPoster,\r\n AddCoverForVideo,\r\n YesPlease,\r\n NoThanks,\r\n Whoops,\r\n MaxQuantity,\r\n MinQuantity,\r\n MaximumFileSize,\r\n AcceptableFilesExtention,\r\n ConfirmationEmailSent,\r\n Free,\r\n SoldOut,\r\n MyTicketsInfoBarCode,\r\n MyTicketsInfoVoucher,\r\n MyTicketsInfoBLE,\r\n LinkCopiedToClipboard,\r\n WrongDay,\r\n WrongSelectedDay,\r\n AdminClose,\r\n Rentals,\r\n MandatoryRentalDataMissing,\r\n RentalNoPersonSelected,\r\n OneRISKProcessIsRequiredBeforeProceed,\r\n OneRISKNecessityMessage,\r\n Warning,\r\n WaiverSaveFail,\r\n WaiverIsCompleted,\r\n BodyLoggingEnabledAlert,\r\n RentalAdditionalOptions,\r\n RentalYouCanSkipThisPart,\r\n RentalNoProperties,\r\n ProceedToCheckout,\r\n QuantityTicket,\r\n SelectCategoryFirst,\r\n SelectDateFirst,\r\n SelectTicketFirst,\r\n TicketsX,\r\n SelectACategory,\r\n SelectAStartingDate,\r\n NumberOfTickets,\r\n WaiverModal,\r\n ResetSelection,\r\n}\r\n", "export class AxProgressBar {\r\n private Target: JQuery<HTMLElement>;\r\n private Options: Options;\r\n\r\n private working = false;\r\n\r\n Init(options: Options) {\r\n this.Options = options;\r\n this.Target = $(this.Options.target);\r\n\r\n if (this.Target.length > 0) {\r\n this.Target.addClass('ax-progressbar').addClass('ax-progressbar--header');\r\n\r\n for (let step of this.Options.steps) {\r\n let outer = document.createElement('div');\r\n if (step.type != 'divider') {\r\n outer.classList.add('ax-progressbar-step');\r\n\r\n if (step.type != 'inactive') {\r\n outer.classList.add('ax-progressbar-step--' + step.type);\r\n }\r\n\r\n let icon = document.createElement('i');\r\n outer.appendChild(icon);\r\n\r\n let label = document.createElement('div');\r\n label.innerHTML = step.label;\r\n outer.appendChild(label);\r\n } else {\r\n outer.classList.add('ax-progressbar--header-divider');\r\n }\r\n this.Target.append(outer);\r\n step.elem = outer;\r\n }\r\n\r\n this.checkProgressBarSize();\r\n\r\n $(window).on(\"resize\", () => {\r\n this.checkProgressBarSize();\r\n });\r\n }\r\n }\r\n\r\n checkProgressBarSize() {\r\n let isOverflow: boolean = true;\r\n\r\n if (!this.working) {\r\n this.working = true;\r\n const currentActiveIndex = this.Options.steps.findIndex(x => x.type === 'active');\r\n ;\r\n while (isOverflow) { isOverflow = this.checkOverflow(currentActiveIndex) }\r\n\r\n if (!isOverflow) {\r\n this.checkNoOverflow(currentActiveIndex);\r\n }\r\n this.working = false;\r\n }\r\n }\r\n\r\n checkNoOverflow(currentActiveIndex: number) {\r\n const firstInactive = this.Options.steps.findIndex(x => x.type === 'hidden');\r\n\r\n if (this.isOverflown(this.Target[0]) || firstInactive === -1) {\r\n return;\r\n }\r\n\r\n const startIndexDif = firstInactive < currentActiveIndex ? (currentActiveIndex - this.Options.steps.findIndex(x => x.type !== 'hidden')) + 1 : -1;\r\n\r\n const firstInactiveEnd = this.Options.steps.slice(currentActiveIndex).findIndex(x => x.type === 'hidden');\r\n const endIndexDif = firstInactiveEnd !== -1 ? firstInactiveEnd : startIndexDif + 1;\r\n\r\n let stepToShow: Step;\r\n if (startIndexDif >= 0 && startIndexDif < endIndexDif) {\r\n stepToShow = this.Options.steps[currentActiveIndex - startIndexDif];\r\n } else {\r\n stepToShow = this.Options.steps[currentActiveIndex + endIndexDif];\r\n }\r\n stepToShow.type = stepToShow.orgType;\r\n stepToShow.elem.style.visibility = 'hidden';\r\n stepToShow.elem.classList.remove('ax-progressbar-step--hidden');\r\n\r\n this.checkOverflow(currentActiveIndex);\r\n stepToShow.elem.style.visibility = 'visible';\r\n }\r\n\r\n checkOverflow(currentActiveIndex: number): boolean {\r\n if (!this.isOverflown(this.Target[0])) {\r\n return false;\r\n }\r\n const reverseSteps = this.Options.steps.slice().reverse();\r\n const startIndexDif = currentActiveIndex - this.Options.steps.findIndex(x => x.type !== 'hidden');\r\n const endIndexDif = (currentActiveIndex - (reverseSteps.length - reverseSteps.findIndex(x => x.type !== 'hidden'))) * -1 - 1;\r\n\r\n let stepToRemove: Step;\r\n if (startIndexDif >= endIndexDif) {\r\n stepToRemove = this.Options.steps[currentActiveIndex - startIndexDif];\r\n } else {\r\n stepToRemove = this.Options.steps[currentActiveIndex + endIndexDif];\r\n }\r\n\r\n stepToRemove.orgType = stepToRemove.type;\r\n stepToRemove.type = 'hidden';\r\n stepToRemove.elem.classList.add('ax-progressbar-step--hidden');\r\n\r\n return true;\r\n }\r\n\r\n isOverflown(element: HTMLElement) {\r\n return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\r\n }\r\n\r\n destroy() {\r\n this.Target.html('');\r\n }\r\n}\r\n\r\nexport interface Options {\r\n target: string;\r\n steps: Step[];\r\n}\r\n\r\nexport interface Step {\r\n label?: string;\r\n type: 'inactive' | 'active' | 'done' | 'divider' | 'hidden';\r\n orgType?: 'inactive' | 'active' | 'done' | 'divider' | 'hidden';\r\n elem?: HTMLDivElement;\r\n alias?: string;\r\n}", "import { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxProgressBar, Step } from \"../../Limestone/AxProgressBar/AxProgressBar\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { AxStaticConfigModule } from \"../AxConfig/AxStaticConfigModule\";\r\n\r\nexport class ProgressBar {\r\n constructor(private i18nHelper = new I18nHelper()) { }\r\n\r\n Init(initData: ProgressBarInit) {\r\n let progressBar = new AxProgressBar();\r\n\r\n let count = -1;\r\n let steps: Step[];\r\n \r\n switch (initData.Mode) {\r\n case ProgressBarMode.Suballotment:\r\n steps = this.GetSuballotmentSteps();\r\n break;\r\n case\r\n ProgressBarMode.Reservation:\r\n steps = this.GetReservationSteps();\r\n break;\r\n default:\r\n steps = this.GetDefaultSteps();\r\n break;\r\n }\r\n\r\n\r\n if (initData.Mode == ProgressBarMode.Default || initData.Mode == ProgressBarMode.Suballotment) {\r\n let configModule = AxLoad.GetModule<AxStaticConfigModule>('AxStaticConfigModule');\r\n\r\n if (configModule.skipSummary) {\r\n if (initData.Progress >= steps.findIndex(x => x.alias === 'summary')) {\r\n initData.Progress--;\r\n }\r\n steps = steps.filter(x => x.alias !== 'summary');\r\n }\r\n }\r\n\r\n for (let step of steps) {\r\n if (count != -1) {\r\n if (count < initData.Progress) {\r\n step.type = 'done';\r\n } else if (count == initData.Progress) {\r\n step.type = 'active';\r\n } else if (count > initData.Progress) {\r\n step.type = 'inactive';\r\n }\r\n }\r\n count++;\r\n }\r\n\r\n progressBar.Init({\r\n target: '.header__progressbar',\r\n steps: steps\r\n });\r\n }\r\n\r\n GetDefaultSteps(): Step[] {\r\n return [\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.Ticket),\r\n type: 'done'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.QuantityDate),\r\n type: 'active'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.Summary),\r\n type: 'inactive',\r\n alias: 'summary'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.CartCart),\r\n type: 'inactive'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.Checkout),\r\n type: 'inactive'\r\n }\r\n ];\r\n }\r\n\r\n GetSuballotmentSteps(): Step[] {\r\n return [\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.Ticket),\r\n type: 'done'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.QuantityDate),\r\n type: 'active'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.Timings),\r\n type: 'inactive'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.Summary),\r\n type: 'inactive',\r\n alias: 'summary'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.CartCart),\r\n type: 'inactive'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.Checkout),\r\n type: 'inactive'\r\n }\r\n ];\r\n }\r\n\r\n GetReservationSteps(): Step[] {\r\n return [\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.TicketVerification),\r\n type: 'active'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.ReservationManagement),\r\n type: 'inactive'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.DateTimeReservation),\r\n type: 'inactive'\r\n },\r\n\r\n ];\r\n }\r\n}\r\n\r\nexport interface ProgressBarInit {\r\n Progress: number;\r\n Mode: ProgressBarMode\r\n}\r\n\r\nexport enum ProgressBarMode {\r\n Default,\r\n Suballotment,\r\n Reservation\r\n}", "const isString = obj => typeof obj === 'string';\nconst defer = () => {\n let res;\n let rej;\n const promise = new Promise((resolve, reject) => {\n res = resolve;\n rej = reject;\n });\n promise.resolve = res;\n promise.reject = rej;\n return promise;\n};\nconst makeString = object => {\n if (object == null) return '';\n return '' + object;\n};\nconst copy = (a, s, t) => {\n a.forEach(m => {\n if (s[m]) t[m] = s[m];\n });\n};\nconst lastOfPathSeparatorRegExp = /###/g;\nconst cleanKey = key => key && key.indexOf('###') > -1 ? key.replace(lastOfPathSeparatorRegExp, '.') : key;\nconst canNotTraverseDeeper = object => !object || isString(object);\nconst getLastOfPath = (object, path, Empty) => {\n const stack = !isString(path) ? path : path.split('.');\n let stackIndex = 0;\n while (stackIndex < stack.length - 1) {\n if (canNotTraverseDeeper(object)) return {};\n const key = cleanKey(stack[stackIndex]);\n if (!object[key] && Empty) object[key] = new Empty();\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n object = object[key];\n } else {\n object = {};\n }\n ++stackIndex;\n }\n if (canNotTraverseDeeper(object)) return {};\n return {\n obj: object,\n k: cleanKey(stack[stackIndex])\n };\n};\nconst setPath = (object, path, newValue) => {\n const {\n obj,\n k\n } = getLastOfPath(object, path, Object);\n if (obj !== undefined || path.length === 1) {\n obj[k] = newValue;\n return;\n }\n let e = path[path.length - 1];\n let p = path.slice(0, path.length - 1);\n let last = getLastOfPath(object, p, Object);\n while (last.obj === undefined && p.length) {\n e = `${p[p.length - 1]}.${e}`;\n p = p.slice(0, p.length - 1);\n last = getLastOfPath(object, p, Object);\n if (last && last.obj && typeof last.obj[`${last.k}.${e}`] !== 'undefined') {\n last.obj = undefined;\n }\n }\n last.obj[`${last.k}.${e}`] = newValue;\n};\nconst pushPath = (object, path, newValue, concat) => {\n const {\n obj,\n k\n } = getLastOfPath(object, path, Object);\n obj[k] = obj[k] || [];\n obj[k].push(newValue);\n};\nconst getPath = (object, path) => {\n const {\n obj,\n k\n } = getLastOfPath(object, path);\n if (!obj) return undefined;\n return obj[k];\n};\nconst getPathWithDefaults = (data, defaultData, key) => {\n const value = getPath(data, key);\n if (value !== undefined) {\n return value;\n }\n return getPath(defaultData, key);\n};\nconst deepExtend = (target, source, overwrite) => {\n for (const prop in source) {\n if (prop !== '__proto__' && prop !== 'constructor') {\n if (prop in target) {\n if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {\n if (overwrite) target[prop] = source[prop];\n } else {\n deepExtend(target[prop], source[prop], overwrite);\n }\n } else {\n target[prop] = source[prop];\n }\n }\n }\n return target;\n};\nconst regexEscape = str => str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\nvar _entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n};\nconst escape = data => {\n if (isString(data)) {\n return data.replace(/[&<>\"'\\/]/g, s => _entityMap[s]);\n }\n return data;\n};\nclass RegExpCache {\n constructor(capacity) {\n this.capacity = capacity;\n this.regExpMap = new Map();\n this.regExpQueue = [];\n }\n getRegExp(pattern) {\n const regExpFromCache = this.regExpMap.get(pattern);\n if (regExpFromCache !== undefined) {\n return regExpFromCache;\n }\n const regExpNew = new RegExp(pattern);\n if (this.regExpQueue.length === this.capacity) {\n this.regExpMap.delete(this.regExpQueue.shift());\n }\n this.regExpMap.set(pattern, regExpNew);\n this.regExpQueue.push(pattern);\n return regExpNew;\n }\n}\nconst chars = [' ', ',', '?', '!', ';'];\nconst looksLikeObjectPathRegExpCache = new RegExpCache(20);\nconst looksLikeObjectPath = (key, nsSeparator, keySeparator) => {\n nsSeparator = nsSeparator || '';\n keySeparator = keySeparator || '';\n const possibleChars = chars.filter(c => nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0);\n if (possibleChars.length === 0) return true;\n const r = looksLikeObjectPathRegExpCache.getRegExp(`(${possibleChars.map(c => c === '?' ? '\\\\?' : c).join('|')})`);\n let matched = !r.test(key);\n if (!matched) {\n const ki = key.indexOf(keySeparator);\n if (ki > 0 && !r.test(key.substring(0, ki))) {\n matched = true;\n }\n }\n return matched;\n};\nconst deepFind = function (obj, path) {\n let keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';\n if (!obj) return undefined;\n if (obj[path]) return obj[path];\n const tokens = path.split(keySeparator);\n let current = obj;\n for (let i = 0; i < tokens.length;) {\n if (!current || typeof current !== 'object') {\n return undefined;\n }\n let next;\n let nextPath = '';\n for (let j = i; j < tokens.length; ++j) {\n if (j !== i) {\n nextPath += keySeparator;\n }\n nextPath += tokens[j];\n next = current[nextPath];\n if (next !== undefined) {\n if (['string', 'number', 'boolean'].indexOf(typeof next) > -1 && j < tokens.length - 1) {\n continue;\n }\n i += j - i + 1;\n break;\n }\n }\n current = next;\n }\n return current;\n};\nconst getCleanedCode = code => code && code.replace('_', '-');\n\nconst consoleLogger = {\n type: 'logger',\n log(args) {\n this.output('log', args);\n },\n warn(args) {\n this.output('warn', args);\n },\n error(args) {\n this.output('error', args);\n },\n output(type, args) {\n if (console && console[type]) console[type].apply(console, args);\n }\n};\nclass Logger {\n constructor(concreteLogger) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.init(concreteLogger, options);\n }\n init(concreteLogger) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.prefix = options.prefix || 'i18next:';\n this.logger = concreteLogger || consoleLogger;\n this.options = options;\n this.debug = options.debug;\n }\n log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return this.forward(args, 'log', '', true);\n }\n warn() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return this.forward(args, 'warn', '', true);\n }\n error() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n return this.forward(args, 'error', '');\n }\n deprecate() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);\n }\n forward(args, lvl, prefix, debugOnly) {\n if (debugOnly && !this.debug) return null;\n if (isString(args[0])) args[0] = `${prefix}${this.prefix} ${args[0]}`;\n return this.logger[lvl](args);\n }\n create(moduleName) {\n return new Logger(this.logger, {\n ...{\n prefix: `${this.prefix}:${moduleName}:`\n },\n ...this.options\n });\n }\n clone(options) {\n options = options || this.options;\n options.prefix = options.prefix || this.prefix;\n return new Logger(this.logger, options);\n }\n}\nvar baseLogger = new Logger();\n\nclass EventEmitter {\n constructor() {\n this.observers = {};\n }\n on(events, listener) {\n events.split(' ').forEach(event => {\n if (!this.observers[event]) this.observers[event] = new Map();\n const numListeners = this.observers[event].get(listener) || 0;\n this.observers[event].set(listener, numListeners + 1);\n });\n return this;\n }\n off(event, listener) {\n if (!this.observers[event]) return;\n if (!listener) {\n delete this.observers[event];\n return;\n }\n this.observers[event].delete(listener);\n }\n emit(event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n if (this.observers[event]) {\n const cloned = Array.from(this.observers[event].entries());\n cloned.forEach(_ref => {\n let [observer, numTimesAdded] = _ref;\n for (let i = 0; i < numTimesAdded; i++) {\n observer(...args);\n }\n });\n }\n if (this.observers['*']) {\n const cloned = Array.from(this.observers['*'].entries());\n cloned.forEach(_ref2 => {\n let [observer, numTimesAdded] = _ref2;\n for (let i = 0; i < numTimesAdded; i++) {\n observer.apply(observer, [event, ...args]);\n }\n });\n }\n }\n}\n\nclass ResourceStore extends EventEmitter {\n constructor(data) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n ns: ['translation'],\n defaultNS: 'translation'\n };\n super();\n this.data = data || {};\n this.options = options;\n if (this.options.keySeparator === undefined) {\n this.options.keySeparator = '.';\n }\n if (this.options.ignoreJSONStructure === undefined) {\n this.options.ignoreJSONStructure = true;\n }\n }\n addNamespaces(ns) {\n if (this.options.ns.indexOf(ns) < 0) {\n this.options.ns.push(ns);\n }\n }\n removeNamespaces(ns) {\n const index = this.options.ns.indexOf(ns);\n if (index > -1) {\n this.options.ns.splice(index, 1);\n }\n }\n getResource(lng, ns, key) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n const ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;\n let path;\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n } else {\n path = [lng, ns];\n if (key) {\n if (Array.isArray(key)) {\n path.push(...key);\n } else if (isString(key) && keySeparator) {\n path.push(...key.split(keySeparator));\n } else {\n path.push(key);\n }\n }\n }\n const result = getPath(this.data, path);\n if (!result && !ns && !key && lng.indexOf('.') > -1) {\n lng = path[0];\n ns = path[1];\n key = path.slice(2).join('.');\n }\n if (result || !ignoreJSONStructure || !isString(key)) return result;\n return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);\n }\n addResource(lng, ns, key, value) {\n let options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n silent: false\n };\n const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n let path = [lng, ns];\n if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n value = ns;\n ns = path[1];\n }\n this.addNamespaces(ns);\n setPath(this.data, path, value);\n if (!options.silent) this.emit('added', lng, ns, key, value);\n }\n addResources(lng, ns, resources) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n silent: false\n };\n for (const m in resources) {\n if (isString(resources[m]) || Array.isArray(resources[m])) this.addResource(lng, ns, m, resources[m], {\n silent: true\n });\n }\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n addResourceBundle(lng, ns, resources, deep, overwrite) {\n let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {\n silent: false,\n skipCopy: false\n };\n let path = [lng, ns];\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n deep = resources;\n resources = ns;\n ns = path[1];\n }\n this.addNamespaces(ns);\n let pack = getPath(this.data, path) || {};\n if (!options.skipCopy) resources = JSON.parse(JSON.stringify(resources));\n if (deep) {\n deepExtend(pack, resources, overwrite);\n } else {\n pack = {\n ...pack,\n ...resources\n };\n }\n setPath(this.data, path, pack);\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n removeResourceBundle(lng, ns) {\n if (this.hasResourceBundle(lng, ns)) {\n delete this.data[lng][ns];\n }\n this.removeNamespaces(ns);\n this.emit('removed', lng, ns);\n }\n hasResourceBundle(lng, ns) {\n return this.getResource(lng, ns) !== undefined;\n }\n getResourceBundle(lng, ns) {\n if (!ns) ns = this.options.defaultNS;\n if (this.options.compatibilityAPI === 'v1') return {\n ...{},\n ...this.getResource(lng, ns)\n };\n return this.getResource(lng, ns);\n }\n getDataByLanguage(lng) {\n return this.data[lng];\n }\n hasLanguageSomeTranslations(lng) {\n const data = this.getDataByLanguage(lng);\n const n = data && Object.keys(data) || [];\n return !!n.find(v => data[v] && Object.keys(data[v]).length > 0);\n }\n toJSON() {\n return this.data;\n }\n}\n\nvar postProcessor = {\n processors: {},\n addPostProcessor(module) {\n this.processors[module.name] = module;\n },\n handle(processors, value, key, options, translator) {\n processors.forEach(processor => {\n if (this.processors[processor]) value = this.processors[processor].process(value, key, options, translator);\n });\n return value;\n }\n};\n\nconst checkedLoadedFor = {};\nclass Translator extends EventEmitter {\n constructor(services) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n super();\n copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, this);\n this.options = options;\n if (this.options.keySeparator === undefined) {\n this.options.keySeparator = '.';\n }\n this.logger = baseLogger.create('translator');\n }\n changeLanguage(lng) {\n if (lng) this.language = lng;\n }\n exists(key) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n interpolation: {}\n };\n if (key === undefined || key === null) {\n return false;\n }\n const resolved = this.resolve(key, options);\n return resolved && resolved.res !== undefined;\n }\n extractFromKey(key, options) {\n let nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;\n if (nsSeparator === undefined) nsSeparator = ':';\n const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n let namespaces = options.ns || this.options.defaultNS || [];\n const wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;\n const seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);\n if (wouldCheckForNsInKey && !seemsNaturalLanguage) {\n const m = key.match(this.interpolator.nestingRegexp);\n if (m && m.length > 0) {\n return {\n key,\n namespaces: isString(namespaces) ? [namespaces] : namespaces\n };\n }\n const parts = key.split(nsSeparator);\n if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();\n key = parts.join(keySeparator);\n }\n return {\n key,\n namespaces: isString(namespaces) ? [namespaces] : namespaces\n };\n }\n translate(keys, options, lastKey) {\n if (typeof options !== 'object' && this.options.overloadTranslationOptionHandler) {\n options = this.options.overloadTranslationOptionHandler(arguments);\n }\n if (typeof options === 'object') options = {\n ...options\n };\n if (!options) options = {};\n if (keys === undefined || keys === null) return '';\n if (!Array.isArray(keys)) keys = [String(keys)];\n const returnDetails = options.returnDetails !== undefined ? options.returnDetails : this.options.returnDetails;\n const keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n const {\n key,\n namespaces\n } = this.extractFromKey(keys[keys.length - 1], options);\n const namespace = namespaces[namespaces.length - 1];\n const lng = options.lng || this.language;\n const appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;\n if (lng && lng.toLowerCase() === 'cimode') {\n if (appendNamespaceToCIMode) {\n const nsSeparator = options.nsSeparator || this.options.nsSeparator;\n if (returnDetails) {\n return {\n res: `${namespace}${nsSeparator}${key}`,\n usedKey: key,\n exactUsedKey: key,\n usedLng: lng,\n usedNS: namespace,\n usedParams: this.getUsedParamsDetails(options)\n };\n }\n return `${namespace}${nsSeparator}${key}`;\n }\n if (returnDetails) {\n return {\n res: key,\n usedKey: key,\n exactUsedKey: key,\n usedLng: lng,\n usedNS: namespace,\n usedParams: this.getUsedParamsDetails(options)\n };\n }\n return key;\n }\n const resolved = this.resolve(keys, options);\n let res = resolved && resolved.res;\n const resUsedKey = resolved && resolved.usedKey || key;\n const resExactUsedKey = resolved && resolved.exactUsedKey || key;\n const resType = Object.prototype.toString.apply(res);\n const noObject = ['[object Number]', '[object Function]', '[object RegExp]'];\n const joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;\n const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;\n const handleAsObject = !isString(res) && typeof res !== 'boolean' && typeof res !== 'number';\n if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(res))) {\n if (!options.returnObjects && !this.options.returnObjects) {\n if (!this.options.returnedObjectHandler) {\n this.logger.warn('accessing an object - but returnObjects options is not enabled!');\n }\n const r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, {\n ...options,\n ns: namespaces\n }) : `key '${key} (${this.language})' returned an object instead of string.`;\n if (returnDetails) {\n resolved.res = r;\n resolved.usedParams = this.getUsedParamsDetails(options);\n return resolved;\n }\n return r;\n }\n if (keySeparator) {\n const resTypeIsArray = Array.isArray(res);\n const copy = resTypeIsArray ? [] : {};\n const newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;\n for (const m in res) {\n if (Object.prototype.hasOwnProperty.call(res, m)) {\n const deepKey = `${newKeyToUse}${keySeparator}${m}`;\n copy[m] = this.translate(deepKey, {\n ...options,\n ...{\n joinArrays: false,\n ns: namespaces\n }\n });\n if (copy[m] === deepKey) copy[m] = res[m];\n }\n }\n res = copy;\n }\n } else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {\n res = res.join(joinArrays);\n if (res) res = this.extendTranslation(res, keys, options, lastKey);\n } else {\n let usedDefault = false;\n let usedKey = false;\n const needsPluralHandling = options.count !== undefined && !isString(options.count);\n const hasDefaultValue = Translator.hasDefaultValue(options);\n const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : '';\n const defaultValueSuffixOrdinalFallback = options.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, {\n ordinal: false\n }) : '';\n const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && this.pluralResolver.shouldUseIntlApi();\n const defaultValue = needsZeroSuffixLookup && options[`defaultValue${this.options.pluralSeparator}zero`] || options[`defaultValue${defaultValueSuffix}`] || options[`defaultValue${defaultValueSuffixOrdinalFallback}`] || options.defaultValue;\n if (!this.isValidLookup(res) && hasDefaultValue) {\n usedDefault = true;\n res = defaultValue;\n }\n if (!this.isValidLookup(res)) {\n usedKey = true;\n res = key;\n }\n const missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;\n const resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;\n const updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;\n if (usedKey || usedDefault || updateMissing) {\n this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);\n if (keySeparator) {\n const fk = this.resolve(key, {\n ...options,\n keySeparator: false\n });\n if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');\n }\n let lngs = [];\n const fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);\n if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {\n for (let i = 0; i < fallbackLngs.length; i++) {\n lngs.push(fallbackLngs[i]);\n }\n } else if (this.options.saveMissingTo === 'all') {\n lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);\n } else {\n lngs.push(options.lng || this.language);\n }\n const send = (l, k, specificDefaultValue) => {\n const defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;\n if (this.options.missingKeyHandler) {\n this.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);\n } else if (this.backendConnector && this.backendConnector.saveMissing) {\n this.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);\n }\n this.emit('missingKey', l, namespace, k, res);\n };\n if (this.options.saveMissing) {\n if (this.options.saveMissingPlurals && needsPluralHandling) {\n lngs.forEach(language => {\n const suffixes = this.pluralResolver.getSuffixes(language, options);\n if (needsZeroSuffixLookup && options[`defaultValue${this.options.pluralSeparator}zero`] && suffixes.indexOf(`${this.options.pluralSeparator}zero`) < 0) {\n suffixes.push(`${this.options.pluralSeparator}zero`);\n }\n suffixes.forEach(suffix => {\n send([language], key + suffix, options[`defaultValue${suffix}`] || defaultValue);\n });\n });\n } else {\n send(lngs, key, defaultValue);\n }\n }\n }\n res = this.extendTranslation(res, keys, options, resolved, lastKey);\n if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = `${namespace}:${key}`;\n if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) {\n if (this.options.compatibilityAPI !== 'v1') {\n res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${namespace}:${key}` : key, usedDefault ? res : undefined);\n } else {\n res = this.options.parseMissingKeyHandler(res);\n }\n }\n }\n if (returnDetails) {\n resolved.res = res;\n resolved.usedParams = this.getUsedParamsDetails(options);\n return resolved;\n }\n return res;\n }\n extendTranslation(res, key, options, resolved, lastKey) {\n var _this = this;\n if (this.i18nFormat && this.i18nFormat.parse) {\n res = this.i18nFormat.parse(res, {\n ...this.options.interpolation.defaultVariables,\n ...options\n }, options.lng || this.language || resolved.usedLng, resolved.usedNS, resolved.usedKey, {\n resolved\n });\n } else if (!options.skipInterpolation) {\n if (options.interpolation) this.interpolator.init({\n ...options,\n ...{\n interpolation: {\n ...this.options.interpolation,\n ...options.interpolation\n }\n }\n });\n const skipOnVariables = isString(res) && (options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);\n let nestBef;\n if (skipOnVariables) {\n const nb = res.match(this.interpolator.nestingRegexp);\n nestBef = nb && nb.length;\n }\n let data = options.replace && !isString(options.replace) ? options.replace : options;\n if (this.options.interpolation.defaultVariables) data = {\n ...this.options.interpolation.defaultVariables,\n ...data\n };\n res = this.interpolator.interpolate(res, data, options.lng || this.language || resolved.usedLng, options);\n if (skipOnVariables) {\n const na = res.match(this.interpolator.nestingRegexp);\n const nestAft = na && na.length;\n if (nestBef < nestAft) options.nest = false;\n }\n if (!options.lng && this.options.compatibilityAPI !== 'v1' && resolved && resolved.res) options.lng = this.language || resolved.usedLng;\n if (options.nest !== false) res = this.interpolator.nest(res, function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (lastKey && lastKey[0] === args[0] && !options.context) {\n _this.logger.warn(`It seems you are nesting recursively key: ${args[0]} in key: ${key[0]}`);\n return null;\n }\n return _this.translate(...args, key);\n }, options);\n if (options.interpolation) this.interpolator.reset();\n }\n const postProcess = options.postProcess || this.options.postProcess;\n const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;\n if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {\n res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {\n i18nResolved: {\n ...resolved,\n usedParams: this.getUsedParamsDetails(options)\n },\n ...options\n } : options, this);\n }\n return res;\n }\n resolve(keys) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let found;\n let usedKey;\n let exactUsedKey;\n let usedLng;\n let usedNS;\n if (isString(keys)) keys = [keys];\n keys.forEach(k => {\n if (this.isValidLookup(found)) return;\n const extracted = this.extractFromKey(k, options);\n const key = extracted.key;\n usedKey = key;\n let namespaces = extracted.namespaces;\n if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);\n const needsPluralHandling = options.count !== undefined && !isString(options.count);\n const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && this.pluralResolver.shouldUseIntlApi();\n const needsContextHandling = options.context !== undefined && (isString(options.context) || typeof options.context === 'number') && options.context !== '';\n const codes = options.lngs ? options.lngs : this.languageUtils.toResolveHierarchy(options.lng || this.language, options.fallbackLng);\n namespaces.forEach(ns => {\n if (this.isValidLookup(found)) return;\n usedNS = ns;\n if (!checkedLoadedFor[`${codes[0]}-${ns}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(usedNS)) {\n checkedLoadedFor[`${codes[0]}-${ns}`] = true;\n this.logger.warn(`key \"${usedKey}\" for languages \"${codes.join(', ')}\" won't get resolved as namespace \"${usedNS}\" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n }\n codes.forEach(code => {\n if (this.isValidLookup(found)) return;\n usedLng = code;\n const finalKeys = [key];\n if (this.i18nFormat && this.i18nFormat.addLookupKeys) {\n this.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);\n } else {\n let pluralSuffix;\n if (needsPluralHandling) pluralSuffix = this.pluralResolver.getSuffix(code, options.count, options);\n const zeroSuffix = `${this.options.pluralSeparator}zero`;\n const ordinalPrefix = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;\n if (needsPluralHandling) {\n finalKeys.push(key + pluralSuffix);\n if (options.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {\n finalKeys.push(key + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));\n }\n if (needsZeroSuffixLookup) {\n finalKeys.push(key + zeroSuffix);\n }\n }\n if (needsContextHandling) {\n const contextKey = `${key}${this.options.contextSeparator}${options.context}`;\n finalKeys.push(contextKey);\n if (needsPluralHandling) {\n finalKeys.push(contextKey + pluralSuffix);\n if (options.ordinal && pluralSuffix.indexOf(ordinalPrefix) === 0) {\n finalKeys.push(contextKey + pluralSuffix.replace(ordinalPrefix, this.options.pluralSeparator));\n }\n if (needsZeroSuffixLookup) {\n finalKeys.push(contextKey + zeroSuffix);\n }\n }\n }\n }\n let possibleKey;\n while (possibleKey = finalKeys.pop()) {\n if (!this.isValidLookup(found)) {\n exactUsedKey = possibleKey;\n found = this.getResource(code, ns, possibleKey, options);\n }\n }\n });\n });\n });\n return {\n res: found,\n usedKey,\n exactUsedKey,\n usedLng,\n usedNS\n };\n }\n isValidLookup(res) {\n return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');\n }\n getResource(code, ns, key) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);\n return this.resourceStore.getResource(code, ns, key, options);\n }\n getUsedParamsDetails() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const optionsKeys = ['defaultValue', 'ordinal', 'context', 'replace', 'lng', 'lngs', 'fallbackLng', 'ns', 'keySeparator', 'nsSeparator', 'returnObjects', 'returnDetails', 'joinArrays', 'postProcess', 'interpolation'];\n const useOptionsReplaceForData = options.replace && !isString(options.replace);\n let data = useOptionsReplaceForData ? options.replace : options;\n if (useOptionsReplaceForData && typeof options.count !== 'undefined') {\n data.count = options.count;\n }\n if (this.options.interpolation.defaultVariables) {\n data = {\n ...this.options.interpolation.defaultVariables,\n ...data\n };\n }\n if (!useOptionsReplaceForData) {\n data = {\n ...data\n };\n for (const key of optionsKeys) {\n delete data[key];\n }\n }\n return data;\n }\n static hasDefaultValue(options) {\n const prefix = 'defaultValue';\n for (const option in options) {\n if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {\n return true;\n }\n }\n return false;\n }\n}\n\nconst capitalize = string => string.charAt(0).toUpperCase() + string.slice(1);\nclass LanguageUtil {\n constructor(options) {\n this.options = options;\n this.supportedLngs = this.options.supportedLngs || false;\n this.logger = baseLogger.create('languageUtils');\n }\n getScriptPartFromCode(code) {\n code = getCleanedCode(code);\n if (!code || code.indexOf('-') < 0) return null;\n const p = code.split('-');\n if (p.length === 2) return null;\n p.pop();\n if (p[p.length - 1].toLowerCase() === 'x') return null;\n return this.formatLanguageCode(p.join('-'));\n }\n getLanguagePartFromCode(code) {\n code = getCleanedCode(code);\n if (!code || code.indexOf('-') < 0) return code;\n const p = code.split('-');\n return this.formatLanguageCode(p[0]);\n }\n formatLanguageCode(code) {\n if (isString(code) && code.indexOf('-') > -1) {\n if (typeof Intl !== 'undefined' && typeof Intl.getCanonicalLocales !== 'undefined') {\n try {\n let formattedCode = Intl.getCanonicalLocales(code)[0];\n if (formattedCode && this.options.lowerCaseLng) {\n formattedCode = formattedCode.toLowerCase();\n }\n if (formattedCode) return formattedCode;\n } catch (e) {}\n }\n const specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];\n let p = code.split('-');\n if (this.options.lowerCaseLng) {\n p = p.map(part => part.toLowerCase());\n } else if (p.length === 2) {\n p[0] = p[0].toLowerCase();\n p[1] = p[1].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n } else if (p.length === 3) {\n p[0] = p[0].toLowerCase();\n if (p[1].length === 2) p[1] = p[1].toUpperCase();\n if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());\n }\n return p.join('-');\n }\n return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;\n }\n isSupportedCode(code) {\n if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {\n code = this.getLanguagePartFromCode(code);\n }\n return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;\n }\n getBestMatchFromCodes(codes) {\n if (!codes) return null;\n let found;\n codes.forEach(code => {\n if (found) return;\n const cleanedLng = this.formatLanguageCode(code);\n if (!this.options.supportedLngs || this.isSupportedCode(cleanedLng)) found = cleanedLng;\n });\n if (!found && this.options.supportedLngs) {\n codes.forEach(code => {\n if (found) return;\n const lngOnly = this.getLanguagePartFromCode(code);\n if (this.isSupportedCode(lngOnly)) return found = lngOnly;\n found = this.options.supportedLngs.find(supportedLng => {\n if (supportedLng === lngOnly) return supportedLng;\n if (supportedLng.indexOf('-') < 0 && lngOnly.indexOf('-') < 0) return;\n if (supportedLng.indexOf('-') > 0 && lngOnly.indexOf('-') < 0 && supportedLng.substring(0, supportedLng.indexOf('-')) === lngOnly) return supportedLng;\n if (supportedLng.indexOf(lngOnly) === 0 && lngOnly.length > 1) return supportedLng;\n });\n });\n }\n if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];\n return found;\n }\n getFallbackCodes(fallbacks, code) {\n if (!fallbacks) return [];\n if (typeof fallbacks === 'function') fallbacks = fallbacks(code);\n if (isString(fallbacks)) fallbacks = [fallbacks];\n if (Array.isArray(fallbacks)) return fallbacks;\n if (!code) return fallbacks.default || [];\n let found = fallbacks[code];\n if (!found) found = fallbacks[this.getScriptPartFromCode(code)];\n if (!found) found = fallbacks[this.formatLanguageCode(code)];\n if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];\n if (!found) found = fallbacks.default;\n return found || [];\n }\n toResolveHierarchy(code, fallbackCode) {\n const fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);\n const codes = [];\n const addCode = c => {\n if (!c) return;\n if (this.isSupportedCode(c)) {\n codes.push(c);\n } else {\n this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`);\n }\n };\n if (isString(code) && (code.indexOf('-') > -1 || code.indexOf('_') > -1)) {\n if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));\n if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));\n if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));\n } else if (isString(code)) {\n addCode(this.formatLanguageCode(code));\n }\n fallbackCodes.forEach(fc => {\n if (codes.indexOf(fc) < 0) addCode(this.formatLanguageCode(fc));\n });\n return codes;\n }\n}\n\nlet sets = [{\n lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],\n nr: [1, 2],\n fc: 1\n}, {\n lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kk', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],\n nr: [1, 2],\n fc: 2\n}, {\n lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],\n nr: [1],\n fc: 3\n}, {\n lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],\n nr: [1, 2, 5],\n fc: 4\n}, {\n lngs: ['ar'],\n nr: [0, 1, 2, 3, 11, 100],\n fc: 5\n}, {\n lngs: ['cs', 'sk'],\n nr: [1, 2, 5],\n fc: 6\n}, {\n lngs: ['csb', 'pl'],\n nr: [1, 2, 5],\n fc: 7\n}, {\n lngs: ['cy'],\n nr: [1, 2, 3, 8],\n fc: 8\n}, {\n lngs: ['fr'],\n nr: [1, 2],\n fc: 9\n}, {\n lngs: ['ga'],\n nr: [1, 2, 3, 7, 11],\n fc: 10\n}, {\n lngs: ['gd'],\n nr: [1, 2, 3, 20],\n fc: 11\n}, {\n lngs: ['is'],\n nr: [1, 2],\n fc: 12\n}, {\n lngs: ['jv'],\n nr: [0, 1],\n fc: 13\n}, {\n lngs: ['kw'],\n nr: [1, 2, 3, 4],\n fc: 14\n}, {\n lngs: ['lt'],\n nr: [1, 2, 10],\n fc: 15\n}, {\n lngs: ['lv'],\n nr: [1, 2, 0],\n fc: 16\n}, {\n lngs: ['mk'],\n nr: [1, 2],\n fc: 17\n}, {\n lngs: ['mnk'],\n nr: [0, 1, 2],\n fc: 18\n}, {\n lngs: ['mt'],\n nr: [1, 2, 11, 20],\n fc: 19\n}, {\n lngs: ['or'],\n nr: [2, 1],\n fc: 2\n}, {\n lngs: ['ro'],\n nr: [1, 2, 20],\n fc: 20\n}, {\n lngs: ['sl'],\n nr: [5, 1, 2, 3],\n fc: 21\n}, {\n lngs: ['he', 'iw'],\n nr: [1, 2, 20, 21],\n fc: 22\n}];\nlet _rulesPluralsTypes = {\n 1: n => Number(n > 1),\n 2: n => Number(n != 1),\n 3: n => 0,\n 4: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),\n 5: n => Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5),\n 6: n => Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2),\n 7: n => Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),\n 8: n => Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3),\n 9: n => Number(n >= 2),\n 10: n => Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4),\n 11: n => Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3),\n 12: n => Number(n % 10 != 1 || n % 100 == 11),\n 13: n => Number(n !== 0),\n 14: n => Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3),\n 15: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2),\n 16: n => Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2),\n 17: n => Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1),\n 18: n => Number(n == 0 ? 0 : n == 1 ? 1 : 2),\n 19: n => Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3),\n 20: n => Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2),\n 21: n => Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0),\n 22: n => Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3)\n};\nconst nonIntlVersions = ['v1', 'v2', 'v3'];\nconst intlVersions = ['v4'];\nconst suffixesOrder = {\n zero: 0,\n one: 1,\n two: 2,\n few: 3,\n many: 4,\n other: 5\n};\nconst createRules = () => {\n const rules = {};\n sets.forEach(set => {\n set.lngs.forEach(l => {\n rules[l] = {\n numbers: set.nr,\n plurals: _rulesPluralsTypes[set.fc]\n };\n });\n });\n return rules;\n};\nclass PluralResolver {\n constructor(languageUtils) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.languageUtils = languageUtils;\n this.options = options;\n this.logger = baseLogger.create('pluralResolver');\n if ((!this.options.compatibilityJSON || intlVersions.includes(this.options.compatibilityJSON)) && (typeof Intl === 'undefined' || !Intl.PluralRules)) {\n this.options.compatibilityJSON = 'v3';\n this.logger.error('Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.');\n }\n this.rules = createRules();\n this.pluralRulesCache = {};\n }\n addRule(lng, obj) {\n this.rules[lng] = obj;\n }\n clearCache() {\n this.pluralRulesCache = {};\n }\n getRule(code) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (this.shouldUseIntlApi()) {\n const cleanedCode = getCleanedCode(code === 'dev' ? 'en' : code);\n const type = options.ordinal ? 'ordinal' : 'cardinal';\n const cacheKey = JSON.stringify({\n cleanedCode,\n type\n });\n if (cacheKey in this.pluralRulesCache) {\n return this.pluralRulesCache[cacheKey];\n }\n let rule;\n try {\n rule = new Intl.PluralRules(cleanedCode, {\n type\n });\n } catch (err) {\n if (!code.match(/-|_/)) return;\n const lngPart = this.languageUtils.getLanguagePartFromCode(code);\n rule = this.getRule(lngPart, options);\n }\n this.pluralRulesCache[cacheKey] = rule;\n return rule;\n }\n return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];\n }\n needsPlural(code) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const rule = this.getRule(code, options);\n if (this.shouldUseIntlApi()) {\n return rule && rule.resolvedOptions().pluralCategories.length > 1;\n }\n return rule && rule.numbers.length > 1;\n }\n getPluralFormsOfKey(code, key) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return this.getSuffixes(code, options).map(suffix => `${key}${suffix}`);\n }\n getSuffixes(code) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const rule = this.getRule(code, options);\n if (!rule) {\n return [];\n }\n if (this.shouldUseIntlApi()) {\n return rule.resolvedOptions().pluralCategories.sort((pluralCategory1, pluralCategory2) => suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]).map(pluralCategory => `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${pluralCategory}`);\n }\n return rule.numbers.map(number => this.getSuffix(code, number, options));\n }\n getSuffix(code, count) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const rule = this.getRule(code, options);\n if (rule) {\n if (this.shouldUseIntlApi()) {\n return `${this.options.prepend}${options.ordinal ? `ordinal${this.options.prepend}` : ''}${rule.select(count)}`;\n }\n return this.getSuffixRetroCompatible(rule, count);\n }\n this.logger.warn(`no plural rule found for: ${code}`);\n return '';\n }\n getSuffixRetroCompatible(rule, count) {\n const idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));\n let suffix = rule.numbers[idx];\n if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n if (suffix === 2) {\n suffix = 'plural';\n } else if (suffix === 1) {\n suffix = '';\n }\n }\n const returnSuffix = () => this.options.prepend && suffix.toString() ? this.options.prepend + suffix.toString() : suffix.toString();\n if (this.options.compatibilityJSON === 'v1') {\n if (suffix === 1) return '';\n if (typeof suffix === 'number') return `_plural_${suffix.toString()}`;\n return returnSuffix();\n } else if (this.options.compatibilityJSON === 'v2') {\n return returnSuffix();\n } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n return returnSuffix();\n }\n return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();\n }\n shouldUseIntlApi() {\n return !nonIntlVersions.includes(this.options.compatibilityJSON);\n }\n}\n\nconst deepFindWithDefaults = function (data, defaultData, key) {\n let keySeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '.';\n let ignoreJSONStructure = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n let path = getPathWithDefaults(data, defaultData, key);\n if (!path && ignoreJSONStructure && isString(key)) {\n path = deepFind(data, key, keySeparator);\n if (path === undefined) path = deepFind(defaultData, key, keySeparator);\n }\n return path;\n};\nconst regexSafe = val => val.replace(/\\$/g, '$$$$');\nclass Interpolator {\n constructor() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.logger = baseLogger.create('interpolator');\n this.options = options;\n this.format = options.interpolation && options.interpolation.format || (value => value);\n this.init(options);\n }\n init() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!options.interpolation) options.interpolation = {\n escapeValue: true\n };\n const {\n escape: escape$1,\n escapeValue,\n useRawValueToEscape,\n prefix,\n prefixEscaped,\n suffix,\n suffixEscaped,\n formatSeparator,\n unescapeSuffix,\n unescapePrefix,\n nestingPrefix,\n nestingPrefixEscaped,\n nestingSuffix,\n nestingSuffixEscaped,\n nestingOptionsSeparator,\n maxReplaces,\n alwaysFormat\n } = options.interpolation;\n this.escape = escape$1 !== undefined ? escape$1 : escape;\n this.escapeValue = escapeValue !== undefined ? escapeValue : true;\n this.useRawValueToEscape = useRawValueToEscape !== undefined ? useRawValueToEscape : false;\n this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || '{{';\n this.suffix = suffix ? regexEscape(suffix) : suffixEscaped || '}}';\n this.formatSeparator = formatSeparator || ',';\n this.unescapePrefix = unescapeSuffix ? '' : unescapePrefix || '-';\n this.unescapeSuffix = this.unescapePrefix ? '' : unescapeSuffix || '';\n this.nestingPrefix = nestingPrefix ? regexEscape(nestingPrefix) : nestingPrefixEscaped || regexEscape('$t(');\n this.nestingSuffix = nestingSuffix ? regexEscape(nestingSuffix) : nestingSuffixEscaped || regexEscape(')');\n this.nestingOptionsSeparator = nestingOptionsSeparator || ',';\n this.maxReplaces = maxReplaces || 1000;\n this.alwaysFormat = alwaysFormat !== undefined ? alwaysFormat : false;\n this.resetRegExp();\n }\n reset() {\n if (this.options) this.init(this.options);\n }\n resetRegExp() {\n const getOrResetRegExp = (existingRegExp, pattern) => {\n if (existingRegExp && existingRegExp.source === pattern) {\n existingRegExp.lastIndex = 0;\n return existingRegExp;\n }\n return new RegExp(pattern, 'g');\n };\n this.regexp = getOrResetRegExp(this.regexp, `${this.prefix}(.+?)${this.suffix}`);\n this.regexpUnescape = getOrResetRegExp(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`);\n this.nestingRegexp = getOrResetRegExp(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);\n }\n interpolate(str, data, lng, options) {\n let match;\n let value;\n let replaces;\n const defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};\n const handleFormat = key => {\n if (key.indexOf(this.formatSeparator) < 0) {\n const path = deepFindWithDefaults(data, defaultData, key, this.options.keySeparator, this.options.ignoreJSONStructure);\n return this.alwaysFormat ? this.format(path, undefined, lng, {\n ...options,\n ...data,\n interpolationkey: key\n }) : path;\n }\n const p = key.split(this.formatSeparator);\n const k = p.shift().trim();\n const f = p.join(this.formatSeparator).trim();\n return this.format(deepFindWithDefaults(data, defaultData, k, this.options.keySeparator, this.options.ignoreJSONStructure), f, lng, {\n ...options,\n ...data,\n interpolationkey: k\n });\n };\n this.resetRegExp();\n const missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;\n const skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;\n const todos = [{\n regex: this.regexpUnescape,\n safeValue: val => regexSafe(val)\n }, {\n regex: this.regexp,\n safeValue: val => this.escapeValue ? regexSafe(this.escape(val)) : regexSafe(val)\n }];\n todos.forEach(todo => {\n replaces = 0;\n while (match = todo.regex.exec(str)) {\n const matchedVar = match[1].trim();\n value = handleFormat(matchedVar);\n if (value === undefined) {\n if (typeof missingInterpolationHandler === 'function') {\n const temp = missingInterpolationHandler(str, match, options);\n value = isString(temp) ? temp : '';\n } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {\n value = '';\n } else if (skipOnVariables) {\n value = match[0];\n continue;\n } else {\n this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);\n value = '';\n }\n } else if (!isString(value) && !this.useRawValueToEscape) {\n value = makeString(value);\n }\n const safeValue = todo.safeValue(value);\n str = str.replace(match[0], safeValue);\n if (skipOnVariables) {\n todo.regex.lastIndex += value.length;\n todo.regex.lastIndex -= match[0].length;\n } else {\n todo.regex.lastIndex = 0;\n }\n replaces++;\n if (replaces >= this.maxReplaces) {\n break;\n }\n }\n });\n return str;\n }\n nest(str, fc) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n let match;\n let value;\n let clonedOptions;\n const handleHasOptions = (key, inheritedOptions) => {\n const sep = this.nestingOptionsSeparator;\n if (key.indexOf(sep) < 0) return key;\n const c = key.split(new RegExp(`${sep}[ ]*{`));\n let optionsString = `{${c[1]}`;\n key = c[0];\n optionsString = this.interpolate(optionsString, clonedOptions);\n const matchedSingleQuotes = optionsString.match(/'/g);\n const matchedDoubleQuotes = optionsString.match(/\"/g);\n if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) {\n optionsString = optionsString.replace(/'/g, '\"');\n }\n try {\n clonedOptions = JSON.parse(optionsString);\n if (inheritedOptions) clonedOptions = {\n ...inheritedOptions,\n ...clonedOptions\n };\n } catch (e) {\n this.logger.warn(`failed parsing options string in nesting for key ${key}`, e);\n return `${key}${sep}${optionsString}`;\n }\n if (clonedOptions.defaultValue && clonedOptions.defaultValue.indexOf(this.prefix) > -1) delete clonedOptions.defaultValue;\n return key;\n };\n while (match = this.nestingRegexp.exec(str)) {\n let formatters = [];\n clonedOptions = {\n ...options\n };\n clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;\n clonedOptions.applyPostProcessor = false;\n delete clonedOptions.defaultValue;\n let doReduce = false;\n if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {\n const r = match[1].split(this.formatSeparator).map(elem => elem.trim());\n match[1] = r.shift();\n formatters = r;\n doReduce = true;\n }\n value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);\n if (value && match[0] === str && !isString(value)) return value;\n if (!isString(value)) value = makeString(value);\n if (!value) {\n this.logger.warn(`missed to resolve ${match[1]} for nesting ${str}`);\n value = '';\n }\n if (doReduce) {\n value = formatters.reduce((v, f) => this.format(v, f, options.lng, {\n ...options,\n interpolationkey: match[1].trim()\n }), value.trim());\n }\n str = str.replace(match[0], value);\n this.regexp.lastIndex = 0;\n }\n return str;\n }\n}\n\nconst parseFormatStr = formatStr => {\n let formatName = formatStr.toLowerCase().trim();\n const formatOptions = {};\n if (formatStr.indexOf('(') > -1) {\n const p = formatStr.split('(');\n formatName = p[0].toLowerCase().trim();\n const optStr = p[1].substring(0, p[1].length - 1);\n if (formatName === 'currency' && optStr.indexOf(':') < 0) {\n if (!formatOptions.currency) formatOptions.currency = optStr.trim();\n } else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {\n if (!formatOptions.range) formatOptions.range = optStr.trim();\n } else {\n const opts = optStr.split(';');\n opts.forEach(opt => {\n if (opt) {\n const [key, ...rest] = opt.split(':');\n const val = rest.join(':').trim().replace(/^'+|'+$/g, '');\n const trimmedKey = key.trim();\n if (!formatOptions[trimmedKey]) formatOptions[trimmedKey] = val;\n if (val === 'false') formatOptions[trimmedKey] = false;\n if (val === 'true') formatOptions[trimmedKey] = true;\n if (!isNaN(val)) formatOptions[trimmedKey] = parseInt(val, 10);\n }\n });\n }\n }\n return {\n formatName,\n formatOptions\n };\n};\nconst createCachedFormatter = fn => {\n const cache = {};\n return (val, lng, options) => {\n let optForCache = options;\n if (options && options.interpolationkey && options.formatParams && options.formatParams[options.interpolationkey] && options[options.interpolationkey]) {\n optForCache = {\n ...optForCache,\n [options.interpolationkey]: undefined\n };\n }\n const key = lng + JSON.stringify(optForCache);\n let formatter = cache[key];\n if (!formatter) {\n formatter = fn(getCleanedCode(lng), options);\n cache[key] = formatter;\n }\n return formatter(val);\n };\n};\nclass Formatter {\n constructor() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n this.logger = baseLogger.create('formatter');\n this.options = options;\n this.formats = {\n number: createCachedFormatter((lng, opt) => {\n const formatter = new Intl.NumberFormat(lng, {\n ...opt\n });\n return val => formatter.format(val);\n }),\n currency: createCachedFormatter((lng, opt) => {\n const formatter = new Intl.NumberFormat(lng, {\n ...opt,\n style: 'currency'\n });\n return val => formatter.format(val);\n }),\n datetime: createCachedFormatter((lng, opt) => {\n const formatter = new Intl.DateTimeFormat(lng, {\n ...opt\n });\n return val => formatter.format(val);\n }),\n relativetime: createCachedFormatter((lng, opt) => {\n const formatter = new Intl.RelativeTimeFormat(lng, {\n ...opt\n });\n return val => formatter.format(val, opt.range || 'day');\n }),\n list: createCachedFormatter((lng, opt) => {\n const formatter = new Intl.ListFormat(lng, {\n ...opt\n });\n return val => formatter.format(val);\n })\n };\n this.init(options);\n }\n init(services) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n interpolation: {}\n };\n this.formatSeparator = options.interpolation.formatSeparator || ',';\n }\n add(name, fc) {\n this.formats[name.toLowerCase().trim()] = fc;\n }\n addCached(name, fc) {\n this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc);\n }\n format(value, format, lng) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n const formats = format.split(this.formatSeparator);\n if (formats.length > 1 && formats[0].indexOf('(') > 1 && formats[0].indexOf(')') < 0 && formats.find(f => f.indexOf(')') > -1)) {\n const lastIndex = formats.findIndex(f => f.indexOf(')') > -1);\n formats[0] = [formats[0], ...formats.splice(1, lastIndex)].join(this.formatSeparator);\n }\n const result = formats.reduce((mem, f) => {\n const {\n formatName,\n formatOptions\n } = parseFormatStr(f);\n if (this.formats[formatName]) {\n let formatted = mem;\n try {\n const valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};\n const l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;\n formatted = this.formats[formatName](mem, l, {\n ...formatOptions,\n ...options,\n ...valOptions\n });\n } catch (error) {\n this.logger.warn(error);\n }\n return formatted;\n } else {\n this.logger.warn(`there was no format function for ${formatName}`);\n }\n return mem;\n }, value);\n return result;\n }\n}\n\nconst removePending = (q, name) => {\n if (q.pending[name] !== undefined) {\n delete q.pending[name];\n q.pendingCount--;\n }\n};\nclass Connector extends EventEmitter {\n constructor(backend, store, services) {\n let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n super();\n this.backend = backend;\n this.store = store;\n this.services = services;\n this.languageUtils = services.languageUtils;\n this.options = options;\n this.logger = baseLogger.create('backendConnector');\n this.waitingReads = [];\n this.maxParallelReads = options.maxParallelReads || 10;\n this.readingCalls = 0;\n this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5;\n this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350;\n this.state = {};\n this.queue = [];\n if (this.backend && this.backend.init) {\n this.backend.init(services, options.backend, options);\n }\n }\n queueLoad(languages, namespaces, options, callback) {\n const toLoad = {};\n const pending = {};\n const toLoadLanguages = {};\n const toLoadNamespaces = {};\n languages.forEach(lng => {\n let hasAllNamespaces = true;\n namespaces.forEach(ns => {\n const name = `${lng}|${ns}`;\n if (!options.reload && this.store.hasResourceBundle(lng, ns)) {\n this.state[name] = 2;\n } else if (this.state[name] < 0) ; else if (this.state[name] === 1) {\n if (pending[name] === undefined) pending[name] = true;\n } else {\n this.state[name] = 1;\n hasAllNamespaces = false;\n if (pending[name] === undefined) pending[name] = true;\n if (toLoad[name] === undefined) toLoad[name] = true;\n if (toLoadNamespaces[ns] === undefined) toLoadNamespaces[ns] = true;\n }\n });\n if (!hasAllNamespaces) toLoadLanguages[lng] = true;\n });\n if (Object.keys(toLoad).length || Object.keys(pending).length) {\n this.queue.push({\n pending,\n pendingCount: Object.keys(pending).length,\n loaded: {},\n errors: [],\n callback\n });\n }\n return {\n toLoad: Object.keys(toLoad),\n pending: Object.keys(pending),\n toLoadLanguages: Object.keys(toLoadLanguages),\n toLoadNamespaces: Object.keys(toLoadNamespaces)\n };\n }\n loaded(name, err, data) {\n const s = name.split('|');\n const lng = s[0];\n const ns = s[1];\n if (err) this.emit('failedLoading', lng, ns, err);\n if (!err && data) {\n this.store.addResourceBundle(lng, ns, data, undefined, undefined, {\n skipCopy: true\n });\n }\n this.state[name] = err ? -1 : 2;\n if (err && data) this.state[name] = 0;\n const loaded = {};\n this.queue.forEach(q => {\n pushPath(q.loaded, [lng], ns);\n removePending(q, name);\n if (err) q.errors.push(err);\n if (q.pendingCount === 0 && !q.done) {\n Object.keys(q.loaded).forEach(l => {\n if (!loaded[l]) loaded[l] = {};\n const loadedKeys = q.loaded[l];\n if (loadedKeys.length) {\n loadedKeys.forEach(n => {\n if (loaded[l][n] === undefined) loaded[l][n] = true;\n });\n }\n });\n q.done = true;\n if (q.errors.length) {\n q.callback(q.errors);\n } else {\n q.callback();\n }\n }\n });\n this.emit('loaded', loaded);\n this.queue = this.queue.filter(q => !q.done);\n }\n read(lng, ns, fcName) {\n let tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n let wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.retryTimeout;\n let callback = arguments.length > 5 ? arguments[5] : undefined;\n if (!lng.length) return callback(null, {});\n if (this.readingCalls >= this.maxParallelReads) {\n this.waitingReads.push({\n lng,\n ns,\n fcName,\n tried,\n wait,\n callback\n });\n return;\n }\n this.readingCalls++;\n const resolver = (err, data) => {\n this.readingCalls--;\n if (this.waitingReads.length > 0) {\n const next = this.waitingReads.shift();\n this.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback);\n }\n if (err && data && tried < this.maxRetries) {\n setTimeout(() => {\n this.read.call(this, lng, ns, fcName, tried + 1, wait * 2, callback);\n }, wait);\n return;\n }\n callback(err, data);\n };\n const fc = this.backend[fcName].bind(this.backend);\n if (fc.length === 2) {\n try {\n const r = fc(lng, ns);\n if (r && typeof r.then === 'function') {\n r.then(data => resolver(null, data)).catch(resolver);\n } else {\n resolver(null, r);\n }\n } catch (err) {\n resolver(err);\n }\n return;\n }\n return fc(lng, ns, resolver);\n }\n prepareLoading(languages, namespaces) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n let callback = arguments.length > 3 ? arguments[3] : undefined;\n if (!this.backend) {\n this.logger.warn('No backend was added via i18next.use. Will not load resources.');\n return callback && callback();\n }\n if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);\n if (isString(namespaces)) namespaces = [namespaces];\n const toLoad = this.queueLoad(languages, namespaces, options, callback);\n if (!toLoad.toLoad.length) {\n if (!toLoad.pending.length) callback();\n return null;\n }\n toLoad.toLoad.forEach(name => {\n this.loadOne(name);\n });\n }\n load(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {}, callback);\n }\n reload(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {\n reload: true\n }, callback);\n }\n loadOne(name) {\n let prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n const s = name.split('|');\n const lng = s[0];\n const ns = s[1];\n this.read(lng, ns, 'read', undefined, undefined, (err, data) => {\n if (err) this.logger.warn(`${prefix}loading namespace ${ns} for language ${lng} failed`, err);\n if (!err && data) this.logger.log(`${prefix}loaded namespace ${ns} for language ${lng}`, data);\n this.loaded(name, err, data);\n });\n }\n saveMissing(languages, namespace, key, fallbackValue, isUpdate) {\n let options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n let clb = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : () => {};\n if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {\n this.logger.warn(`did not save key \"${key}\" as the namespace \"${namespace}\" was not yet loaded`, 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n return;\n }\n if (key === undefined || key === null || key === '') return;\n if (this.backend && this.backend.create) {\n const opts = {\n ...options,\n isUpdate\n };\n const fc = this.backend.create.bind(this.backend);\n if (fc.length < 6) {\n try {\n let r;\n if (fc.length === 5) {\n r = fc(languages, namespace, key, fallbackValue, opts);\n } else {\n r = fc(languages, namespace, key, fallbackValue);\n }\n if (r && typeof r.then === 'function') {\n r.then(data => clb(null, data)).catch(clb);\n } else {\n clb(null, r);\n }\n } catch (err) {\n clb(err);\n }\n } else {\n fc(languages, namespace, key, fallbackValue, clb, opts);\n }\n }\n if (!languages || !languages[0]) return;\n this.store.addResource(languages[0], namespace, key, fallbackValue);\n }\n}\n\nconst get = () => ({\n debug: false,\n initImmediate: true,\n ns: ['translation'],\n defaultNS: ['translation'],\n fallbackLng: ['dev'],\n fallbackNS: false,\n supportedLngs: false,\n nonExplicitSupportedLngs: false,\n load: 'all',\n preload: false,\n simplifyPluralSuffix: true,\n keySeparator: '.',\n nsSeparator: ':',\n pluralSeparator: '_',\n contextSeparator: '_',\n partialBundledLanguages: false,\n saveMissing: false,\n updateMissing: false,\n saveMissingTo: 'fallback',\n saveMissingPlurals: true,\n missingKeyHandler: false,\n missingInterpolationHandler: false,\n postProcess: false,\n postProcessPassResolved: false,\n returnNull: false,\n returnEmptyString: true,\n returnObjects: false,\n joinArrays: false,\n returnedObjectHandler: false,\n parseMissingKeyHandler: false,\n appendNamespaceToMissingKey: false,\n appendNamespaceToCIMode: false,\n overloadTranslationOptionHandler: args => {\n let ret = {};\n if (typeof args[1] === 'object') ret = args[1];\n if (isString(args[1])) ret.defaultValue = args[1];\n if (isString(args[2])) ret.tDescription = args[2];\n if (typeof args[2] === 'object' || typeof args[3] === 'object') {\n const options = args[3] || args[2];\n Object.keys(options).forEach(key => {\n ret[key] = options[key];\n });\n }\n return ret;\n },\n interpolation: {\n escapeValue: true,\n format: value => value,\n prefix: '{{',\n suffix: '}}',\n formatSeparator: ',',\n unescapePrefix: '-',\n nestingPrefix: '$t(',\n nestingSuffix: ')',\n nestingOptionsSeparator: ',',\n maxReplaces: 1000,\n skipOnVariables: true\n }\n});\nconst transformOptions = options => {\n if (isString(options.ns)) options.ns = [options.ns];\n if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];\n if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];\n if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {\n options.supportedLngs = options.supportedLngs.concat(['cimode']);\n }\n return options;\n};\n\nconst noop = () => {};\nconst bindMemberFunctions = inst => {\n const mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));\n mems.forEach(mem => {\n if (typeof inst[mem] === 'function') {\n inst[mem] = inst[mem].bind(inst);\n }\n });\n};\nclass I18n extends EventEmitter {\n constructor() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let callback = arguments.length > 1 ? arguments[1] : undefined;\n super();\n this.options = transformOptions(options);\n this.services = {};\n this.logger = baseLogger;\n this.modules = {\n external: []\n };\n bindMemberFunctions(this);\n if (callback && !this.isInitialized && !options.isClone) {\n if (!this.options.initImmediate) {\n this.init(options, callback);\n return this;\n }\n setTimeout(() => {\n this.init(options, callback);\n }, 0);\n }\n }\n init() {\n var _this = this;\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let callback = arguments.length > 1 ? arguments[1] : undefined;\n this.isInitializing = true;\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n if (!options.defaultNS && options.defaultNS !== false && options.ns) {\n if (isString(options.ns)) {\n options.defaultNS = options.ns;\n } else if (options.ns.indexOf('translation') < 0) {\n options.defaultNS = options.ns[0];\n }\n }\n const defOpts = get();\n this.options = {\n ...defOpts,\n ...this.options,\n ...transformOptions(options)\n };\n if (this.options.compatibilityAPI !== 'v1') {\n this.options.interpolation = {\n ...defOpts.interpolation,\n ...this.options.interpolation\n };\n }\n if (options.keySeparator !== undefined) {\n this.options.userDefinedKeySeparator = options.keySeparator;\n }\n if (options.nsSeparator !== undefined) {\n this.options.userDefinedNsSeparator = options.nsSeparator;\n }\n const createClassOnDemand = ClassOrObject => {\n if (!ClassOrObject) return null;\n if (typeof ClassOrObject === 'function') return new ClassOrObject();\n return ClassOrObject;\n };\n if (!this.options.isClone) {\n if (this.modules.logger) {\n baseLogger.init(createClassOnDemand(this.modules.logger), this.options);\n } else {\n baseLogger.init(null, this.options);\n }\n let formatter;\n if (this.modules.formatter) {\n formatter = this.modules.formatter;\n } else if (typeof Intl !== 'undefined') {\n formatter = Formatter;\n }\n const lu = new LanguageUtil(this.options);\n this.store = new ResourceStore(this.options.resources, this.options);\n const s = this.services;\n s.logger = baseLogger;\n s.resourceStore = this.store;\n s.languageUtils = lu;\n s.pluralResolver = new PluralResolver(lu, {\n prepend: this.options.pluralSeparator,\n compatibilityJSON: this.options.compatibilityJSON,\n simplifyPluralSuffix: this.options.simplifyPluralSuffix\n });\n if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {\n s.formatter = createClassOnDemand(formatter);\n s.formatter.init(s, this.options);\n this.options.interpolation.format = s.formatter.format.bind(s.formatter);\n }\n s.interpolator = new Interpolator(this.options);\n s.utils = {\n hasLoadedNamespace: this.hasLoadedNamespace.bind(this)\n };\n s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);\n s.backendConnector.on('*', function (event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n _this.emit(event, ...args);\n });\n if (this.modules.languageDetector) {\n s.languageDetector = createClassOnDemand(this.modules.languageDetector);\n if (s.languageDetector.init) s.languageDetector.init(s, this.options.detection, this.options);\n }\n if (this.modules.i18nFormat) {\n s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);\n if (s.i18nFormat.init) s.i18nFormat.init(this);\n }\n this.translator = new Translator(this.services, this.options);\n this.translator.on('*', function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n _this.emit(event, ...args);\n });\n this.modules.external.forEach(m => {\n if (m.init) m.init(this);\n });\n }\n this.format = this.options.interpolation.format;\n if (!callback) callback = noop;\n if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {\n const codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];\n }\n if (!this.services.languageDetector && !this.options.lng) {\n this.logger.warn('init: no languageDetector is used and no lng is defined');\n }\n const storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];\n storeApi.forEach(fcName => {\n this[fcName] = function () {\n return _this.store[fcName](...arguments);\n };\n });\n const storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];\n storeApiChained.forEach(fcName => {\n this[fcName] = function () {\n _this.store[fcName](...arguments);\n return _this;\n };\n });\n const deferred = defer();\n const load = () => {\n const finish = (err, t) => {\n this.isInitializing = false;\n if (this.isInitialized && !this.initializedStoreOnce) this.logger.warn('init: i18next is already initialized. You should call init just once!');\n this.isInitialized = true;\n if (!this.options.isClone) this.logger.log('initialized', this.options);\n this.emit('initialized', this.options);\n deferred.resolve(t);\n callback(err, t);\n };\n if (this.languages && this.options.compatibilityAPI !== 'v1' && !this.isInitialized) return finish(null, this.t.bind(this));\n this.changeLanguage(this.options.lng, finish);\n };\n if (this.options.resources || !this.options.initImmediate) {\n load();\n } else {\n setTimeout(load, 0);\n }\n return deferred;\n }\n loadResources(language) {\n let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n let usedCallback = callback;\n const usedLng = isString(language) ? language : this.language;\n if (typeof language === 'function') usedCallback = language;\n if (!this.options.resources || this.options.partialBundledLanguages) {\n if (usedLng && usedLng.toLowerCase() === 'cimode' && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();\n const toLoad = [];\n const append = lng => {\n if (!lng) return;\n if (lng === 'cimode') return;\n const lngs = this.services.languageUtils.toResolveHierarchy(lng);\n lngs.forEach(l => {\n if (l === 'cimode') return;\n if (toLoad.indexOf(l) < 0) toLoad.push(l);\n });\n };\n if (!usedLng) {\n const fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n fallbacks.forEach(l => append(l));\n } else {\n append(usedLng);\n }\n if (this.options.preload) {\n this.options.preload.forEach(l => append(l));\n }\n this.services.backendConnector.load(toLoad, this.options.ns, e => {\n if (!e && !this.resolvedLanguage && this.language) this.setResolvedLanguage(this.language);\n usedCallback(e);\n });\n } else {\n usedCallback(null);\n }\n }\n reloadResources(lngs, ns, callback) {\n const deferred = defer();\n if (typeof lngs === 'function') {\n callback = lngs;\n lngs = undefined;\n }\n if (typeof ns === 'function') {\n callback = ns;\n ns = undefined;\n }\n if (!lngs) lngs = this.languages;\n if (!ns) ns = this.options.ns;\n if (!callback) callback = noop;\n this.services.backendConnector.reload(lngs, ns, err => {\n deferred.resolve();\n callback(err);\n });\n return deferred;\n }\n use(module) {\n if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');\n if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');\n if (module.type === 'backend') {\n this.modules.backend = module;\n }\n if (module.type === 'logger' || module.log && module.warn && module.error) {\n this.modules.logger = module;\n }\n if (module.type === 'languageDetector') {\n this.modules.languageDetector = module;\n }\n if (module.type === 'i18nFormat') {\n this.modules.i18nFormat = module;\n }\n if (module.type === 'postProcessor') {\n postProcessor.addPostProcessor(module);\n }\n if (module.type === 'formatter') {\n this.modules.formatter = module;\n }\n if (module.type === '3rdParty') {\n this.modules.external.push(module);\n }\n return this;\n }\n setResolvedLanguage(l) {\n if (!l || !this.languages) return;\n if (['cimode', 'dev'].indexOf(l) > -1) return;\n for (let li = 0; li < this.languages.length; li++) {\n const lngInLngs = this.languages[li];\n if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;\n if (this.store.hasLanguageSomeTranslations(lngInLngs)) {\n this.resolvedLanguage = lngInLngs;\n break;\n }\n }\n }\n changeLanguage(lng, callback) {\n var _this2 = this;\n this.isLanguageChangingTo = lng;\n const deferred = defer();\n this.emit('languageChanging', lng);\n const setLngProps = l => {\n this.language = l;\n this.languages = this.services.languageUtils.toResolveHierarchy(l);\n this.resolvedLanguage = undefined;\n this.setResolvedLanguage(l);\n };\n const done = (err, l) => {\n if (l) {\n setLngProps(l);\n this.translator.changeLanguage(l);\n this.isLanguageChangingTo = undefined;\n this.emit('languageChanged', l);\n this.logger.log('languageChanged', l);\n } else {\n this.isLanguageChangingTo = undefined;\n }\n deferred.resolve(function () {\n return _this2.t(...arguments);\n });\n if (callback) callback(err, function () {\n return _this2.t(...arguments);\n });\n };\n const setLng = lngs => {\n if (!lng && !lngs && this.services.languageDetector) lngs = [];\n const l = isString(lngs) ? lngs : this.services.languageUtils.getBestMatchFromCodes(lngs);\n if (l) {\n if (!this.language) {\n setLngProps(l);\n }\n if (!this.translator.language) this.translator.changeLanguage(l);\n if (this.services.languageDetector && this.services.languageDetector.cacheUserLanguage) this.services.languageDetector.cacheUserLanguage(l);\n }\n this.loadResources(l, err => {\n done(err, l);\n });\n };\n if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {\n setLng(this.services.languageDetector.detect());\n } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {\n if (this.services.languageDetector.detect.length === 0) {\n this.services.languageDetector.detect().then(setLng);\n } else {\n this.services.languageDetector.detect(setLng);\n }\n } else {\n setLng(lng);\n }\n return deferred;\n }\n getFixedT(lng, ns, keyPrefix) {\n var _this3 = this;\n const fixedT = function (key, opts) {\n let options;\n if (typeof opts !== 'object') {\n for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n rest[_key3 - 2] = arguments[_key3];\n }\n options = _this3.options.overloadTranslationOptionHandler([key, opts].concat(rest));\n } else {\n options = {\n ...opts\n };\n }\n options.lng = options.lng || fixedT.lng;\n options.lngs = options.lngs || fixedT.lngs;\n options.ns = options.ns || fixedT.ns;\n if (options.keyPrefix !== '') options.keyPrefix = options.keyPrefix || keyPrefix || fixedT.keyPrefix;\n const keySeparator = _this3.options.keySeparator || '.';\n let resultKey;\n if (options.keyPrefix && Array.isArray(key)) {\n resultKey = key.map(k => `${options.keyPrefix}${keySeparator}${k}`);\n } else {\n resultKey = options.keyPrefix ? `${options.keyPrefix}${keySeparator}${key}` : key;\n }\n return _this3.t(resultKey, options);\n };\n if (isString(lng)) {\n fixedT.lng = lng;\n } else {\n fixedT.lngs = lng;\n }\n fixedT.ns = ns;\n fixedT.keyPrefix = keyPrefix;\n return fixedT;\n }\n t() {\n return this.translator && this.translator.translate(...arguments);\n }\n exists() {\n return this.translator && this.translator.exists(...arguments);\n }\n setDefaultNamespace(ns) {\n this.options.defaultNS = ns;\n }\n hasLoadedNamespace(ns) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n if (!this.isInitialized) {\n this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);\n return false;\n }\n if (!this.languages || !this.languages.length) {\n this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);\n return false;\n }\n const lng = options.lng || this.resolvedLanguage || this.languages[0];\n const fallbackLng = this.options ? this.options.fallbackLng : false;\n const lastLng = this.languages[this.languages.length - 1];\n if (lng.toLowerCase() === 'cimode') return true;\n const loadNotPending = (l, n) => {\n const loadState = this.services.backendConnector.state[`${l}|${n}`];\n return loadState === -1 || loadState === 0 || loadState === 2;\n };\n if (options.precheck) {\n const preResult = options.precheck(this, loadNotPending);\n if (preResult !== undefined) return preResult;\n }\n if (this.hasResourceBundle(lng, ns)) return true;\n if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true;\n if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;\n return false;\n }\n loadNamespaces(ns, callback) {\n const deferred = defer();\n if (!this.options.ns) {\n if (callback) callback();\n return Promise.resolve();\n }\n if (isString(ns)) ns = [ns];\n ns.forEach(n => {\n if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);\n });\n this.loadResources(err => {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n loadLanguages(lngs, callback) {\n const deferred = defer();\n if (isString(lngs)) lngs = [lngs];\n const preloaded = this.options.preload || [];\n const newLngs = lngs.filter(lng => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));\n if (!newLngs.length) {\n if (callback) callback();\n return Promise.resolve();\n }\n this.options.preload = preloaded.concat(newLngs);\n this.loadResources(err => {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n dir(lng) {\n if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);\n if (!lng) return 'rtl';\n const rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];\n const languageUtils = this.services && this.services.languageUtils || new LanguageUtil(get());\n return rtlLngs.indexOf(languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';\n }\n static createInstance() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let callback = arguments.length > 1 ? arguments[1] : undefined;\n return new I18n(options, callback);\n }\n cloneInstance() {\n let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n const forkResourceStore = options.forkResourceStore;\n if (forkResourceStore) delete options.forkResourceStore;\n const mergedOptions = {\n ...this.options,\n ...options,\n ...{\n isClone: true\n }\n };\n const clone = new I18n(mergedOptions);\n if (options.debug !== undefined || options.prefix !== undefined) {\n clone.logger = clone.logger.clone(options);\n }\n const membersToCopy = ['store', 'services', 'language'];\n membersToCopy.forEach(m => {\n clone[m] = this[m];\n });\n clone.services = {\n ...this.services\n };\n clone.services.utils = {\n hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)\n };\n if (forkResourceStore) {\n clone.store = new ResourceStore(this.store.data, mergedOptions);\n clone.services.resourceStore = clone.store;\n }\n clone.translator = new Translator(clone.services, mergedOptions);\n clone.translator.on('*', function (event) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n clone.emit(event, ...args);\n });\n clone.init(mergedOptions, callback);\n clone.translator.options = mergedOptions;\n clone.translator.backendConnector.services.utils = {\n hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)\n };\n return clone;\n }\n toJSON() {\n return {\n options: this.options,\n store: this.store,\n language: this.language,\n languages: this.languages,\n resolvedLanguage: this.resolvedLanguage\n };\n }\n}\nconst instance = I18n.createInstance();\ninstance.createInstance = I18n.createInstance;\n\nconst createInstance = instance.createInstance;\nconst dir = instance.dir;\nconst init = instance.init;\nconst loadResources = instance.loadResources;\nconst reloadResources = instance.reloadResources;\nconst use = instance.use;\nconst changeLanguage = instance.changeLanguage;\nconst getFixedT = instance.getFixedT;\nconst t = instance.t;\nconst exists = instance.exists;\nconst setDefaultNamespace = instance.setDefaultNamespace;\nconst hasLoadedNamespace = instance.hasLoadedNamespace;\nconst loadNamespaces = instance.loadNamespaces;\nconst loadLanguages = instance.loadLanguages;\n\nexport { changeLanguage, createInstance, instance as default, dir, exists, getFixedT, hasLoadedNamespace, init, loadLanguages, loadNamespaces, loadResources, reloadResources, setDefaultNamespace, t, use };\n", "{\n \"form\": {\n \"required\": \"This field is required\",\n \"msgRadioCheck\": \"Please select an option\",\n \"msgDropdown\": \"Please make a selection\",\n \"msgPhoneRequired\": \"Please fill in a valid phone number\",\n \"msgPasswordInvalid\": \"Password must match the criteria below. Please try again.\",\n \"msgPasswordUppercase\": \"Password must contain at least one uppercase.\",\n \"msgPasswordLowercase\": \"Password must contain at least one lowercase.\",\n \"msgPasswordDigit\": \"Password must contain at least one digit.\",\n \"msgPasswordSpecChar\": \"Password must contain special characters from @#$%&.\",\n \"msgEmail\": \"This is not a correct email format\",\n \"msgEmailGuestConfirm\": \"Password not matching\"\n },\n \"dropdown\": {\n \"noresult\": \"No results found\"\n }\n}\n", "import i18next from 'i18next';\nimport enNs1 from '../i18n/en.json';\nexport const defaultNS = 'limestone';\ni18next.init({\n debug: false,\n fallbackLng: 'en',\n defaultNS,\n resources: {\n en: {\n limestone: enNs1,\n }\n },\n});\nexport default i18next;\n", "export class JQElementHelper {\n iterateSelector($parent, func) {\n for (let elem of $parent) {\n func($(elem));\n }\n }\n}\n", "import { Direction } from \"../AxDropdown\";\nimport i18next from '../../i18n';\nexport class AxDropdownInteraction {\n constructor(options) {\n this.options = options;\n }\n getTippyInstance($parent) {\n //@ts-ignore\n const instance = $parent[0]._tippy;\n return instance;\n }\n open($target) {\n let instance = this.getTippyInstance($target);\n instance.show();\n }\n close($target) {\n let instance = this.getTippyInstance($target);\n instance.hide();\n }\n afterOpen($parent, $popperElem) {\n $popperElem\n .children(\".ax-dropdown__search\")\n .children(\".ax-dropdown__search-input\")\n .focus();\n this.openSubject.next(true);\n if (this.options.onOpen != null) {\n this.options.onOpen($parent);\n }\n }\n afterOnShown($parent, $popperElem) {\n // $popperElem\n // .children(\".ax-dropdown__search\")\n // .children(\".ax-dropdown__search-input\")\n // .focus();\n this.onShownSubject.next(true);\n if (this.options.onOpened != null) {\n this.options.onOpened($parent);\n }\n }\n search($target, $parent, $popperElem) {\n let isHero = $parent.hasClass('ax-dropdown--hero');\n let value = $target.val();\n if (isHero) {\n $parent.find('.ax-dropdown__selection').toggleClass('d-none', value != '');\n }\n let results = 0;\n $(\".ax-dropdown__menu .ax-dropdown__item:not(.ax-dropdown__search):not(.noresults)\", $popperElem).each(function (index) {\n $(this).hide();\n if ($(this).is(':contains(\"' + value + '\")')) {\n $(this).show();\n results = 1;\n }\n });\n if (results == 0) {\n if (!$(\".noresults\", $popperElem).length) {\n $(\".ax-dropdown__menu\", $popperElem).append(`<li class=\"noresults ax-dropdown__item\">${i18next.t('dropdown.noresult')}</li>`);\n }\n }\n else {\n $(\".noresults\", $popperElem).remove();\n }\n }\n select($target, $parent) {\n const hasMultiSelect = this.hasMultiSelectClass($parent);\n const tippyInstance = this.getTippyInstance($parent);\n const popperInstance = tippyInstance.popperInstance;\n const currentValue = this.getValue($parent);\n if ($target.is(\"[disabled]\")) {\n return;\n }\n if (hasMultiSelect) {\n this.selectMulti($target, $parent);\n popperInstance === null || popperInstance === void 0 ? void 0 : popperInstance.update();\n }\n else {\n this.selectSingle($target, $parent);\n tippyInstance === null || tippyInstance === void 0 ? void 0 : tippyInstance.hide();\n }\n let value = this.getValue($parent);\n this.changeSubject.next(value);\n if (this.options.onSelect != null) {\n this.options.onSelect($parent, value);\n }\n if (this.options.onChange != null) {\n if (currentValue != null && !hasMultiSelect) {\n this.options.onChange($parent, currentValue, Direction.removed, value);\n }\n this.options.onChange($parent, $target.attr('data-value'), Direction.added, value);\n }\n }\n getValue($parent) {\n var _a, _b;\n const tippyInstance = this.getTippyInstance($parent);\n const $popperElement = $(tippyInstance.popper);\n if (!this.hasMultiSelectClass($parent)) {\n return (_b = (_a = $popperElement.find('.ax-dropdown__menu .ax-dropdown__item.selected')) === null || _a === void 0 ? void 0 : _a.attr('data-value')) !== null && _b !== void 0 ? _b : null;\n }\n let retVal = [];\n for (let elem of $popperElement.find('.ax-dropdown__menu .ax-dropdown__item.selected')) {\n retVal.push($(elem).attr('data-value'));\n }\n return retVal;\n }\n setValue(value, $parent) {\n const currentValue = this.getValue($parent);\n const isMultiSelect = this.hasMultiSelectClass($parent);\n const $selection = this.getOptionByValue(value, $parent);\n if ($selection.length === 0) {\n $parent.find(\".ax-dropdown__trigger\").addClass(\"has-selection\");\n $parent.find(\".ax-dropdown__trigger .ax-dropdown__selection\").text(value);\n $parent.find(\".hidden-input\").val(value).addClass(\"value\");\n return;\n }\n if ($selection.is(\"[disabled]\")) {\n return;\n }\n if (isMultiSelect) {\n this.selectMulti($selection, $parent);\n }\n else {\n this.selectSingle($selection, $parent);\n }\n if (this.options.onSelect != null) {\n this.options.onSelect($parent, value);\n }\n if (this.options.onChange != null) {\n if (currentValue != null && !isMultiSelect) {\n this.options.onChange($parent, currentValue, Direction.removed, value);\n }\n this.options.onChange($parent, value, Direction.added, this.getValue($parent));\n }\n }\n resetSelection($parent) {\n const value = this.getValue($parent);\n const tippyInstance = this.getTippyInstance($parent);\n const $popperElement = $(tippyInstance.popper);\n $parent.find(\".ax-dropdown__trigger\").removeClass(\"active\");\n $parent.find(\".ax-dropdown__trigger\").removeClass(\"has-selection\");\n $parent.find(\".ax-dropdown__trigger .ax-dropdown__selection\").text('');\n $popperElement.find('.ax-dropdown__menu .ax-dropdown__item').removeClass('selected');\n $parent.find(\".hidden-input\").val('').removeClass(\"value\");\n if (this.options.onChange != null) {\n if (this.hasMultiSelectClass($parent)) {\n for (let val of value) {\n this.options.onChange($parent, val, Direction.removed, []);\n }\n }\n else {\n this.options.onChange($parent, value, Direction.added, null);\n }\n }\n }\n hasMultiSelectClass($parent) {\n return $parent.hasClass('ax-dropdown--multiselect');\n }\n toggleDisabled(option, disabled, $parent) {\n let $option;\n if (typeof option === 'string') {\n $option = this.getOptionByValue(option, $parent);\n }\n else {\n $option = option;\n }\n let newValue = disabled;\n if (typeof disabled == 'undefined' || disabled == null) {\n var existingAttr = $option.attr('disabled');\n newValue = (typeof existingAttr == undefined || existingAttr == null);\n }\n if (newValue) {\n $option.attr('disabled', 'disabled');\n }\n else {\n $option.removeAttr('disabled');\n }\n $option.prop('disabled', disabled);\n return newValue;\n }\n getOptionByValue(value, $parent) {\n const tippyInstance = this.getTippyInstance($parent);\n const $popperElement = $(tippyInstance.popper);\n return $popperElement.find(`.ax-dropdown__menu .ax-dropdown__item[data-value=\"${value}\"]`);\n }\n selectSingle($target, $parent) {\n var _a;\n const $singleTarget = $($target[0]);\n const lineText = $singleTarget.text();\n $singleTarget.addClass(\"selected\").siblings().removeClass(\"selected\");\n $singleTarget.parent(\".ax-dropdown__menu\").hide();\n $parent.find(\".ax-dropdown__trigger\").addClass(\"has-selection\");\n $parent.find(\".ax-dropdown__trigger .ax-dropdown__selection\").text(lineText);\n $parent.find(\".hidden-input\").val((_a = $singleTarget.attr('data-value')) !== null && _a !== void 0 ? _a : lineText).addClass(\"value\");\n $parent.find(\".ax-dropdown__trigger\").removeClass(\"active\");\n const $hero = $singleTarget.parents(\".ax-dropdown--hero\").find(\".ax-dropdown__trigger\");\n if ($hero.hasClass(\"has-selection\")) {\n if ($hero.find($(\".ax-dropdown--reset\")).length === 0) {\n $hero.append('<i class=\"la la-times-circle ax-dropdown--reset\"></i>');\n }\n }\n if ($parent.find(\".ax-dropdown__trigger\").hasClass(\"has-selection\")) {\n $parent.find(\".ax-dropdown__trigger\").removeClass(\"has-error\");\n $parent.parent(\".ax-form-group\").find(\"label.field-error\").hide();\n }\n if ($parent.find(\".ax-form-group input\").hasClass(\"value\")) {\n $parent\n .find(\".ax-form-group input\")\n .removeClass(\"field-error\");\n }\n $singleTarget\n .siblings(\".ax-dropdown__search\")\n .children(\".ax-dropdown__search-input\")\n .val(\"\");\n }\n selectMulti($target, $parent) {\n const lineText = $target.text();\n const $newLabel = $('<div class=\"ax-dropdown__multi-label\">' +\n lineText +\n '<a href=\"#\" class=\"ax-dropdown__muli-remove\"></a></div>');\n $target.each((i, elem) => {\n const $elem = $(elem);\n const items = $elem.data(\"value\");\n const $existingLabel = $parent.find(`.ax-dropdown__multi-label[data-value=\"${items}\"]`);\n if ($existingLabel.length === 0) {\n $parent\n .find(\".ax-dropdown__trigger .ax-dropdown__selection\")\n .append($newLabel.attr(\"data-value\", items));\n }\n else {\n $existingLabel.remove();\n }\n });\n $target.toggleClass('selected');\n $target\n .siblings(\".ax-dropdown__search\")\n .children(\".ax-dropdown__search-input\")\n .val(\"\");\n $parent.find(\".ax-dropdown__trigger\").toggleClass(\"has-selection\", $parent.find(\".ax-dropdown__selection\").children(\".ax-dropdown__multi-label\").length > 0);\n //$parent[0]._tippy.popperInstance.update();\n }\n deleteMultiSelection($parent, targetId, $popperElem) {\n const $label = $popperElem.find(\".ax-dropdown__menu .ax-dropdown__item\");\n const $target = $popperElem.find(`.ax-dropdown__menu .ax-dropdown__item[data-value=\"${targetId}\"]`);\n const targetSelected = $target.hasClass(\"selected\");\n $target.removeClass(\"selected\");\n $parent.find(`.ax-dropdown__multi-label[data-value=\"${targetId}\"]`).remove();\n $label.each(() => {\n if (!$popperElem.find(\".ax-dropdown__menu .ax-dropdown__item\")\n .hasClass(\"selected\")) {\n $parent.find(\".ax-dropdown__trigger\")\n .removeClass(\"has-selection\");\n }\n });\n if (targetSelected && this.options.onChange != null) {\n this.options.onChange($parent, targetId, Direction.removed, this.getValue($parent));\n }\n }\n}\n", "/**\n * Returns true if the object is a function.\n * @param value The value to check\n */\nexport function isFunction(value: any): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "/**\n * Used to create Error subclasses until the community moves away from ES5.\n *\n * This is because compiling from TypeScript down to ES5 has issues with subclassing Errors\n * as well as other built-in types: https://github.com/Microsoft/TypeScript/issues/12123\n *\n * @param createImpl A factory function to create the actual constructor implementation. The returned\n * function should be a named function that calls `_super` internally.\n */\nexport function createErrorClass<T>(createImpl: (_super: any) => any): T {\n const _super = (instance: any) => {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n\n const ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface UnsubscriptionError extends Error {\n readonly errors: any[];\n}\n\nexport interface UnsubscriptionErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (errors: any[]): UnsubscriptionError;\n}\n\n/**\n * An error thrown when one or more errors have occurred during the\n * `unsubscribe` of a {@link Subscription}.\n */\nexport const UnsubscriptionError: UnsubscriptionErrorCtor = createErrorClass(\n (_super) =>\n function UnsubscriptionErrorImpl(this: any, errors: (Error | string)[]) {\n _super(this);\n this.message = errors\n ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}`\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n }\n);\n", "/**\n * Removes an item from an array, mutating it.\n * @param arr The array to remove the item from\n * @param item The item to remove\n */\nexport function arrRemove<T>(arr: T[] | undefined | null, item: T) {\n if (arr) {\n const index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { SubscriptionLike, TeardownLogic, Unsubscribable } from './types';\nimport { arrRemove } from './util/arrRemove';\n\n/**\n * Represents a disposable resource, such as the execution of an Observable. A\n * Subscription has one important method, `unsubscribe`, that takes no argument\n * and just disposes the resource held by the subscription.\n *\n * Additionally, subscriptions may be grouped together through the `add()`\n * method, which will attach a child Subscription to the current Subscription.\n * When a Subscription is unsubscribed, all its children (and its grandchildren)\n * will be unsubscribed as well.\n *\n * @class Subscription\n */\nexport class Subscription implements SubscriptionLike {\n /** @nocollapse */\n public static EMPTY = (() => {\n const empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n\n /**\n * A flag to indicate whether this Subscription has already been unsubscribed.\n */\n public closed = false;\n\n private _parentage: Subscription[] | Subscription | null = null;\n\n /**\n * The list of registered finalizers to execute upon unsubscription. Adding and removing from this\n * list occurs in the {@link #add} and {@link #remove} methods.\n */\n private _finalizers: Exclude<TeardownLogic, void>[] | null = null;\n\n /**\n * @param initialTeardown A function executed first as part of the finalization\n * process that is kicked off when {@link #unsubscribe} is called.\n */\n constructor(private initialTeardown?: () => void) {}\n\n /**\n * Disposes the resources held by the subscription. May, for instance, cancel\n * an ongoing Observable execution or cancel any other type of work that\n * started when the Subscription was created.\n * @return {void}\n */\n unsubscribe(): void {\n let errors: any[] | undefined;\n\n if (!this.closed) {\n this.closed = true;\n\n // Remove this from it's parents.\n const { _parentage } = this;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n for (const parent of _parentage) {\n parent.remove(this);\n }\n } else {\n _parentage.remove(this);\n }\n }\n\n const { initialTeardown: initialFinalizer } = this;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n } catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n\n const { _finalizers } = this;\n if (_finalizers) {\n this._finalizers = null;\n for (const finalizer of _finalizers) {\n try {\n execFinalizer(finalizer);\n } catch (err) {\n errors = errors ?? [];\n if (err instanceof UnsubscriptionError) {\n errors = [...errors, ...err.errors];\n } else {\n errors.push(err);\n }\n }\n }\n }\n\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n }\n\n /**\n * Adds a finalizer to this subscription, so that finalization will be unsubscribed/called\n * when this subscription is unsubscribed. If this subscription is already {@link #closed},\n * because it has already been unsubscribed, then whatever finalizer is passed to it\n * will automatically be executed (unless the finalizer itself is also a closed subscription).\n *\n * Closed Subscriptions cannot be added as finalizers to any subscription. Adding a closed\n * subscription to a any subscription will result in no operation. (A noop).\n *\n * Adding a subscription to itself, or adding `null` or `undefined` will not perform any\n * operation at all. (A noop).\n *\n * `Subscription` instances that are added to this instance will automatically remove themselves\n * if they are unsubscribed. Functions and {@link Unsubscribable} objects that you wish to remove\n * will need to be removed manually with {@link #remove}\n *\n * @param teardown The finalization logic to add to this subscription.\n */\n add(teardown: TeardownLogic): void {\n // Only add the finalizer if it's not undefined\n // and don't add a subscription to itself.\n if (teardown && teardown !== this) {\n if (this.closed) {\n // If this subscription is already closed,\n // execute whatever finalizer is handed to it automatically.\n execFinalizer(teardown);\n } else {\n if (teardown instanceof Subscription) {\n // We don't add closed subscriptions, and we don't add the same subscription\n // twice. Subscription unsubscribe is idempotent.\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = this._finalizers ?? []).push(teardown);\n }\n }\n }\n\n /**\n * Checks to see if a this subscription already has a particular parent.\n * This will signal that this subscription has already been added to the parent in question.\n * @param parent the parent to check for\n */\n private _hasParent(parent: Subscription) {\n const { _parentage } = this;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n }\n\n /**\n * Adds a parent to this subscription so it can be removed from the parent if it\n * unsubscribes on it's own.\n *\n * NOTE: THIS ASSUMES THAT {@link _hasParent} HAS ALREADY BEEN CHECKED.\n * @param parent The parent subscription to add\n */\n private _addParent(parent: Subscription) {\n const { _parentage } = this;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n }\n\n /**\n * Called on a child when it is removed via {@link #remove}.\n * @param parent The parent to remove\n */\n private _removeParent(parent: Subscription) {\n const { _parentage } = this;\n if (_parentage === parent) {\n this._parentage = null;\n } else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n }\n\n /**\n * Removes a finalizer from this subscription that was previously added with the {@link #add} method.\n *\n * Note that `Subscription` instances, when unsubscribed, will automatically remove themselves\n * from every other `Subscription` they have been added to. This means that using the `remove` method\n * is not a common thing and should be used thoughtfully.\n *\n * If you add the same finalizer instance of a function or an unsubscribable object to a `Subscription` instance\n * more than once, you will need to call `remove` the same number of times to remove all instances.\n *\n * All finalizer instances are removed to free up memory upon unsubscription.\n *\n * @param teardown The finalizer to remove from this subscription\n */\n remove(teardown: Exclude<TeardownLogic, void>): void {\n const { _finalizers } = this;\n _finalizers && arrRemove(_finalizers, teardown);\n\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n }\n}\n\nexport const EMPTY_SUBSCRIPTION = Subscription.EMPTY;\n\nexport function isSubscription(value: any): value is Subscription {\n return (\n value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe))\n );\n}\n\nfunction execFinalizer(finalizer: Unsubscribable | (() => void)) {\n if (isFunction(finalizer)) {\n finalizer();\n } else {\n finalizer.unsubscribe();\n }\n}\n", "import { Subscriber } from './Subscriber';\nimport { ObservableNotification } from './types';\n\n/**\n * The {@link GlobalConfig} object for RxJS. It is used to configure things\n * like how to react on unhandled errors.\n */\nexport const config: GlobalConfig = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n\n/**\n * The global configuration object for RxJS, used to configure things\n * like how to react on unhandled errors. Accessible via {@link config}\n * object.\n */\nexport interface GlobalConfig {\n /**\n * A registration point for unhandled errors from RxJS. These are errors that\n * cannot were not handled by consuming code in the usual subscription path. For\n * example, if you have this configured, and you subscribe to an observable without\n * providing an error handler, errors from that subscription will end up here. This\n * will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onUnhandledError: ((err: any) => void) | null;\n\n /**\n * A registration point for notifications that cannot be sent to subscribers because they\n * have completed, errored or have been explicitly unsubscribed. By default, next, complete\n * and error notifications sent to stopped subscribers are noops. However, sometimes callers\n * might want a different behavior. For example, with sources that attempt to report errors\n * to stopped subscribers, a caller can configure RxJS to throw an unhandled error instead.\n * This will _always_ be called asynchronously on another job in the runtime. This is because\n * we do not want errors thrown in this user-configured handler to interfere with the\n * behavior of the library.\n */\n onStoppedNotification: ((notification: ObservableNotification<any>, subscriber: Subscriber<any>) => void) | null;\n\n /**\n * The promise constructor used by default for {@link Observable#toPromise toPromise} and {@link Observable#forEach forEach}\n * methods.\n *\n * @deprecated As of version 8, RxJS will no longer support this sort of injection of a\n * Promise constructor. If you need a Promise implementation other than native promises,\n * please polyfill/patch Promise as you see appropriate. Will be removed in v8.\n */\n Promise?: PromiseConstructorLike;\n\n /**\n * If true, turns on synchronous error rethrowing, which is a deprecated behavior\n * in v6 and higher. This behavior enables bad patterns like wrapping a subscribe\n * call in a try/catch block. It also enables producer interference, a nasty bug\n * where a multicast can be broken for all observers by a downstream consumer with\n * an unhandled error. DO NOT USE THIS FLAG UNLESS IT'S NEEDED TO BUY TIME\n * FOR MIGRATION REASONS.\n *\n * @deprecated As of version 8, RxJS will no longer support synchronous throwing\n * of unhandled errors. All errors will be thrown on a separate call stack to prevent bad\n * behaviors described above. Will be removed in v8.\n */\n useDeprecatedSynchronousErrorHandling: boolean;\n\n /**\n * If true, enables an as-of-yet undocumented feature from v5: The ability to access\n * `unsubscribe()` via `this` context in `next` functions created in observers passed\n * to `subscribe`.\n *\n * This is being removed because the performance was severely problematic, and it could also cause\n * issues when types other than POJOs are passed to subscribe as subscribers, as they will likely have\n * their `this` context overwritten.\n *\n * @deprecated As of version 8, RxJS will no longer support altering the\n * context of next functions provided as part of an observer to Subscribe. Instead,\n * you will have access to a subscription or a signal or token that will allow you to do things like\n * unsubscribe and test closed status. Will be removed in v8.\n */\n useDeprecatedNextContext: boolean;\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearTimeoutFunction = (handle: TimerHandle) => void;\n\ninterface TimeoutProvider {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n delegate:\n | {\n setTimeout: SetTimeoutFunction;\n clearTimeout: ClearTimeoutFunction;\n }\n | undefined;\n}\n\nexport const timeoutProvider: TimeoutProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setTimeout(handler: () => void, timeout?: number, ...args) {\n const { delegate } = timeoutProvider;\n if (delegate?.setTimeout) {\n return delegate.setTimeout(handler, timeout, ...args);\n }\n return setTimeout(handler, timeout, ...args);\n },\n clearTimeout(handle) {\n const { delegate } = timeoutProvider;\n return (delegate?.clearTimeout || clearTimeout)(handle as any);\n },\n delegate: undefined,\n};\n", "import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\n\n/**\n * Handles an error on another job either with the user-configured {@link onUnhandledError},\n * or by throwing it on that new job so it can be picked up by `window.onerror`, `process.on('error')`, etc.\n *\n * This should be called whenever there is an error that is out-of-band with the subscription\n * or when an error hits a terminal boundary of the subscription and no error handler was provided.\n *\n * @param err the error to report\n */\nexport function reportUnhandledError(err: any) {\n timeoutProvider.setTimeout(() => {\n const { onUnhandledError } = config;\n if (onUnhandledError) {\n // Execute the user-configured error handler.\n onUnhandledError(err);\n } else {\n // Throw so it is picked up by the runtime's uncaught error mechanism.\n throw err;\n }\n });\n}\n", "/* tslint:disable:no-empty */\nexport function noop() { }\n", "import { CompleteNotification, NextNotification, ErrorNotification } from './types';\n\n/**\n * A completion object optimized for memory use and created to be the\n * same \"shape\" as other notifications in v8.\n * @internal\n */\nexport const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined) as CompleteNotification)();\n\n/**\n * Internal use only. Creates an optimized error notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function errorNotification(error: any): ErrorNotification {\n return createNotification('E', undefined, error) as any;\n}\n\n/**\n * Internal use only. Creates an optimized next notification that is the same \"shape\"\n * as other notifications.\n * @internal\n */\nexport function nextNotification<T>(value: T) {\n return createNotification('N', value, undefined) as NextNotification<T>;\n}\n\n/**\n * Ensures that all notifications created internally have the same \"shape\" in v8.\n *\n * TODO: This is only exported to support a crazy legacy test in `groupBy`.\n * @internal\n */\nexport function createNotification(kind: 'N' | 'E' | 'C', value: any, error: any) {\n return {\n kind,\n value,\n error,\n };\n}\n", "import { config } from '../config';\n\nlet context: { errorThrown: boolean; error: any } | null = null;\n\n/**\n * Handles dealing with errors for super-gross mode. Creates a context, in which\n * any synchronously thrown errors will be passed to {@link captureError}. Which\n * will record the error such that it will be rethrown after the call back is complete.\n * TODO: Remove in v8\n * @param cb An immediately executed function.\n */\nexport function errorContext(cb: () => void) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n const isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n const { errorThrown, error } = context!;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n } else {\n // This is the general non-deprecated path for everyone that\n // isn't crazy enough to use super-gross mode (useDeprecatedSynchronousErrorHandling)\n cb();\n }\n}\n\n/**\n * Captures errors only in super-gross mode.\n * @param err the error to capture\n */\nexport function captureError(err: any) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n", "import { isFunction } from './util/isFunction';\nimport { Observer, ObservableNotification } from './types';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\n\n/**\n * Implements the {@link Observer} interface and extends the\n * {@link Subscription} class. While the {@link Observer} is the public API for\n * consuming the values of an {@link Observable}, all Observers get converted to\n * a Subscriber, in order to provide Subscription-like capabilities such as\n * `unsubscribe`. Subscriber is a common type in RxJS, and crucial for\n * implementing operators, but it is rarely used as a public API.\n *\n * @class Subscriber<T>\n */\nexport class Subscriber<T> extends Subscription implements Observer<T> {\n /**\n * A static factory for a Subscriber, given a (potentially partial) definition\n * of an Observer.\n * @param next The `next` callback of an Observer.\n * @param error The `error` callback of an\n * Observer.\n * @param complete The `complete` callback of an\n * Observer.\n * @return A Subscriber wrapping the (partially defined)\n * Observer represented by the given arguments.\n * @nocollapse\n * @deprecated Do not use. Will be removed in v8. There is no replacement for this\n * method, and there is no reason to be creating instances of `Subscriber` directly.\n * If you have a specific use case, please file an issue.\n */\n static create<T>(next?: (x?: T) => void, error?: (e?: any) => void, complete?: () => void): Subscriber<T> {\n return new SafeSubscriber(next, error, complete);\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected isStopped: boolean = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n protected destination: Subscriber<any> | Observer<any>; // this `any` is the escape hatch to erase extra type param (e.g. R)\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * There is no reason to directly create an instance of Subscriber. This type is exported for typings reasons.\n */\n constructor(destination?: Subscriber<any> | Observer<any>) {\n super();\n if (destination) {\n this.destination = destination;\n // Automatically chain subscriptions together here.\n // if destination is a Subscription, then it is a Subscriber.\n if (isSubscription(destination)) {\n destination.add(this);\n }\n } else {\n this.destination = EMPTY_OBSERVER;\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `next` from\n * the Observable, with a value. The Observable may call this method 0 or more\n * times.\n * @param {T} [value] The `next` value.\n * @return {void}\n */\n next(value?: T): void {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n } else {\n this._next(value!);\n }\n }\n\n /**\n * The {@link Observer} callback to receive notifications of type `error` from\n * the Observable, with an attached `Error`. Notifies the Observer that\n * the Observable has experienced an error condition.\n * @param {any} [err] The `error` exception.\n * @return {void}\n */\n error(err?: any): void {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n } else {\n this.isStopped = true;\n this._error(err);\n }\n }\n\n /**\n * The {@link Observer} callback to receive a valueless notification of type\n * `complete` from the Observable. Notifies the Observer that the Observable\n * has finished sending push-based notifications.\n * @return {void}\n */\n complete(): void {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n } else {\n this.isStopped = true;\n this._complete();\n }\n }\n\n unsubscribe(): void {\n if (!this.closed) {\n this.isStopped = true;\n super.unsubscribe();\n this.destination = null!;\n }\n }\n\n protected _next(value: T): void {\n this.destination.next(value);\n }\n\n protected _error(err: any): void {\n try {\n this.destination.error(err);\n } finally {\n this.unsubscribe();\n }\n }\n\n protected _complete(): void {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }\n}\n\n/**\n * This bind is captured here because we want to be able to have\n * compatibility with monoid libraries that tend to use a method named\n * `bind`. In particular, a library called Monio requires this.\n */\nconst _bind = Function.prototype.bind;\n\nfunction bind<Fn extends (...args: any[]) => any>(fn: Fn, thisArg: any): Fn {\n return _bind.call(fn, thisArg);\n}\n\n/**\n * Internal optimization only, DO NOT EXPOSE.\n * @internal\n */\nclass ConsumerObserver<T> implements Observer<T> {\n constructor(private partialObserver: Partial<Observer<T>>) {}\n\n next(value: T): void {\n const { partialObserver } = this;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n\n error(err: any): void {\n const { partialObserver } = this;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n } catch (error) {\n handleUnhandledError(error);\n }\n } else {\n handleUnhandledError(err);\n }\n }\n\n complete(): void {\n const { partialObserver } = this;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n } catch (error) {\n handleUnhandledError(error);\n }\n }\n }\n}\n\nexport class SafeSubscriber<T> extends Subscriber<T> {\n constructor(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((e?: any) => void) | null,\n complete?: (() => void) | null\n ) {\n super();\n\n let partialObserver: Partial<Observer<T>>;\n if (isFunction(observerOrNext) || !observerOrNext) {\n // The first argument is a function, not an observer. The next\n // two arguments *could* be observers, or they could be empty.\n partialObserver = {\n next: (observerOrNext ?? undefined) as (((value: T) => void) | undefined),\n error: error ?? undefined,\n complete: complete ?? undefined,\n };\n } else {\n // The first argument is a partial observer.\n let context: any;\n if (this && config.useDeprecatedNextContext) {\n // This is a deprecated path that made `this.unsubscribe()` available in\n // next handler functions passed to subscribe. This only exists behind a flag\n // now, as it is *very* slow.\n context = Object.create(observerOrNext);\n context.unsubscribe = () => this.unsubscribe();\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context),\n error: observerOrNext.error && bind(observerOrNext.error, context),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context),\n };\n } else {\n // The \"normal\" path. Just use the partial observer directly.\n partialObserver = observerOrNext;\n }\n }\n\n // Wrap the partial observer to ensure it's a full observer, and\n // make sure proper error handling is accounted for.\n this.destination = new ConsumerObserver(partialObserver);\n }\n}\n\nfunction handleUnhandledError(error: any) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n } else {\n // Ideal path, we report this as an unhandled error,\n // which is thrown on a new call stack.\n reportUnhandledError(error);\n }\n}\n\n/**\n * An error handler used when no error handler was supplied\n * to the SafeSubscriber -- meaning no error handler was supplied\n * do the `subscribe` call on our observable.\n * @param err The error to handle\n */\nfunction defaultErrorHandler(err: any) {\n throw err;\n}\n\n/**\n * A handler for notifications that cannot be sent to a stopped subscriber.\n * @param notification The notification being sent\n * @param subscriber The stopped subscriber\n */\nfunction handleStoppedNotification(notification: ObservableNotification<any>, subscriber: Subscriber<any>) {\n const { onStoppedNotification } = config;\n onStoppedNotification && timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber));\n}\n\n/**\n * The observer used as a stub for subscriptions where the user did not\n * pass any arguments to `subscribe`. Comes with the default error handling\n * behavior.\n */\nexport const EMPTY_OBSERVER: Readonly<Observer<any>> & { closed: true } = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n", "/**\n * Symbol.observable or a string \"@@observable\". Used for interop\n *\n * @deprecated We will no longer be exporting this symbol in upcoming versions of RxJS.\n * Instead polyfill and use Symbol.observable directly *or* use https://www.npmjs.com/package/symbol-observable\n */\nexport const observable: string | symbol = (() => (typeof Symbol === 'function' && Symbol.observable) || '@@observable')();\n", "/**\n * This function takes one parameter and just returns it. Simply put,\n * this is like `<T>(x: T): T => x`.\n *\n * ## Examples\n *\n * This is useful in some cases when using things like `mergeMap`\n *\n * ```ts\n * import { interval, take, map, range, mergeMap, identity } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(5));\n *\n * const result$ = source$.pipe(\n * map(i => range(i)),\n * mergeMap(identity) // same as mergeMap(x => x)\n * );\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * Or when you want to selectively apply an operator\n *\n * ```ts\n * import { interval, take, identity } from 'rxjs';\n *\n * const shouldLimit = () => Math.random() < 0.5;\n *\n * const source$ = interval(1000);\n *\n * const result$ = source$.pipe(shouldLimit() ? take(5) : identity);\n *\n * result$.subscribe({\n * next: console.log\n * });\n * ```\n *\n * @param x Any value that is returned by this function\n * @returns The value passed as the first parameter to this function\n */\nexport function identity<T>(x: T): T {\n return x;\n}\n", "import { identity } from './identity';\nimport { UnaryFunction } from '../types';\n\nexport function pipe(): typeof identity;\nexport function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;\nexport function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;\nexport function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;\nexport function pipe<T, A, B, C, D>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>\n): UnaryFunction<T, D>;\nexport function pipe<T, A, B, C, D, E>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>\n): UnaryFunction<T, E>;\nexport function pipe<T, A, B, C, D, E, F>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>\n): UnaryFunction<T, F>;\nexport function pipe<T, A, B, C, D, E, F, G>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>\n): UnaryFunction<T, G>;\nexport function pipe<T, A, B, C, D, E, F, G, H>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>\n): UnaryFunction<T, H>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>\n): UnaryFunction<T, I>;\nexport function pipe<T, A, B, C, D, E, F, G, H, I>(\n fn1: UnaryFunction<T, A>,\n fn2: UnaryFunction<A, B>,\n fn3: UnaryFunction<B, C>,\n fn4: UnaryFunction<C, D>,\n fn5: UnaryFunction<D, E>,\n fn6: UnaryFunction<E, F>,\n fn7: UnaryFunction<F, G>,\n fn8: UnaryFunction<G, H>,\n fn9: UnaryFunction<H, I>,\n ...fns: UnaryFunction<any, any>[]\n): UnaryFunction<T, unknown>;\n\n/**\n * pipe() can be called on one or more functions, each of which can take one argument (\"UnaryFunction\")\n * and uses it to return a value.\n * It returns a function that takes one argument, passes it to the first UnaryFunction, and then\n * passes the result to the next one, passes that result to the next one, and so on. \n */\nexport function pipe(...fns: Array<UnaryFunction<any, any>>): UnaryFunction<any, any> {\n return pipeFromArray(fns);\n}\n\n/** @internal */\nexport function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R> {\n if (fns.length === 0) {\n return identity as UnaryFunction<any, any>;\n }\n\n if (fns.length === 1) {\n return fns[0];\n }\n\n return function piped(input: T): R {\n return fns.reduce((prev: any, fn: UnaryFunction<T, R>) => fn(prev), input as any);\n };\n}\n", "import { Operator } from './Operator';\nimport { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription, Subscription } from './Subscription';\nimport { TeardownLogic, OperatorFunction, Subscribable, Observer } from './types';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A representation of any set of values over any amount of time. This is the most basic building block\n * of RxJS.\n *\n * @class Observable<T>\n */\nexport class Observable<T> implements Subscribable<T> {\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n source: Observable<any> | undefined;\n\n /**\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n */\n operator: Operator<any, T> | undefined;\n\n /**\n * @constructor\n * @param {Function} subscribe the function that is called when the Observable is\n * initially subscribed to. This function is given a Subscriber, to which new values\n * can be `next`ed, or an `error` method can be called to raise an error, or\n * `complete` can be called to notify of a successful completion.\n */\n constructor(subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n\n // HACK: Since TypeScript inherits static properties too, we have to\n // fight against TypeScript here so Subject can have a different static create signature\n /**\n * Creates a new Observable by calling the Observable constructor\n * @owner Observable\n * @method create\n * @param {Function} subscribe? the subscriber function to be passed to the Observable constructor\n * @return {Observable} a new observable\n * @nocollapse\n * @deprecated Use `new Observable()` instead. Will be removed in v8.\n */\n static create: (...args: any[]) => any = <T>(subscribe?: (subscriber: Subscriber<T>) => TeardownLogic) => {\n return new Observable<T>(subscribe);\n };\n\n /**\n * Creates a new Observable, with this Observable instance as the source, and the passed\n * operator defined as the new observable's operator.\n * @method lift\n * @param operator the operator defining the operation to take on the observable\n * @return a new observable with the Operator applied\n * @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.\n * If you have implemented an operator using `lift`, it is recommended that you create an\n * operator by simply returning `new Observable()` directly. See \"Creating new operators from\n * scratch\" section here: https://rxjs.dev/guide/operators\n */\n lift<R>(operator?: Operator<T, R>): Observable<R> {\n const observable = new Observable<R>();\n observable.source = this;\n observable.operator = operator;\n return observable;\n }\n\n subscribe(observerOrNext?: Partial<Observer<T>> | ((value: T) => void)): Subscription;\n /** @deprecated Instead of passing separate callback arguments, use an observer argument. Signatures taking separate callback arguments will be removed in v8. Details: https://rxjs.dev/deprecations/subscribe-arguments */\n subscribe(next?: ((value: T) => void) | null, error?: ((error: any) => void) | null, complete?: (() => void) | null): Subscription;\n /**\n * Invokes an execution of an Observable and registers Observer handlers for notifications it will emit.\n *\n * <span class=\"informal\">Use it when you have all these Observables, but still nothing is happening.</span>\n *\n * `subscribe` is not a regular operator, but a method that calls Observable's internal `subscribe` function. It\n * might be for example a function that you passed to Observable's constructor, but most of the time it is\n * a library implementation, which defines what will be emitted by an Observable, and when it be will emitted. This means\n * that calling `subscribe` is actually the moment when Observable starts its work, not when it is created, as it is often\n * the thought.\n *\n * Apart from starting the execution of an Observable, this method allows you to listen for values\n * that an Observable emits, as well as for when it completes or errors. You can achieve this in two\n * of the following ways.\n *\n * The first way is creating an object that implements {@link Observer} interface. It should have methods\n * defined by that interface, but note that it should be just a regular JavaScript object, which you can create\n * yourself in any way you want (ES6 class, classic function constructor, object literal etc.). In particular, do\n * not attempt to use any RxJS implementation details to create Observers - you don't need them. Remember also\n * that your object does not have to implement all methods. If you find yourself creating a method that doesn't\n * do anything, you can simply omit it. Note however, if the `error` method is not provided and an error happens,\n * it will be thrown asynchronously. Errors thrown asynchronously cannot be caught using `try`/`catch`. Instead,\n * use the {@link onUnhandledError} configuration option or use a runtime handler (like `window.onerror` or\n * `process.on('error)`) to be notified of unhandled errors. Because of this, it's recommended that you provide\n * an `error` method to avoid missing thrown errors.\n *\n * The second way is to give up on Observer object altogether and simply provide callback functions in place of its methods.\n * This means you can provide three functions as arguments to `subscribe`, where the first function is equivalent\n * of a `next` method, the second of an `error` method and the third of a `complete` method. Just as in case of an Observer,\n * if you do not need to listen for something, you can omit a function by passing `undefined` or `null`,\n * since `subscribe` recognizes these functions by where they were placed in function call. When it comes\n * to the `error` function, as with an Observer, if not provided, errors emitted by an Observable will be thrown asynchronously.\n *\n * You can, however, subscribe with no parameters at all. This may be the case where you're not interested in terminal events\n * and you also handled emissions internally by using operators (e.g. using `tap`).\n *\n * Whichever style of calling `subscribe` you use, in both cases it returns a Subscription object.\n * This object allows you to call `unsubscribe` on it, which in turn will stop the work that an Observable does and will clean\n * up all resources that an Observable used. Note that cancelling a subscription will not call `complete` callback\n * provided to `subscribe` function, which is reserved for a regular completion signal that comes from an Observable.\n *\n * Remember that callbacks provided to `subscribe` are not guaranteed to be called asynchronously.\n * It is an Observable itself that decides when these functions will be called. For example {@link of}\n * by default emits all its values synchronously. Always check documentation for how given Observable\n * will behave when subscribed and if its default behavior can be modified with a `scheduler`.\n *\n * #### Examples\n *\n * Subscribe with an {@link guide/observer Observer}\n *\n * ```ts\n * import { of } from 'rxjs';\n *\n * const sumObserver = {\n * sum: 0,\n * next(value) {\n * console.log('Adding: ' + value);\n * this.sum = this.sum + value;\n * },\n * error() {\n * // We actually could just remove this method,\n * // since we do not really care about errors right now.\n * },\n * complete() {\n * console.log('Sum equals: ' + this.sum);\n * }\n * };\n *\n * of(1, 2, 3) // Synchronously emits 1, 2, 3 and then completes.\n * .subscribe(sumObserver);\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Subscribe with functions ({@link deprecations/subscribe-arguments deprecated})\n *\n * ```ts\n * import { of } from 'rxjs'\n *\n * let sum = 0;\n *\n * of(1, 2, 3).subscribe(\n * value => {\n * console.log('Adding: ' + value);\n * sum = sum + value;\n * },\n * undefined,\n * () => console.log('Sum equals: ' + sum)\n * );\n *\n * // Logs:\n * // 'Adding: 1'\n * // 'Adding: 2'\n * // 'Adding: 3'\n * // 'Sum equals: 6'\n * ```\n *\n * Cancel a subscription\n *\n * ```ts\n * import { interval } from 'rxjs';\n *\n * const subscription = interval(1000).subscribe({\n * next(num) {\n * console.log(num)\n * },\n * complete() {\n * // Will not be called, even when cancelling subscription.\n * console.log('completed!');\n * }\n * });\n *\n * setTimeout(() => {\n * subscription.unsubscribe();\n * console.log('unsubscribed!');\n * }, 2500);\n *\n * // Logs:\n * // 0 after 1s\n * // 1 after 2s\n * // 'unsubscribed!' after 2.5s\n * ```\n *\n * @param {Observer|Function} observerOrNext (optional) Either an observer with methods to be called,\n * or the first of three possible handlers, which is the handler for each value emitted from the subscribed\n * Observable.\n * @param {Function} error (optional) A handler for a terminal event resulting from an error. If no error handler is provided,\n * the error will be thrown asynchronously as unhandled.\n * @param {Function} complete (optional) A handler for a terminal event resulting from successful completion.\n * @return {Subscription} a subscription reference to the registered handlers\n * @method subscribe\n */\n subscribe(\n observerOrNext?: Partial<Observer<T>> | ((value: T) => void) | null,\n error?: ((error: any) => void) | null,\n complete?: (() => void) | null\n ): Subscription {\n const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n\n errorContext(() => {\n const { operator, source } = this;\n subscriber.add(\n operator\n ? // We're dealing with a subscription in the\n // operator chain to one of our lifted operators.\n operator.call(subscriber, source)\n : source\n ? // If `source` has a value, but `operator` does not, something that\n // had intimate knowledge of our API, like our `Subject`, must have\n // set it. We're going to just call `_subscribe` directly.\n this._subscribe(subscriber)\n : // In all other cases, we're likely wrapping a user-provided initializer\n // function, so we need to catch errors and handle them appropriately.\n this._trySubscribe(subscriber)\n );\n });\n\n return subscriber;\n }\n\n /** @internal */\n protected _trySubscribe(sink: Subscriber<T>): TeardownLogic {\n try {\n return this._subscribe(sink);\n } catch (err) {\n // We don't need to return anything in this case,\n // because it's just going to try to `add()` to a subscription\n // above.\n sink.error(err);\n }\n }\n\n /**\n * Used as a NON-CANCELLABLE means of subscribing to an observable, for use with\n * APIs that expect promises, like `async/await`. You cannot unsubscribe from this.\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * #### Example\n *\n * ```ts\n * import { interval, take } from 'rxjs';\n *\n * const source$ = interval(1000).pipe(take(4));\n *\n * async function getTotal() {\n * let total = 0;\n *\n * await source$.forEach(value => {\n * total += value;\n * console.log('observable -> ' + value);\n * });\n *\n * return total;\n * }\n *\n * getTotal().then(\n * total => console.log('Total: ' + total)\n * );\n *\n * // Expected:\n * // 'observable -> 0'\n * // 'observable -> 1'\n * // 'observable -> 2'\n * // 'observable -> 3'\n * // 'Total: 6'\n * ```\n *\n * @param next a handler for each value emitted by the observable\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n */\n forEach(next: (value: T) => void): Promise<void>;\n\n /**\n * @param next a handler for each value emitted by the observable\n * @param promiseCtor a constructor function used to instantiate the Promise\n * @return a promise that either resolves on observable completion or\n * rejects with the handled error\n * @deprecated Passing a Promise constructor will no longer be available\n * in upcoming versions of RxJS. This is because it adds weight to the library, for very\n * little benefit. If you need this functionality, it is recommended that you either\n * polyfill Promise, or you create an adapter to convert the returned native promise\n * to whatever promise implementation you wanted. Will be removed in v8.\n */\n forEach(next: (value: T) => void, promiseCtor: PromiseConstructorLike): Promise<void>;\n\n forEach(next: (value: T) => void, promiseCtor?: PromiseConstructorLike): Promise<void> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor<void>((resolve, reject) => {\n const subscriber = new SafeSubscriber<T>({\n next: (value) => {\n try {\n next(value);\n } catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n this.subscribe(subscriber);\n }) as Promise<void>;\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<any>): TeardownLogic {\n return this.source?.subscribe(subscriber);\n }\n\n /**\n * An interop point defined by the es7-observable spec https://github.com/zenparsing/es-observable\n * @method Symbol.observable\n * @return {Observable} this instance of the observable\n */\n [Symbol_observable]() {\n return this;\n }\n\n /* tslint:disable:max-line-length */\n pipe(): Observable<T>;\n pipe<A>(op1: OperatorFunction<T, A>): Observable<A>;\n pipe<A, B>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>): Observable<B>;\n pipe<A, B, C>(op1: OperatorFunction<T, A>, op2: OperatorFunction<A, B>, op3: OperatorFunction<B, C>): Observable<C>;\n pipe<A, B, C, D>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>\n ): Observable<D>;\n pipe<A, B, C, D, E>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>\n ): Observable<E>;\n pipe<A, B, C, D, E, F>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>\n ): Observable<F>;\n pipe<A, B, C, D, E, F, G>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>\n ): Observable<G>;\n pipe<A, B, C, D, E, F, G, H>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>\n ): Observable<H>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>\n ): Observable<I>;\n pipe<A, B, C, D, E, F, G, H, I>(\n op1: OperatorFunction<T, A>,\n op2: OperatorFunction<A, B>,\n op3: OperatorFunction<B, C>,\n op4: OperatorFunction<C, D>,\n op5: OperatorFunction<D, E>,\n op6: OperatorFunction<E, F>,\n op7: OperatorFunction<F, G>,\n op8: OperatorFunction<G, H>,\n op9: OperatorFunction<H, I>,\n ...operations: OperatorFunction<any, any>[]\n ): Observable<unknown>;\n /* tslint:enable:max-line-length */\n\n /**\n * Used to stitch together functional operators into a chain.\n * @method pipe\n * @return {Observable} the Observable result of all of the operators having\n * been called in the order they were passed in.\n *\n * ## Example\n *\n * ```ts\n * import { interval, filter, map, scan } from 'rxjs';\n *\n * interval(1000)\n * .pipe(\n * filter(x => x % 2 === 0),\n * map(x => x + x),\n * scan((acc, x) => acc + x)\n * )\n * .subscribe(x => console.log(x));\n * ```\n */\n pipe(...operations: OperatorFunction<any, any>[]): Observable<any> {\n return pipeFromArray(operations)(this);\n }\n\n /* tslint:disable:max-line-length */\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: typeof Promise): Promise<T | undefined>;\n /** @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise */\n toPromise(PromiseCtor: PromiseConstructorLike): Promise<T | undefined>;\n /* tslint:enable:max-line-length */\n\n /**\n * Subscribe to this Observable and get a Promise resolving on\n * `complete` with the last emission (if any).\n *\n * **WARNING**: Only use this with observables you *know* will complete. If the source\n * observable does not complete, you will end up with a promise that is hung up, and\n * potentially all of the state of an async function hanging out in memory. To avoid\n * this situation, look into adding something like {@link timeout}, {@link take},\n * {@link takeWhile}, or {@link takeUntil} amongst others.\n *\n * @method toPromise\n * @param [promiseCtor] a constructor function used to instantiate\n * the Promise\n * @return A Promise that resolves with the last value emit, or\n * rejects on an error. If there were no emissions, Promise\n * resolves with undefined.\n * @deprecated Replaced with {@link firstValueFrom} and {@link lastValueFrom}. Will be removed in v8. Details: https://rxjs.dev/deprecations/to-promise\n */\n toPromise(promiseCtor?: PromiseConstructorLike): Promise<T | undefined> {\n promiseCtor = getPromiseCtor(promiseCtor);\n\n return new promiseCtor((resolve, reject) => {\n let value: T | undefined;\n this.subscribe(\n (x: T) => (value = x),\n (err: any) => reject(err),\n () => resolve(value)\n );\n }) as Promise<T | undefined>;\n }\n}\n\n/**\n * Decides between a passed promise constructor from consuming code,\n * A default configured promise constructor, and the native promise\n * constructor and returns it. If nothing can be found, it will throw\n * an error.\n * @param promiseCtor The optional promise constructor to passed by consuming code\n */\nfunction getPromiseCtor(promiseCtor: PromiseConstructorLike | undefined) {\n return promiseCtor ?? config.Promise ?? Promise;\n}\n\nfunction isObserver<T>(value: any): value is Observer<T> {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\n\nfunction isSubscriber<T>(value: any): value is Subscriber<T> {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n", "import { Observable } from '../Observable';\nimport { Subscriber } from '../Subscriber';\nimport { OperatorFunction } from '../types';\nimport { isFunction } from './isFunction';\n\n/**\n * Used to determine if an object is an Observable with a lift function.\n */\nexport function hasLift(source: any): source is { lift: InstanceType<typeof Observable>['lift'] } {\n return isFunction(source?.lift);\n}\n\n/**\n * Creates an `OperatorFunction`. Used to define operators throughout the library in a concise way.\n * @param init The logic to connect the liftedSource to the subscriber at the moment of subscription.\n */\nexport function operate<T, R>(\n init: (liftedSource: Observable<T>, subscriber: Subscriber<R>) => (() => void) | void\n): OperatorFunction<T, R> {\n return (source: Observable<T>) => {\n if (hasLift(source)) {\n return source.lift(function (this: Subscriber<R>, liftedSource: Observable<T>) {\n try {\n return init(liftedSource, this);\n } catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n", "import { Subscriber } from '../Subscriber';\n\n/**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional teardown logic here. This will only be called on teardown if the\n * subscriber itself is not already closed. This is called after all other teardown logic is executed.\n */\nexport function createOperatorSubscriber<T>(\n destination: Subscriber<any>,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n onFinalize?: () => void\n): Subscriber<T> {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\n\n/**\n * A generic helper for allowing operators to be created with a Subscriber and\n * use closures to capture necessary state from the operator function itself.\n */\nexport class OperatorSubscriber<T> extends Subscriber<T> {\n /**\n * Creates an instance of an `OperatorSubscriber`.\n * @param destination The downstream subscriber.\n * @param onNext Handles next values, only called if this subscriber is not stopped or closed. Any\n * error that occurs in this function is caught and sent to the `error` method of this subscriber.\n * @param onError Handles errors from the subscription, any errors that occur in this handler are caught\n * and send to the `destination` error handler.\n * @param onComplete Handles completion notification from the subscription. Any errors that occur in\n * this handler are sent to the `destination` error handler.\n * @param onFinalize Additional finalization logic here. This will only be called on finalization if the\n * subscriber itself is not already closed. This is called after all other finalization logic is executed.\n * @param shouldUnsubscribe An optional check to see if an unsubscribe call should truly unsubscribe.\n * NOTE: This currently **ONLY** exists to support the strange behavior of {@link groupBy}, where unsubscription\n * to the resulting observable does not actually disconnect from the source if there are active subscriptions\n * to any grouped observable. (DO NOT EXPOSE OR USE EXTERNALLY!!!)\n */\n constructor(\n destination: Subscriber<any>,\n onNext?: (value: T) => void,\n onComplete?: () => void,\n onError?: (err: any) => void,\n private onFinalize?: () => void,\n private shouldUnsubscribe?: () => boolean\n ) {\n // It's important - for performance reasons - that all of this class's\n // members are initialized and that they are always initialized in the same\n // order. This will ensure that all OperatorSubscriber instances have the\n // same hidden class in V8. This, in turn, will help keep the number of\n // hidden classes involved in property accesses within the base class as\n // low as possible. If the number of hidden classes involved exceeds four,\n // the property accesses will become megamorphic and performance penalties\n // will be incurred - i.e. inline caches won't be used.\n //\n // The reasons for ensuring all instances have the same hidden class are\n // further discussed in this blog post from Benedikt Meurer:\n // https://benediktmeurer.de/2018/03/23/impact-of-polymorphism-on-component-based-frameworks-like-react/\n super(destination);\n this._next = onNext\n ? function (this: OperatorSubscriber<T>, value: T) {\n try {\n onNext(value);\n } catch (err) {\n destination.error(err);\n }\n }\n : super._next;\n this._error = onError\n ? function (this: OperatorSubscriber<T>, err: any) {\n try {\n onError(err);\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._error;\n this._complete = onComplete\n ? function (this: OperatorSubscriber<T>) {\n try {\n onComplete();\n } catch (err) {\n // Send any errors that occur down stream.\n destination.error(err);\n } finally {\n // Ensure finalization.\n this.unsubscribe();\n }\n }\n : super._complete;\n }\n\n unsubscribe() {\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n const { closed } = this;\n super.unsubscribe();\n // Execute additional teardown if we have any and we didn't already do so.\n !closed && this.onFinalize?.();\n }\n }\n}\n", "import { createErrorClass } from './createErrorClass';\n\nexport interface ObjectUnsubscribedError extends Error {}\n\nexport interface ObjectUnsubscribedErrorCtor {\n /**\n * @deprecated Internal implementation detail. Do not construct error instances.\n * Cannot be tagged as internal: https://github.com/ReactiveX/rxjs/issues/6269\n */\n new (): ObjectUnsubscribedError;\n}\n\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nexport const ObjectUnsubscribedError: ObjectUnsubscribedErrorCtor = createErrorClass(\n (_super) =>\n function ObjectUnsubscribedErrorImpl(this: any) {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n }\n);\n", "import { Operator } from './Operator';\nimport { Observable } from './Observable';\nimport { Subscriber } from './Subscriber';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { Observer, SubscriptionLike, TeardownLogic } from './types';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\n\n/**\n * A Subject is a special type of Observable that allows values to be\n * multicasted to many Observers. Subjects are like EventEmitters.\n *\n * Every Subject is an Observable and an Observer. You can subscribe to a\n * Subject, and you can call next to feed values as well as error and complete.\n */\nexport class Subject<T> extends Observable<T> implements SubscriptionLike {\n closed = false;\n\n private currentObservers: Observer<T>[] | null = null;\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n observers: Observer<T>[] = [];\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n isStopped = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n hasError = false;\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n thrownError: any = null;\n\n /**\n * Creates a \"subject\" by basically gluing an observer to an observable.\n *\n * @nocollapse\n * @deprecated Recommended you do not use. Will be removed at some point in the future. Plans for replacement still under discussion.\n */\n static create: (...args: any[]) => any = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {\n return new AnonymousSubject<T>(destination, source);\n };\n\n constructor() {\n // NOTE: This must be here to obscure Observable's constructor.\n super();\n }\n\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n lift<R>(operator: Operator<T, R>): Observable<R> {\n const subject = new AnonymousSubject(this, this);\n subject.operator = operator as any;\n return subject as any;\n }\n\n /** @internal */\n protected _throwIfClosed() {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n }\n\n next(value: T) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n if (!this.currentObservers) {\n this.currentObservers = Array.from(this.observers);\n }\n for (const observer of this.currentObservers) {\n observer.next(value);\n }\n }\n });\n }\n\n error(err: any) {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.hasError = this.isStopped = true;\n this.thrownError = err;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.error(err);\n }\n }\n });\n }\n\n complete() {\n errorContext(() => {\n this._throwIfClosed();\n if (!this.isStopped) {\n this.isStopped = true;\n const { observers } = this;\n while (observers.length) {\n observers.shift()!.complete();\n }\n }\n });\n }\n\n unsubscribe() {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null!;\n }\n\n get observed() {\n return this.observers?.length > 0;\n }\n\n /** @internal */\n protected _trySubscribe(subscriber: Subscriber<T>): TeardownLogic {\n this._throwIfClosed();\n return super._trySubscribe(subscriber);\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n }\n\n /** @internal */\n protected _innerSubscribe(subscriber: Subscriber<any>) {\n const { hasError, isStopped, observers } = this;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(() => {\n this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n }\n\n /** @internal */\n protected _checkFinalizedStatuses(subscriber: Subscriber<any>) {\n const { hasError, thrownError, isStopped } = this;\n if (hasError) {\n subscriber.error(thrownError);\n } else if (isStopped) {\n subscriber.complete();\n }\n }\n\n /**\n * Creates a new Observable with this Subject as the source. You can do this\n * to create custom Observer-side logic of the Subject and conceal it from\n * code that uses the Observable.\n * @return {Observable} Observable that the Subject casts to\n */\n asObservable(): Observable<T> {\n const observable: any = new Observable<T>();\n observable.source = this;\n return observable;\n }\n}\n\n/**\n * @class AnonymousSubject<T>\n */\nexport class AnonymousSubject<T> extends Subject<T> {\n constructor(\n /** @deprecated Internal implementation detail, do not use directly. Will be made internal in v8. */\n public destination?: Observer<T>,\n source?: Observable<T>\n ) {\n super();\n this.source = source;\n }\n\n next(value: T) {\n this.destination?.next?.(value);\n }\n\n error(err: any) {\n this.destination?.error?.(err);\n }\n\n complete() {\n this.destination?.complete?.();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n return this.source?.subscribe(subscriber) ?? EMPTY_SUBSCRIPTION;\n }\n}\n", "import { Subject } from './Subject';\nimport { Subscriber } from './Subscriber';\nimport { Subscription } from './Subscription';\n\n/**\n * A variant of Subject that requires an initial value and emits its current\n * value whenever it is subscribed to.\n *\n * @class BehaviorSubject<T>\n */\nexport class BehaviorSubject<T> extends Subject<T> {\n constructor(private _value: T) {\n super();\n }\n\n get value(): T {\n return this.getValue();\n }\n\n /** @internal */\n protected _subscribe(subscriber: Subscriber<T>): Subscription {\n const subscription = super._subscribe(subscriber);\n !subscription.closed && subscriber.next(this._value);\n return subscription;\n }\n\n getValue(): T {\n const { hasError, thrownError, _value } = this;\n if (hasError) {\n throw thrownError;\n }\n this._throwIfClosed();\n return _value;\n }\n\n next(value: T): void {\n super.next((this._value = value));\n }\n}\n", "import { TimestampProvider } from '../types';\n\ninterface DateTimestampProvider extends TimestampProvider {\n delegate: TimestampProvider | undefined;\n}\n\nexport const dateTimestampProvider: DateTimestampProvider = {\n now() {\n // Use the variable rather than `this` so that the function can be called\n // without being bound to the provider.\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n", "import { Scheduler } from '../Scheduler';\nimport { Subscription } from '../Subscription';\nimport { SchedulerAction } from '../types';\n\n/**\n * A unit of work to be executed in a `scheduler`. An action is typically\n * created from within a {@link SchedulerLike} and an RxJS user does not need to concern\n * themselves about creating and manipulating an Action.\n *\n * ```ts\n * class Action<T> extends Subscription {\n * new (scheduler: Scheduler, work: (state?: T) => void);\n * schedule(state?: T, delay: number = 0): Subscription;\n * }\n * ```\n *\n * @class Action<T>\n */\nexport class Action<T> extends Subscription {\n constructor(scheduler: Scheduler, work: (this: SchedulerAction<T>, state?: T) => void) {\n super();\n }\n /**\n * Schedules this action on its parent {@link SchedulerLike} for execution. May be passed\n * some context object, `state`. May happen at some point in the future,\n * according to the `delay` parameter, if specified.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler.\n * @return {void}\n */\n public schedule(state?: T, delay: number = 0): Subscription {\n return this;\n }\n}\n", "import type { TimerHandle } from './timerHandle';\ntype SetIntervalFunction = (handler: () => void, timeout?: number, ...args: any[]) => TimerHandle;\ntype ClearIntervalFunction = (handle: TimerHandle) => void;\n\ninterface IntervalProvider {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n delegate:\n | {\n setInterval: SetIntervalFunction;\n clearInterval: ClearIntervalFunction;\n }\n | undefined;\n}\n\nexport const intervalProvider: IntervalProvider = {\n // When accessing the delegate, use the variable rather than `this` so that\n // the functions can be called without being bound to the provider.\n setInterval(handler: () => void, timeout?: number, ...args) {\n const { delegate } = intervalProvider;\n if (delegate?.setInterval) {\n return delegate.setInterval(handler, timeout, ...args);\n }\n return setInterval(handler, timeout, ...args);\n },\n clearInterval(handle) {\n const { delegate } = intervalProvider;\n return (delegate?.clearInterval || clearInterval)(handle as any);\n },\n delegate: undefined,\n};\n", "import { Action } from './Action';\nimport { SchedulerAction } from '../types';\nimport { Subscription } from '../Subscription';\nimport { AsyncScheduler } from './AsyncScheduler';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncAction<T> extends Action<T> {\n public id: TimerHandle | undefined;\n public state?: T;\n // @ts-ignore: Property has no initializer and is not definitely assigned\n public delay: number;\n protected pending: boolean = false;\n\n constructor(protected scheduler: AsyncScheduler, protected work: (this: SchedulerAction<T>, state?: T) => void) {\n super(scheduler, work);\n }\n\n public schedule(state?: T, delay: number = 0): Subscription {\n if (this.closed) {\n return this;\n }\n\n // Always replace the current state with the new state.\n this.state = state;\n\n const id = this.id;\n const scheduler = this.scheduler;\n\n //\n // Important implementation note:\n //\n // Actions only execute once by default, unless rescheduled from within the\n // scheduled callback. This allows us to implement single and repeat\n // actions via the same code path, without adding API surface area, as well\n // as mimic traditional recursion but across asynchronous boundaries.\n //\n // However, JS runtimes and timers distinguish between intervals achieved by\n // serial `setTimeout` calls vs. a single `setInterval` call. An interval of\n // serial `setTimeout` calls can be individually delayed, which delays\n // scheduling the next `setTimeout`, and so on. `setInterval` attempts to\n // guarantee the interval callback will be invoked more precisely to the\n // interval period, regardless of load.\n //\n // Therefore, we use `setInterval` to schedule single and repeat actions.\n // If the action reschedules itself with the same delay, the interval is not\n // canceled. If the action doesn't reschedule, or reschedules with a\n // different delay, the interval will be canceled after scheduled callback\n // execution.\n //\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n\n // Set the pending flag indicating that this action has been scheduled, or\n // has recursively rescheduled itself.\n this.pending = true;\n\n this.delay = delay;\n // If this action has already an async Id, don't request a new one.\n this.id = this.id ?? this.requestAsyncId(scheduler, this.id, delay);\n\n return this;\n }\n\n protected requestAsyncId(scheduler: AsyncScheduler, _id?: TimerHandle, delay: number = 0): TimerHandle {\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n }\n\n protected recycleAsyncId(_scheduler: AsyncScheduler, id?: TimerHandle, delay: number | null = 0): TimerHandle | undefined {\n // If this action is rescheduled with the same delay time, don't clear the interval id.\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n // Otherwise, if the action's delay time is different from the current delay,\n // or the action has been rescheduled before it's executed, clear the interval id\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n\n return undefined;\n }\n\n /**\n * Immediately executes this action and the `work` it contains.\n * @return {any}\n */\n public execute(state: T, delay: number): any {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n\n this.pending = false;\n const error = this._execute(state, delay);\n if (error) {\n return error;\n } else if (this.pending === false && this.id != null) {\n // Dequeue if the action didn't reschedule itself. Don't call\n // unsubscribe(), because the action could reschedule later.\n // For example:\n // ```\n // scheduler.schedule(function doWork(counter) {\n // /* ... I'm a busy worker bee ... */\n // var originalAction = this;\n // /* wait 100ms before rescheduling the action */\n // setTimeout(function () {\n // originalAction.schedule(counter + 1);\n // }, 100);\n // }, 1000);\n // ```\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n }\n\n protected _execute(state: T, _delay: number): any {\n let errored: boolean = false;\n let errorValue: any;\n try {\n this.work(state);\n } catch (e) {\n errored = true;\n // HACK: Since code elsewhere is relying on the \"truthiness\" of the\n // return here, we can't have it return \"\" or 0 or false.\n // TODO: Clean this up when we refactor schedulers mid-version-8 or so.\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n }\n\n unsubscribe() {\n if (!this.closed) {\n const { id, scheduler } = this;\n const { actions } = scheduler;\n\n this.work = this.state = this.scheduler = null!;\n this.pending = false;\n\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n\n this.delay = null!;\n super.unsubscribe();\n }\n }\n}\n", "import { Action } from './scheduler/Action';\nimport { Subscription } from './Subscription';\nimport { SchedulerLike, SchedulerAction } from './types';\nimport { dateTimestampProvider } from './scheduler/dateTimestampProvider';\n\n/**\n * An execution context and a data structure to order tasks and schedule their\n * execution. Provides a notion of (potentially virtual) time, through the\n * `now()` getter method.\n *\n * Each unit of work in a Scheduler is called an `Action`.\n *\n * ```ts\n * class Scheduler {\n * now(): number;\n * schedule(work, delay?, state?): Subscription;\n * }\n * ```\n *\n * @class Scheduler\n * @deprecated Scheduler is an internal implementation detail of RxJS, and\n * should not be used directly. Rather, create your own class and implement\n * {@link SchedulerLike}. Will be made internal in v8.\n */\nexport class Scheduler implements SchedulerLike {\n public static now: () => number = dateTimestampProvider.now;\n\n constructor(private schedulerActionCtor: typeof Action, now: () => number = Scheduler.now) {\n this.now = now;\n }\n\n /**\n * A getter method that returns a number representing the current time\n * (at the time this function was called) according to the scheduler's own\n * internal clock.\n * @return {number} A number that represents the current time. May or may not\n * have a relation to wall-clock time. May or may not refer to a time unit\n * (e.g. milliseconds).\n */\n public now: () => number;\n\n /**\n * Schedules a function, `work`, for execution. May happen at some point in\n * the future, according to the `delay` parameter, if specified. May be passed\n * some context object, `state`, which will be passed to the `work` function.\n *\n * The given arguments will be processed an stored as an Action object in a\n * queue of actions.\n *\n * @param {function(state: ?T): ?Subscription} work A function representing a\n * task, or some unit of work to be executed by the Scheduler.\n * @param {number} [delay] Time to wait before executing the work, where the\n * time unit is implicit and defined by the Scheduler itself.\n * @param {T} [state] Some contextual data that the `work` function uses when\n * called by the Scheduler.\n * @return {Subscription} A subscription in order to be able to unsubscribe\n * the scheduled work.\n */\n public schedule<T>(work: (this: SchedulerAction<T>, state?: T) => void, delay: number = 0, state?: T): Subscription {\n return new this.schedulerActionCtor<T>(this, work).schedule(state, delay);\n }\n}\n", "import { Scheduler } from '../Scheduler';\nimport { Action } from './Action';\nimport { AsyncAction } from './AsyncAction';\nimport { TimerHandle } from './timerHandle';\n\nexport class AsyncScheduler extends Scheduler {\n public actions: Array<AsyncAction<any>> = [];\n /**\n * A flag to indicate whether the Scheduler is currently executing a batch of\n * queued actions.\n * @type {boolean}\n * @internal\n */\n public _active: boolean = false;\n /**\n * An internal ID used to track the latest asynchronous task such as those\n * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and\n * others.\n * @type {any}\n * @internal\n */\n public _scheduled: TimerHandle | undefined;\n\n constructor(SchedulerAction: typeof Action, now: () => number = Scheduler.now) {\n super(SchedulerAction, now);\n }\n\n public flush(action: AsyncAction<any>): void {\n const { actions } = this;\n\n if (this._active) {\n actions.push(action);\n return;\n }\n\n let error: any;\n this._active = true;\n\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()!)); // exhaust the scheduler queue\n\n this._active = false;\n\n if (error) {\n while ((action = actions.shift()!)) {\n action.unsubscribe();\n }\n throw error;\n }\n }\n}\n", "import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\n\n/**\n *\n * Async Scheduler\n *\n * <span class=\"informal\">Schedule task as if you used setTimeout(task, duration)</span>\n *\n * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript\n * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating\n * in intervals.\n *\n * If you just want to \"defer\" task, that is to perform it right after currently\n * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`),\n * better choice will be the {@link asapScheduler} scheduler.\n *\n * ## Examples\n * Use async scheduler to delay task\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * const task = () => console.log('it works!');\n *\n * asyncScheduler.schedule(task, 2000);\n *\n * // After 2 seconds logs:\n * // \"it works!\"\n * ```\n *\n * Use async scheduler to repeat task in intervals\n * ```ts\n * import { asyncScheduler } from 'rxjs';\n *\n * function task(state) {\n * console.log(state);\n * this.schedule(state + 1, 1000); // `this` references currently executing Action,\n * // which we reschedule with new state and delay\n * }\n *\n * asyncScheduler.schedule(task, 3000, 0);\n *\n * // Logs:\n * // 0 after 3s\n * // 1 after 4s\n * // 2 after 5s\n * // 3 after 6s\n * ```\n */\n\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\n\n/**\n * @deprecated Renamed to {@link asyncScheduler}. Will be removed in v8.\n */\nexport const async = asyncScheduler;\n", "export const isArrayLike = (<T>(x: any): x is ArrayLike<T> => x && typeof x.length === 'number' && typeof x !== 'function');", "import { isFunction } from \"./isFunction\";\n\n/**\n * Tests to see if the object is \"thennable\".\n * @param value the object to test\n */\nexport function isPromise(value: any): value is PromiseLike<any> {\n return isFunction(value?.then);\n}\n", "import { InteropObservable } from '../types';\nimport { observable as Symbol_observable } from '../symbol/observable';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being Observable (but not necessary an Rx Observable) */\nexport function isInteropObservable(input: any): input is InteropObservable<any> {\n return isFunction(input[Symbol_observable]);\n}\n", "import { isFunction } from './isFunction';\n\nexport function isAsyncIterable<T>(obj: any): obj is AsyncIterable<T> {\n return Symbol.asyncIterator && isFunction(obj?.[Symbol.asyncIterator]);\n}\n", "/**\n * Creates the TypeError to throw if an invalid object is passed to `from` or `scheduled`.\n * @param input The object that was passed.\n */\nexport function createInvalidObservableTypeError(input: any) {\n // TODO: We should create error codes that can be looked up, so this can be less verbose.\n return new TypeError(\n `You provided ${\n input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`\n } where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`\n );\n}\n", "export function getSymbolIterator(): symbol {\n if (typeof Symbol !== 'function' || !Symbol.iterator) {\n return '@@iterator' as any;\n }\n\n return Symbol.iterator;\n}\n\nexport const iterator = getSymbolIterator();\n", "import { iterator as Symbol_iterator } from '../symbol/iterator';\nimport { isFunction } from './isFunction';\n\n/** Identifies an input as being an Iterable */\nexport function isIterable(input: any): input is Iterable<any> {\n return isFunction(input?.[Symbol_iterator]);\n}\n", "import { ReadableStreamLike } from '../types';\nimport { isFunction } from './isFunction';\n\nexport async function* readableStreamLikeToAsyncGenerator<T>(readableStream: ReadableStreamLike<T>): AsyncGenerator<T> {\n const reader = readableStream.getReader();\n try {\n while (true) {\n const { value, done } = await reader.read();\n if (done) {\n return;\n }\n yield value!;\n }\n } finally {\n reader.releaseLock();\n }\n}\n\nexport function isReadableStreamLike<T>(obj: any): obj is ReadableStreamLike<T> {\n // We don't want to use instanceof checks because they would return\n // false for instances from another Realm, like an <iframe>.\n return isFunction(obj?.getReader);\n}\n", "import { isArrayLike } from '../util/isArrayLike';\nimport { isPromise } from '../util/isPromise';\nimport { Observable } from '../Observable';\nimport { ObservableInput, ObservedValueOf, ReadableStreamLike } from '../types';\nimport { isInteropObservable } from '../util/isInteropObservable';\nimport { isAsyncIterable } from '../util/isAsyncIterable';\nimport { createInvalidObservableTypeError } from '../util/throwUnobservableError';\nimport { isIterable } from '../util/isIterable';\nimport { isReadableStreamLike, readableStreamLikeToAsyncGenerator } from '../util/isReadableStreamLike';\nimport { Subscriber } from '../Subscriber';\nimport { isFunction } from '../util/isFunction';\nimport { reportUnhandledError } from '../util/reportUnhandledError';\nimport { observable as Symbol_observable } from '../symbol/observable';\n\nexport function innerFrom<O extends ObservableInput<any>>(input: O): Observable<ObservedValueOf<O>>;\nexport function innerFrom<T>(input: ObservableInput<T>): Observable<T> {\n if (input instanceof Observable) {\n return input;\n }\n if (input != null) {\n if (isInteropObservable(input)) {\n return fromInteropObservable(input);\n }\n if (isArrayLike(input)) {\n return fromArrayLike(input);\n }\n if (isPromise(input)) {\n return fromPromise(input);\n }\n if (isAsyncIterable(input)) {\n return fromAsyncIterable(input);\n }\n if (isIterable(input)) {\n return fromIterable(input);\n }\n if (isReadableStreamLike(input)) {\n return fromReadableStreamLike(input);\n }\n }\n\n throw createInvalidObservableTypeError(input);\n}\n\n/**\n * Creates an RxJS Observable from an object that implements `Symbol.observable`.\n * @param obj An object that properly implements `Symbol.observable`.\n */\nexport function fromInteropObservable<T>(obj: any) {\n return new Observable((subscriber: Subscriber<T>) => {\n const obs = obj[Symbol_observable]();\n if (isFunction(obs.subscribe)) {\n return obs.subscribe(subscriber);\n }\n // Should be caught by observable subscribe function error handling.\n throw new TypeError('Provided object does not correctly implement Symbol.observable');\n });\n}\n\n/**\n * Synchronously emits the values of an array like and completes.\n * This is exported because there are creation functions and operators that need to\n * make direct use of the same logic, and there's no reason to make them run through\n * `from` conditionals because we *know* they're dealing with an array.\n * @param array The array to emit values from\n */\nexport function fromArrayLike<T>(array: ArrayLike<T>) {\n return new Observable((subscriber: Subscriber<T>) => {\n // Loop over the array and emit each value. Note two things here:\n // 1. We're making sure that the subscriber is not closed on each loop.\n // This is so we don't continue looping over a very large array after\n // something like a `take`, `takeWhile`, or other synchronous unsubscription\n // has already unsubscribed.\n // 2. In this form, reentrant code can alter that array we're looping over.\n // This is a known issue, but considered an edge case. The alternative would\n // be to copy the array before executing the loop, but this has\n // performance implications.\n for (let i = 0; i < array.length && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n });\n}\n\nexport function fromPromise<T>(promise: PromiseLike<T>) {\n return new Observable((subscriber: Subscriber<T>) => {\n promise\n .then(\n (value) => {\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n },\n (err: any) => subscriber.error(err)\n )\n .then(null, reportUnhandledError);\n });\n}\n\nexport function fromIterable<T>(iterable: Iterable<T>) {\n return new Observable((subscriber: Subscriber<T>) => {\n for (const value of iterable) {\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n }\n subscriber.complete();\n });\n}\n\nexport function fromAsyncIterable<T>(asyncIterable: AsyncIterable<T>) {\n return new Observable((subscriber: Subscriber<T>) => {\n process(asyncIterable, subscriber).catch((err) => subscriber.error(err));\n });\n}\n\nexport function fromReadableStreamLike<T>(readableStream: ReadableStreamLike<T>) {\n return fromAsyncIterable(readableStreamLikeToAsyncGenerator(readableStream));\n}\n\nasync function process<T>(asyncIterable: AsyncIterable<T>, subscriber: Subscriber<T>) {\n for await (const value of asyncIterable) {\n subscriber.next(value);\n // A side-effect may have closed our subscriber,\n // check before the next iteration.\n if (subscriber.closed) {\n return;\n }\n }\n subscriber.complete();\n}\n", "import { Subscription } from '../Subscription';\nimport { SchedulerAction, SchedulerLike } from '../types';\n\nexport function executeSchedule(\n parentSubscription: Subscription,\n scheduler: SchedulerLike,\n work: () => void,\n delay: number,\n repeat: true\n): void;\nexport function executeSchedule(\n parentSubscription: Subscription,\n scheduler: SchedulerLike,\n work: () => void,\n delay?: number,\n repeat?: false\n): Subscription;\n\nexport function executeSchedule(\n parentSubscription: Subscription,\n scheduler: SchedulerLike,\n work: () => void,\n delay = 0,\n repeat = false\n): Subscription | void {\n const scheduleSubscription = scheduler.schedule(function (this: SchedulerAction<any>) {\n work();\n if (repeat) {\n parentSubscription.add(this.schedule(null, delay));\n } else {\n this.unsubscribe();\n }\n }, delay);\n\n parentSubscription.add(scheduleSubscription);\n\n if (!repeat) {\n // Because user-land scheduler implementations are unlikely to properly reuse\n // Actions for repeat scheduling, we can't trust that the returned subscription\n // will control repeat subscription scenarios. So we're trying to avoid using them\n // incorrectly within this library.\n return scheduleSubscription;\n }\n}\n", "import { OperatorFunction } from '../types';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\n\nexport function map<T, R>(project: (value: T, index: number) => R): OperatorFunction<T, R>;\n/** @deprecated Use a closure instead of a `thisArg`. Signatures accepting a `thisArg` will be removed in v8. */\nexport function map<T, R, A>(project: (this: A, value: T, index: number) => R, thisArg: A): OperatorFunction<T, R>;\n\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * <span class=\"informal\">Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.</span>\n *\n * \n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * ## Example\n *\n * Map every click to the `clientX` position of that click\n *\n * ```ts\n * import { fromEvent, map } from 'rxjs';\n *\n * const clicks = fromEvent<PointerEvent>(document, 'click');\n * const positions = clicks.pipe(map(ev => ev.clientX));\n *\n * positions.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return A function that returns an Observable that emits the values from the\n * source Observable transformed by the given `project` function.\n */\nexport function map<T, R>(project: (value: T, index: number) => R, thisArg?: any): OperatorFunction<T, R> {\n return operate((source, subscriber) => {\n // The index of the value from the source. Used with projection.\n let index = 0;\n // Subscribe to the source, all errors and completions are sent along\n // to the consumer.\n source.subscribe(\n createOperatorSubscriber(subscriber, (value: T) => {\n // Call the projection function with the appropriate this context,\n // and send the resulting value to the consumer.\n subscriber.next(project.call(thisArg, value, index++));\n })\n );\n });\n}\n", "import { OperatorFunction } from \"../types\";\nimport { map } from \"../operators/map\";\n\nconst { isArray } = Array;\n\nfunction callOrApply<T, R>(fn: ((...values: T[]) => R), args: T|T[]): R {\n return isArray(args) ? fn(...args) : fn(args);\n}\n\n/**\n * Used in several -- mostly deprecated -- situations where we need to \n * apply a list of arguments or a single argument to a result selector.\n */\nexport function mapOneOrManyArgs<T, R>(fn: ((...values: T[]) => R)): OperatorFunction<T|T[], R> {\n return map(args => callOrApply(fn, args))\n}", "import { Observable } from '../Observable';\nimport { innerFrom } from '../observable/innerFrom';\nimport { Subscriber } from '../Subscriber';\nimport { ObservableInput, SchedulerLike } from '../types';\nimport { executeSchedule } from '../util/executeSchedule';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\n\n/**\n * A process embodying the general \"merge\" strategy. This is used in\n * `mergeMap` and `mergeScan` because the logic is otherwise nearly identical.\n * @param source The original source observable\n * @param subscriber The consumer subscriber\n * @param project The projection function to get our inner sources\n * @param concurrent The number of concurrent inner subscriptions\n * @param onBeforeNext Additional logic to apply before nexting to our consumer\n * @param expand If `true` this will perform an \"expand\" strategy, which differs only\n * in that it recurses, and the inner subscription must be schedule-able.\n * @param innerSubScheduler A scheduler to use to schedule inner subscriptions,\n * this is to support the expand strategy, mostly, and should be deprecated\n */\nexport function mergeInternals<T, R>(\n source: Observable<T>,\n subscriber: Subscriber<R>,\n project: (value: T, index: number) => ObservableInput<R>,\n concurrent: number,\n onBeforeNext?: (innerValue: R) => void,\n expand?: boolean,\n innerSubScheduler?: SchedulerLike,\n additionalFinalizer?: () => void\n) {\n // Buffered values, in the event of going over our concurrency limit\n const buffer: T[] = [];\n // The number of active inner subscriptions.\n let active = 0;\n // An index to pass to our accumulator function\n let index = 0;\n // Whether or not the outer source has completed.\n let isComplete = false;\n\n /**\n * Checks to see if we can complete our result or not.\n */\n const checkComplete = () => {\n // If the outer has completed, and nothing is left in the buffer,\n // and we don't have any active inner subscriptions, then we can\n // Emit the state and complete.\n if (isComplete && !buffer.length && !active) {\n subscriber.complete();\n }\n };\n\n // If we're under our concurrency limit, just start the inner subscription, otherwise buffer and wait.\n const outerNext = (value: T) => (active < concurrent ? doInnerSub(value) : buffer.push(value));\n\n const doInnerSub = (value: T) => {\n // If we're expanding, we need to emit the outer values and the inner values\n // as the inners will \"become outers\" in a way as they are recursively fed\n // back to the projection mechanism.\n expand && subscriber.next(value as any);\n\n // Increment the number of active subscriptions so we can track it\n // against our concurrency limit later.\n active++;\n\n // A flag used to show that the inner observable completed.\n // This is checked during finalization to see if we should\n // move to the next item in the buffer, if there is on.\n let innerComplete = false;\n\n // Start our inner subscription.\n innerFrom(project(value, index++)).subscribe(\n createOperatorSubscriber(\n subscriber,\n (innerValue) => {\n // `mergeScan` has additional handling here. For example\n // taking the inner value and updating state.\n onBeforeNext?.(innerValue);\n\n if (expand) {\n // If we're expanding, then just recurse back to our outer\n // handler. It will emit the value first thing.\n outerNext(innerValue as any);\n } else {\n // Otherwise, emit the inner value.\n subscriber.next(innerValue);\n }\n },\n () => {\n // Flag that we have completed, so we know to check the buffer\n // during finalization.\n innerComplete = true;\n },\n // Errors are passed to the destination.\n undefined,\n () => {\n // During finalization, if the inner completed (it wasn't errored or\n // cancelled), then we want to try the next item in the buffer if\n // there is one.\n if (innerComplete) {\n // We have to wrap this in a try/catch because it happens during\n // finalization, possibly asynchronously, and we want to pass\n // any errors that happen (like in a projection function) to\n // the outer Subscriber.\n try {\n // INNER SOURCE COMPLETE\n // Decrement the active count to ensure that the next time\n // we try to call `doInnerSub`, the number is accurate.\n active--;\n // If we have more values in the buffer, try to process those\n // Note that this call will increment `active` ahead of the\n // next conditional, if there were any more inner subscriptions\n // to start.\n while (buffer.length && active < concurrent) {\n const bufferedValue = buffer.shift()!;\n // Particularly for `expand`, we need to check to see if a scheduler was provided\n // for when we want to start our inner subscription. Otherwise, we just start\n // are next inner subscription.\n if (innerSubScheduler) {\n executeSchedule(subscriber, innerSubScheduler, () => doInnerSub(bufferedValue));\n } else {\n doInnerSub(bufferedValue);\n }\n }\n // Check to see if we can complete, and complete if so.\n checkComplete();\n } catch (err) {\n subscriber.error(err);\n }\n }\n }\n )\n );\n };\n\n // Subscribe to our source observable.\n source.subscribe(\n createOperatorSubscriber(subscriber, outerNext, () => {\n // Outer completed, make a note of it, and check to see if we can complete everything.\n isComplete = true;\n checkComplete();\n })\n );\n\n // Additional finalization (for when the destination is torn down).\n // Other finalization is added implicitly via subscription above.\n return () => {\n additionalFinalizer?.();\n };\n}\n", "import { ObservableInput, OperatorFunction, ObservedValueOf } from '../types';\nimport { map } from './map';\nimport { innerFrom } from '../observable/innerFrom';\nimport { operate } from '../util/lift';\nimport { mergeInternals } from './mergeInternals';\nimport { isFunction } from '../util/isFunction';\n\n/* tslint:disable:max-line-length */\nexport function mergeMap<T, O extends ObservableInput<any>>(\n project: (value: T, index: number) => O,\n concurrent?: number\n): OperatorFunction<T, ObservedValueOf<O>>;\n/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */\nexport function mergeMap<T, O extends ObservableInput<any>>(\n project: (value: T, index: number) => O,\n resultSelector: undefined,\n concurrent?: number\n): OperatorFunction<T, ObservedValueOf<O>>;\n/** @deprecated The `resultSelector` parameter will be removed in v8. Use an inner `map` instead. Details: https://rxjs.dev/deprecations/resultSelector */\nexport function mergeMap<T, R, O extends ObservableInput<any>>(\n project: (value: T, index: number) => O,\n resultSelector: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R,\n concurrent?: number\n): OperatorFunction<T, R>;\n/* tslint:enable:max-line-length */\n\n/**\n * Projects each source value to an Observable which is merged in the output\n * Observable.\n *\n * <span class=\"informal\">Maps each value to an Observable, then flattens all of\n * these inner Observables using {@link mergeAll}.</span>\n *\n * \n *\n * Returns an Observable that emits items based on applying a function that you\n * supply to each item emitted by the source Observable, where that function\n * returns an Observable, and then merging those resulting Observables and\n * emitting the results of this merger.\n *\n * ## Example\n *\n * Map and flatten each letter to an Observable ticking every 1 second\n *\n * ```ts\n * import { of, mergeMap, interval, map } from 'rxjs';\n *\n * const letters = of('a', 'b', 'c');\n * const result = letters.pipe(\n * mergeMap(x => interval(1000).pipe(map(i => x + i)))\n * );\n *\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // a0\n * // b0\n * // c0\n * // a1\n * // b1\n * // c1\n * // continues to list a, b, c every second with respective ascending integers\n * ```\n *\n * @see {@link concatMap}\n * @see {@link exhaustMap}\n * @see {@link merge}\n * @see {@link mergeAll}\n * @see {@link mergeMapTo}\n * @see {@link mergeScan}\n * @see {@link switchMap}\n *\n * @param {function(value: T, ?index: number): ObservableInput} project A function\n * that, when applied to an item emitted by the source Observable, returns an\n * Observable.\n * @param {number} [concurrent=Infinity] Maximum number of input\n * Observables being subscribed to concurrently.\n * @return A function that returns an Observable that emits the result of\n * applying the projection function (and the optional deprecated\n * `resultSelector`) to each item emitted by the source Observable and merging\n * the results of the Observables obtained from this transformation.\n */\nexport function mergeMap<T, R, O extends ObservableInput<any>>(\n project: (value: T, index: number) => O,\n resultSelector?: ((outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R) | number,\n concurrent: number = Infinity\n): OperatorFunction<T, ObservedValueOf<O> | R> {\n if (isFunction(resultSelector)) {\n // DEPRECATED PATH\n return mergeMap((a, i) => map((b: any, ii: number) => resultSelector(a, b, i, ii))(innerFrom(project(a, i))), concurrent);\n } else if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n\n return operate((source, subscriber) => mergeInternals(source, subscriber, project, concurrent));\n}\n", "import { innerFrom } from '../observable/innerFrom';\nimport { Observable } from '../Observable';\nimport { mergeMap } from '../operators/mergeMap';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isFunction } from '../util/isFunction';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\n\n// These constants are used to create handler registry functions using array mapping below.\nconst nodeEventEmitterMethods = ['addListener', 'removeListener'] as const;\nconst eventTargetMethods = ['addEventListener', 'removeEventListener'] as const;\nconst jqueryMethods = ['on', 'off'] as const;\n\nexport interface NodeStyleEventEmitter {\n addListener(eventName: string | symbol, handler: NodeEventHandler): this;\n removeListener(eventName: string | symbol, handler: NodeEventHandler): this;\n}\n\nexport type NodeEventHandler = (...args: any[]) => void;\n\n// For APIs that implement `addListener` and `removeListener` methods that may\n// not use the same arguments or return EventEmitter values\n// such as React Native\nexport interface NodeCompatibleEventEmitter {\n addListener(eventName: string, handler: NodeEventHandler): void | {};\n removeListener(eventName: string, handler: NodeEventHandler): void | {};\n}\n\n// Use handler types like those in @types/jquery. See:\n// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/847731ba1d7fa6db6b911c0e43aa0afe596e7723/types/jquery/misc.d.ts#L6395\nexport interface JQueryStyleEventEmitter<TContext, T> {\n on(eventName: string, handler: (this: TContext, t: T, ...args: any[]) => any): void;\n off(eventName: string, handler: (this: TContext, t: T, ...args: any[]) => any): void;\n}\n\nexport interface EventListenerObject<E> {\n handleEvent(evt: E): void;\n}\n\nexport interface HasEventTargetAddRemove<E> {\n addEventListener(\n type: string,\n listener: ((evt: E) => void) | EventListenerObject<E> | null,\n options?: boolean | AddEventListenerOptions\n ): void;\n removeEventListener(\n type: string,\n listener: ((evt: E) => void) | EventListenerObject<E> | null,\n options?: EventListenerOptions | boolean\n ): void;\n}\n\nexport interface EventListenerOptions {\n capture?: boolean;\n passive?: boolean;\n once?: boolean;\n}\n\nexport interface AddEventListenerOptions extends EventListenerOptions {\n once?: boolean;\n passive?: boolean;\n}\n\nexport function fromEvent<T>(target: HasEventTargetAddRemove<T> | ArrayLike<HasEventTargetAddRemove<T>>, eventName: string): Observable<T>;\nexport function fromEvent<T, R>(\n target: HasEventTargetAddRemove<T> | ArrayLike<HasEventTargetAddRemove<T>>,\n eventName: string,\n resultSelector: (event: T) => R\n): Observable<R>;\nexport function fromEvent<T>(\n target: HasEventTargetAddRemove<T> | ArrayLike<HasEventTargetAddRemove<T>>,\n eventName: string,\n options: EventListenerOptions\n): Observable<T>;\nexport function fromEvent<T, R>(\n target: HasEventTargetAddRemove<T> | ArrayLike<HasEventTargetAddRemove<T>>,\n eventName: string,\n options: EventListenerOptions,\n resultSelector: (event: T) => R\n): Observable<R>;\n\nexport function fromEvent(target: NodeStyleEventEmitter | ArrayLike<NodeStyleEventEmitter>, eventName: string): Observable<unknown>;\n/** @deprecated Do not specify explicit type parameters. Signatures with type parameters that cannot be inferred will be removed in v8. */\nexport function fromEvent<T>(target: NodeStyleEventEmitter | ArrayLike<NodeStyleEventEmitter>, eventName: string): Observable<T>;\nexport function fromEvent<R>(\n target: NodeStyleEventEmitter | ArrayLike<NodeStyleEventEmitter>,\n eventName: string,\n resultSelector: (...args: any[]) => R\n): Observable<R>;\n\nexport function fromEvent(\n target: NodeCompatibleEventEmitter | ArrayLike<NodeCompatibleEventEmitter>,\n eventName: string\n): Observable<unknown>;\n/** @deprecated Do not specify explicit type parameters. Signatures with type parameters that cannot be inferred will be removed in v8. */\nexport function fromEvent<T>(target: NodeCompatibleEventEmitter | ArrayLike<NodeCompatibleEventEmitter>, eventName: string): Observable<T>;\nexport function fromEvent<R>(\n target: NodeCompatibleEventEmitter | ArrayLike<NodeCompatibleEventEmitter>,\n eventName: string,\n resultSelector: (...args: any[]) => R\n): Observable<R>;\n\nexport function fromEvent<T>(\n target: JQueryStyleEventEmitter<any, T> | ArrayLike<JQueryStyleEventEmitter<any, T>>,\n eventName: string\n): Observable<T>;\nexport function fromEvent<T, R>(\n target: JQueryStyleEventEmitter<any, T> | ArrayLike<JQueryStyleEventEmitter<any, T>>,\n eventName: string,\n resultSelector: (value: T, ...args: any[]) => R\n): Observable<R>;\n\n/**\n * Creates an Observable that emits events of a specific type coming from the\n * given event target.\n *\n * <span class=\"informal\">Creates an Observable from DOM events, or Node.js\n * EventEmitter events or others.</span>\n *\n * \n *\n * `fromEvent` accepts as a first argument event target, which is an object with methods\n * for registering event handler functions. As a second argument it takes string that indicates\n * type of event we want to listen for. `fromEvent` supports selected types of event targets,\n * which are described in detail below. If your event target does not match any of the ones listed,\n * you should use {@link fromEventPattern}, which can be used on arbitrary APIs.\n * When it comes to APIs supported by `fromEvent`, their methods for adding and removing event\n * handler functions have different names, but they all accept a string describing event type\n * and function itself, which will be called whenever said event happens.\n *\n * Every time resulting Observable is subscribed, event handler function will be registered\n * to event target on given event type. When that event fires, value\n * passed as a first argument to registered function will be emitted by output Observable.\n * When Observable is unsubscribed, function will be unregistered from event target.\n *\n * Note that if event target calls registered function with more than one argument, second\n * and following arguments will not appear in resulting stream. In order to get access to them,\n * you can pass to `fromEvent` optional project function, which will be called with all arguments\n * passed to event handler. Output Observable will then emit value returned by project function,\n * instead of the usual value.\n *\n * Remember that event targets listed below are checked via duck typing. It means that\n * no matter what kind of object you have and no matter what environment you work in,\n * you can safely use `fromEvent` on that object if it exposes described methods (provided\n * of course they behave as was described above). So for example if Node.js library exposes\n * event target which has the same method names as DOM EventTarget, `fromEvent` is still\n * a good choice.\n *\n * If the API you use is more callback then event handler oriented (subscribed\n * callback function fires only once and thus there is no need to manually\n * unregister it), you should use {@link bindCallback} or {@link bindNodeCallback}\n * instead.\n *\n * `fromEvent` supports following types of event targets:\n *\n * **DOM EventTarget**\n *\n * This is an object with `addEventListener` and `removeEventListener` methods.\n *\n * In the browser, `addEventListener` accepts - apart from event type string and event\n * handler function arguments - optional third parameter, which is either an object or boolean,\n * both used for additional configuration how and when passed function will be called. When\n * `fromEvent` is used with event target of that type, you can provide this values\n * as third parameter as well.\n *\n * **Node.js EventEmitter**\n *\n * An object with `addListener` and `removeListener` methods.\n *\n * **JQuery-style event target**\n *\n * An object with `on` and `off` methods\n *\n * **DOM NodeList**\n *\n * List of DOM Nodes, returned for example by `document.querySelectorAll` or `Node.childNodes`.\n *\n * Although this collection is not event target in itself, `fromEvent` will iterate over all Nodes\n * it contains and install event handler function in every of them. When returned Observable\n * is unsubscribed, function will be removed from all Nodes.\n *\n * **DOM HtmlCollection**\n *\n * Just as in case of NodeList it is a collection of DOM nodes. Here as well event handler function is\n * installed and removed in each of elements.\n *\n *\n * ## Examples\n *\n * Emit clicks happening on the DOM document\n *\n * ```ts\n * import { fromEvent } from 'rxjs';\n *\n * const clicks = fromEvent(document, 'click');\n * clicks.subscribe(x => console.log(x));\n *\n * // Results in:\n * // MouseEvent object logged to console every time a click\n * // occurs on the document.\n * ```\n *\n * Use `addEventListener` with capture option\n *\n * ```ts\n * import { fromEvent } from 'rxjs';\n *\n * const div = document.createElement('div');\n * div.style.cssText = 'width: 200px; height: 200px; background: #09c;';\n * document.body.appendChild(div);\n *\n * // note optional configuration parameter which will be passed to addEventListener\n * const clicksInDocument = fromEvent(document, 'click', { capture: true });\n * const clicksInDiv = fromEvent(div, 'click');\n *\n * clicksInDocument.subscribe(() => console.log('document'));\n * clicksInDiv.subscribe(() => console.log('div'));\n *\n * // By default events bubble UP in DOM tree, so normally\n * // when we would click on div in document\n * // \"div\" would be logged first and then \"document\".\n * // Since we specified optional `capture` option, document\n * // will catch event when it goes DOWN DOM tree, so console\n * // will log \"document\" and then \"div\".\n * ```\n *\n * @see {@link bindCallback}\n * @see {@link bindNodeCallback}\n * @see {@link fromEventPattern}\n *\n * @param {FromEventTarget<T>} target The DOM EventTarget, Node.js\n * EventEmitter, JQuery-like event target, NodeList or HTMLCollection to attach the event handler to.\n * @param {string} eventName The event name of interest, being emitted by the\n * `target`.\n * @param {EventListenerOptions} [options] Options to pass through to addEventListener\n * @return {Observable<T>}\n */\nexport function fromEvent<T>(\n target: any,\n eventName: string,\n options?: EventListenerOptions | ((...args: any[]) => T),\n resultSelector?: (...args: any[]) => T\n): Observable<T> {\n if (isFunction(options)) {\n resultSelector = options;\n options = undefined;\n }\n if (resultSelector) {\n return fromEvent<T>(target, eventName, options as EventListenerOptions).pipe(mapOneOrManyArgs(resultSelector));\n }\n\n // Figure out our add and remove methods. In order to do this,\n // we are going to analyze the target in a preferred order, if\n // the target matches a given signature, we take the two \"add\" and \"remove\"\n // method names and apply them to a map to create opposite versions of the\n // same function. This is because they all operate in duplicate pairs,\n // `addListener(name, handler)`, `removeListener(name, handler)`, for example.\n // The call only differs by method name, as to whether or not you're adding or removing.\n const [add, remove] =\n // If it is an EventTarget, we need to use a slightly different method than the other two patterns.\n isEventTarget(target)\n ? eventTargetMethods.map((methodName) => (handler: any) => target[methodName](eventName, handler, options as EventListenerOptions))\n : // In all other cases, the call pattern is identical with the exception of the method names.\n isNodeStyleEventEmitter(target)\n ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName))\n : isJQueryStyleEventEmitter(target)\n ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName))\n : [];\n\n // If add is falsy, it's because we didn't match a pattern above.\n // Check to see if it is an ArrayLike, because if it is, we want to\n // try to apply fromEvent to all of it's items. We do this check last,\n // because there are may be some types that are both ArrayLike *and* implement\n // event registry points, and we'd rather delegate to that when possible.\n if (!add) {\n if (isArrayLike(target)) {\n return mergeMap((subTarget: any) => fromEvent(subTarget, eventName, options as EventListenerOptions))(\n innerFrom(target)\n ) as Observable<T>;\n }\n }\n\n // If add is falsy and we made it here, it's because we didn't\n // match any valid target objects above.\n if (!add) {\n throw new TypeError('Invalid event target');\n }\n\n return new Observable<T>((subscriber) => {\n // The handler we are going to register. Forwards the event object, by itself, or\n // an array of arguments to the event handler, if there is more than one argument,\n // to the consumer.\n const handler = (...args: any[]) => subscriber.next(1 < args.length ? args : args[0]);\n // Do the work of adding the handler to the target.\n add(handler);\n // When we finalize, we want to remove the handler and free up memory.\n return () => remove!(handler);\n });\n}\n\n/**\n * Used to create `add` and `remove` functions to register and unregister event handlers\n * from a target in the most common handler pattern, where there are only two arguments.\n * (e.g. `on(name, fn)`, `off(name, fn)`, `addListener(name, fn)`, or `removeListener(name, fn)`)\n * @param target The target we're calling methods on\n * @param eventName The event name for the event we're creating register or unregister functions for\n */\nfunction toCommonHandlerRegistry(target: any, eventName: string) {\n return (methodName: string) => (handler: any) => target[methodName](eventName, handler);\n}\n\n/**\n * Checks to see if the target implements the required node-style EventEmitter methods\n * for adding and removing event handlers.\n * @param target the object to check\n */\nfunction isNodeStyleEventEmitter(target: any): target is NodeStyleEventEmitter {\n return isFunction(target.addListener) && isFunction(target.removeListener);\n}\n\n/**\n * Checks to see if the target implements the required jQuery-style EventEmitter methods\n * for adding and removing event handlers.\n * @param target the object to check\n */\nfunction isJQueryStyleEventEmitter(target: any): target is JQueryStyleEventEmitter<any, any> {\n return isFunction(target.on) && isFunction(target.off);\n}\n\n/**\n * Checks to see if the target implements the required EventTarget methods\n * for adding and removing event handlers.\n * @param target the object to check\n */\nfunction isEventTarget(target: any): target is HasEventTargetAddRemove<any> {\n return isFunction(target.addEventListener) && isFunction(target.removeEventListener);\n}\n", "import { asyncScheduler } from '../scheduler/async';\nimport { Subscription } from '../Subscription';\nimport { MonoTypeOperatorFunction, SchedulerAction, SchedulerLike } from '../types';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\n\n/**\n * Emits a notification from the source Observable only after a particular time span\n * has passed without another source emission.\n *\n * <span class=\"informal\">It's like {@link delay}, but passes only the most\n * recent notification from each burst of emissions.</span>\n *\n * \n *\n * `debounceTime` delays notifications emitted by the source Observable, but drops\n * previous pending delayed emissions if a new notification arrives on the source\n * Observable. This operator keeps track of the most recent notification from the\n * source Observable, and emits that only when `dueTime` has passed\n * without any other notification appearing on the source Observable. If a new value\n * appears before `dueTime` silence occurs, the previous notification will be dropped\n * and will not be emitted and a new `dueTime` is scheduled.\n * If the completing event happens during `dueTime` the last cached notification\n * is emitted before the completion event is forwarded to the output observable.\n * If the error event happens during `dueTime` or after it only the error event is\n * forwarded to the output observable. The cache notification is not emitted in this case.\n *\n * This is a rate-limiting operator, because it is impossible for more than one\n * notification to be emitted in any time window of duration `dueTime`, but it is also\n * a delay-like operator since output emissions do not occur at the same time as\n * they did on the source Observable. Optionally takes a {@link SchedulerLike} for\n * managing timers.\n *\n * ## Example\n *\n * Emit the most recent click after a burst of clicks\n *\n * ```ts\n * import { fromEvent, debounceTime } from 'rxjs';\n *\n * const clicks = fromEvent(document, 'click');\n * const result = clicks.pipe(debounceTime(1000));\n * result.subscribe(x => console.log(x));\n * ```\n *\n * @see {@link audit}\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link sample}\n * @see {@link sampleTime}\n * @see {@link throttle}\n * @see {@link throttleTime}\n *\n * @param {number} dueTime The timeout duration in milliseconds (or the time\n * unit determined internally by the optional `scheduler`) for the window of\n * time required to wait for emission silence before emitting the most recent\n * source value.\n * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for\n * managing the timers that handle the timeout for each value.\n * @return A function that returns an Observable that delays the emissions of\n * the source Observable by the specified `dueTime`, and may drop some values\n * if they occur too frequently.\n */\nexport function debounceTime<T>(dueTime: number, scheduler: SchedulerLike = asyncScheduler): MonoTypeOperatorFunction<T> {\n return operate((source, subscriber) => {\n let activeTask: Subscription | null = null;\n let lastValue: T | null = null;\n let lastTime: number | null = null;\n\n const emit = () => {\n if (activeTask) {\n // We have a value! Free up memory first, then emit the value.\n activeTask.unsubscribe();\n activeTask = null;\n const value = lastValue!;\n lastValue = null;\n subscriber.next(value);\n }\n };\n function emitWhenIdle(this: SchedulerAction<unknown>) {\n // This is called `dueTime` after the first value\n // but we might have received new values during this window!\n\n const targetTime = lastTime! + dueTime;\n const now = scheduler.now();\n if (now < targetTime) {\n // On that case, re-schedule to the new target\n activeTask = this.schedule(undefined, targetTime - now);\n subscriber.add(activeTask);\n return;\n }\n\n emit();\n }\n\n source.subscribe(\n createOperatorSubscriber(\n subscriber,\n (value: T) => {\n lastValue = value;\n lastTime = scheduler.now();\n\n // Only set up a task if it's not already up\n if (!activeTask) {\n activeTask = scheduler.schedule(emitWhenIdle, dueTime);\n subscriber.add(activeTask);\n }\n },\n () => {\n // Source completed.\n // Emit any pending debounced values then complete\n emit();\n subscriber.complete();\n },\n // Pass all errors through to consumer.\n undefined,\n () => {\n // Finalization.\n lastValue = activeTask = null;\n }\n )\n );\n });\n}\n", "export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];", "export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}", "export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}", "import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };", "import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};", "import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}", "export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;", "export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}", "import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}", "import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}", "import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}", "import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}", "import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}", "import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}", "import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}", "import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}", "export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}", "import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}", "export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}", "import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}", "export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};", "export default function getVariation(placement) {\n return placement.split('-')[1];\n}", "import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};", "import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};", "var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}", "var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}", "import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on <html>\n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}", "import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}", "import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}", "import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}", "import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}", "import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}", "export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}", "import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}", "import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}", "import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}", "import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}", "import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases \u2013 research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};", "import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};", "import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};", "import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};", "export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}", "import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};", "export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}", "import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}", "import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}", "import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}", "export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}", "export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}", "import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update \u2013 it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update \u2013 it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };", "import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";", "export const ROUND_ARROW =\n '<svg width=\"16\" height=\"6\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z\"></svg>';\n\nexport const BOX_CLASS = `__NAMESPACE_PREFIX__-box`;\nexport const CONTENT_CLASS = `__NAMESPACE_PREFIX__-content`;\nexport const BACKDROP_CLASS = `__NAMESPACE_PREFIX__-backdrop`;\nexport const ARROW_CLASS = `__NAMESPACE_PREFIX__-arrow`;\nexport const SVG_ARROW_CLASS = `__NAMESPACE_PREFIX__-svg-arrow`;\n\nexport const TOUCH_OPTIONS = {passive: true, capture: true};\n\nexport const TIPPY_DEFAULT_APPEND_TO = () => document.body;\n", "import {BasePlacement, Placement} from './types';\n\nexport function hasOwnProperty(\n obj: Record<string, unknown>,\n key: string\n): boolean {\n return {}.hasOwnProperty.call(obj, key);\n}\n\nexport function getValueAtIndexOrReturn<T>(\n value: T | [T | null, T | null],\n index: number,\n defaultValue: T | [T, T]\n): T {\n if (Array.isArray(value)) {\n const v = value[index];\n return v == null\n ? Array.isArray(defaultValue)\n ? defaultValue[index]\n : defaultValue\n : v;\n }\n\n return value;\n}\n\nexport function isType(value: any, type: string): boolean {\n const str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(`${type}]`) > -1;\n}\n\nexport function invokeWithArgsOrReturn(value: any, args: any[]): any {\n return typeof value === 'function' ? value(...args) : value;\n}\n\nexport function debounce<T>(\n fn: (arg: T) => void,\n ms: number\n): (arg: T) => void {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n let timeout: any;\n\n return (arg): void => {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n fn(arg);\n }, ms);\n };\n}\n\nexport function removeProperties<T>(obj: T, keys: string[]): Partial<T> {\n const clone = {...obj};\n keys.forEach((key) => {\n delete (clone as any)[key];\n });\n return clone;\n}\n\nexport function splitBySpaces(value: string): string[] {\n return value.split(/\\s+/).filter(Boolean);\n}\n\nexport function normalizeToArray<T>(value: T | T[]): T[] {\n return ([] as T[]).concat(value);\n}\n\nexport function pushIfUnique<T>(arr: T[], value: T): void {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n}\n\nexport function appendPxIfNumber(value: string | number): string {\n return typeof value === 'number' ? `${value}px` : value;\n}\n\nexport function unique<T>(arr: T[]): T[] {\n return arr.filter((item, index) => arr.indexOf(item) === index);\n}\n\nexport function getNumber(value: string | number): number {\n return typeof value === 'number' ? value : parseFloat(value);\n}\n\nexport function getBasePlacement(placement: Placement): BasePlacement {\n return placement.split('-')[0] as BasePlacement;\n}\n\nexport function arrayFrom(value: ArrayLike<any>): any[] {\n return [].slice.call(value);\n}\n\nexport function removeUndefinedProps(\n obj: Record<string, unknown>\n): Partial<Record<string, unknown>> {\n return Object.keys(obj).reduce((acc, key) => {\n if (obj[key] !== undefined) {\n (acc as any)[key] = obj[key];\n }\n\n return acc;\n }, {});\n}\n", "import {ReferenceElement, Targets} from './types';\nimport {PopperTreeData} from './types-internal';\nimport {arrayFrom, isType, normalizeToArray, getBasePlacement} from './utils';\n\nexport function div(): HTMLDivElement {\n return document.createElement('div');\n}\n\nexport function isElement(value: unknown): value is Element | DocumentFragment {\n return ['Element', 'Fragment'].some((type) => isType(value, type));\n}\n\nexport function isNodeList(value: unknown): value is NodeList {\n return isType(value, 'NodeList');\n}\n\nexport function isMouseEvent(value: unknown): value is MouseEvent {\n return isType(value, 'MouseEvent');\n}\n\nexport function isReferenceElement(value: any): value is ReferenceElement {\n return !!(value && value._tippy && value._tippy.reference === value);\n}\n\nexport function getArrayOfElements(value: Targets): Element[] {\n if (isElement(value)) {\n return [value];\n }\n\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return arrayFrom(document.querySelectorAll(value));\n}\n\nexport function setTransitionDuration(\n els: (HTMLDivElement | null)[],\n value: number\n): void {\n els.forEach((el) => {\n if (el) {\n el.style.transitionDuration = `${value}ms`;\n }\n });\n}\n\nexport function setVisibilityState(\n els: (HTMLDivElement | null)[],\n state: 'visible' | 'hidden'\n): void {\n els.forEach((el) => {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\n\nexport function getOwnerDocument(\n elementOrElements: Element | Element[]\n): Document {\n const [element] = normalizeToArray(elementOrElements);\n\n // Elements created via a <template> have an ownerDocument with no reference to the body\n return element?.ownerDocument?.body ? element.ownerDocument : document;\n}\n\nexport function isCursorOutsideInteractiveBorder(\n popperTreeData: PopperTreeData[],\n event: MouseEvent\n): boolean {\n const {clientX, clientY} = event;\n\n return popperTreeData.every(({popperRect, popperState, props}) => {\n const {interactiveBorder} = props;\n const basePlacement = getBasePlacement(popperState.placement);\n const offsetData = popperState.modifiersData.offset;\n\n if (!offsetData) {\n return true;\n }\n\n const topDistance = basePlacement === 'bottom' ? offsetData.top!.y : 0;\n const bottomDistance = basePlacement === 'top' ? offsetData.bottom!.y : 0;\n const leftDistance = basePlacement === 'right' ? offsetData.left!.x : 0;\n const rightDistance = basePlacement === 'left' ? offsetData.right!.x : 0;\n\n const exceedsTop =\n popperRect.top - clientY + topDistance > interactiveBorder;\n const exceedsBottom =\n clientY - popperRect.bottom - bottomDistance > interactiveBorder;\n const exceedsLeft =\n popperRect.left - clientX + leftDistance > interactiveBorder;\n const exceedsRight =\n clientX - popperRect.right - rightDistance > interactiveBorder;\n\n return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;\n });\n}\n\nexport function updateTransitionEndListener(\n box: HTMLDivElement,\n action: 'add' | 'remove',\n listener: (event: TransitionEvent) => void\n): void {\n const method = `${action}EventListener` as\n | 'addEventListener'\n | 'removeEventListener';\n\n // some browsers apparently support `transition` (unprefixed) but only fire\n // `webkitTransitionEnd`...\n ['transitionend', 'webkitTransitionEnd'].forEach((event) => {\n box[method](event, listener as EventListener);\n });\n}\n\n/**\n * Compared to xxx.contains, this function works for dom structures with shadow\n * dom\n */\nexport function actualContains(parent: Element, child: Element): boolean {\n let target = child;\n while (target) {\n if (parent.contains(target)) {\n return true;\n }\n target = (target.getRootNode?.() as any)?.host;\n }\n return false;\n}\n", "import {TOUCH_OPTIONS} from './constants';\nimport {isReferenceElement} from './dom-utils';\n\nexport const currentInput = {isTouch: false};\nlet lastMouseMoveTime = 0;\n\n/**\n * When a `touchstart` event is fired, it's assumed the user is using touch\n * input. We'll bind a `mousemove` event listener to listen for mouse input in\n * the future. This way, the `isTouch` property is fully dynamic and will handle\n * hybrid devices that use a mix of touch + mouse input.\n */\nexport function onDocumentTouchStart(): void {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}\n\n/**\n * When two `mousemove` event are fired consecutively within 20ms, it's assumed\n * the user is using mouse input again. `mousemove` can fire on touch devices as\n * well, but very rarely that quickly.\n */\nexport function onDocumentMouseMove(): void {\n const now = performance.now();\n\n if (now - lastMouseMoveTime < 20) {\n currentInput.isTouch = false;\n\n document.removeEventListener('mousemove', onDocumentMouseMove);\n }\n\n lastMouseMoveTime = now;\n}\n\n/**\n * When an element is in focus and has a tippy, leaving the tab/window and\n * returning causes it to show again. For mouse users this is unexpected, but\n * for keyboard use it makes sense.\n * TODO: find a better technique to solve this problem\n */\nexport function onWindowBlur(): void {\n const activeElement = document.activeElement as HTMLElement | null;\n\n if (isReferenceElement(activeElement)) {\n const instance = activeElement._tippy!;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}\n\nexport default function bindGlobalEventListeners(): void {\n document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);\n window.addEventListener('blur', onWindowBlur);\n}\n", "export const isBrowser =\n typeof window !== 'undefined' && typeof document !== 'undefined';\n\nexport const isIE11 = isBrowser\n ? // @ts-ignore\n !!window.msCrypto\n : false;\n", "import {Targets} from './types';\n\nexport function createMemoryLeakWarning(method: string): string {\n const txt = method === 'destroy' ? 'n already-' : ' ';\n\n return [\n `${method}() was called on a${txt}destroyed instance. This is a no-op but`,\n 'indicates a potential memory leak.',\n ].join(' ');\n}\n\nexport function clean(value: string): string {\n const spacesAndTabs = /[ \\t]{2,}/g;\n const lineStartWithSpaces = /^[ \\t]*/gm;\n\n return value\n .replace(spacesAndTabs, ' ')\n .replace(lineStartWithSpaces, '')\n .trim();\n}\n\nfunction getDevMessage(message: string): string {\n return clean(`\n %ctippy.js\n\n %c${clean(message)}\n\n %c👷†This is a development-only message. It will be removed in production.\n `);\n}\n\nexport function getFormattedMessage(message: string): string[] {\n return [\n getDevMessage(message),\n // title\n 'color: #00C584; font-size: 1.3em; font-weight: bold;',\n // message\n 'line-height: 1.5',\n // footer\n 'color: #a6a095;',\n ];\n}\n\n// Assume warnings and errors never have the same message\nlet visitedMessages: Set<string>;\nif (__DEV__) {\n resetVisitedMessages();\n}\n\nexport function resetVisitedMessages(): void {\n visitedMessages = new Set();\n}\n\nexport function warnWhen(condition: boolean, message: string): void {\n if (condition && !visitedMessages.has(message)) {\n visitedMessages.add(message);\n console.warn(...getFormattedMessage(message));\n }\n}\n\nexport function errorWhen(condition: boolean, message: string): void {\n if (condition && !visitedMessages.has(message)) {\n visitedMessages.add(message);\n console.error(...getFormattedMessage(message));\n }\n}\n\nexport function validateTargets(targets: Targets): void {\n const didPassFalsyValue = !targets;\n const didPassPlainObject =\n Object.prototype.toString.call(targets) === '[object Object]' &&\n !(targets as any).addEventListener;\n\n errorWhen(\n didPassFalsyValue,\n [\n 'tippy() was passed',\n '`' + String(targets) + '`',\n 'as its targets (first) argument. Valid types are: String, Element,',\n 'Element[], or NodeList.',\n ].join(' ')\n );\n\n errorWhen(\n didPassPlainObject,\n [\n 'tippy() was passed a plain object which is not supported as an argument',\n 'for virtual positioning. Use props.getReferenceClientRect instead.',\n ].join(' ')\n );\n}\n", "import {DefaultProps, Plugin, Props, ReferenceElement, Tippy} from './types';\nimport {\n hasOwnProperty,\n removeProperties,\n invokeWithArgsOrReturn,\n} from './utils';\nimport {warnWhen} from './validation';\nimport {TIPPY_DEFAULT_APPEND_TO} from './constants';\n\nconst pluginProps = {\n animateFill: false,\n followCursor: false,\n inlinePositioning: false,\n sticky: false,\n};\n\nconst renderProps = {\n allowHTML: false,\n animation: 'fade',\n arrow: true,\n content: '',\n inertia: false,\n maxWidth: 350,\n role: 'tooltip',\n theme: '',\n zIndex: 9999,\n};\n\nexport const defaultProps: DefaultProps = {\n appendTo: TIPPY_DEFAULT_APPEND_TO,\n aria: {\n content: 'auto',\n expanded: 'auto',\n },\n delay: 0,\n duration: [300, 250],\n getReferenceClientRect: null,\n hideOnClick: true,\n ignoreAttributes: false,\n interactive: false,\n interactiveBorder: 2,\n interactiveDebounce: 0,\n moveTransition: '',\n offset: [0, 10],\n onAfterUpdate() {},\n onBeforeUpdate() {},\n onCreate() {},\n onDestroy() {},\n onHidden() {},\n onHide() {},\n onMount() {},\n onShow() {},\n onShown() {},\n onTrigger() {},\n onUntrigger() {},\n onClickOutside() {},\n placement: 'top',\n plugins: [],\n popperOptions: {},\n render: null,\n showOnCreate: false,\n touch: true,\n trigger: 'mouseenter focus',\n triggerTarget: null,\n ...pluginProps,\n ...renderProps,\n};\n\nconst defaultKeys = Object.keys(defaultProps);\n\nexport const setDefaultProps: Tippy['setDefaultProps'] = (partialProps) => {\n /* istanbul ignore else */\n if (__DEV__) {\n validateProps(partialProps, []);\n }\n\n const keys = Object.keys(partialProps) as Array<keyof DefaultProps>;\n keys.forEach((key) => {\n (defaultProps as any)[key] = partialProps[key];\n });\n};\n\nexport function getExtendedPassedProps(\n passedProps: Partial<Props> & Record<string, unknown>\n): Partial<Props> {\n const plugins = passedProps.plugins || [];\n const pluginProps = plugins.reduce<Record<string, unknown>>((acc, plugin) => {\n const {name, defaultValue} = plugin;\n\n if (name) {\n acc[name] =\n passedProps[name] !== undefined\n ? passedProps[name]\n : (defaultProps as any)[name] ?? defaultValue;\n }\n\n return acc;\n }, {});\n\n return {\n ...passedProps,\n ...pluginProps,\n };\n}\n\nexport function getDataAttributeProps(\n reference: ReferenceElement,\n plugins: Plugin[]\n): Record<string, unknown> {\n const propKeys = plugins\n ? Object.keys(getExtendedPassedProps({...defaultProps, plugins}))\n : defaultKeys;\n\n const props = propKeys.reduce(\n (acc: Partial<Props> & Record<string, unknown>, key) => {\n const valueAsString = (\n reference.getAttribute(`data-tippy-${key}`) || ''\n ).trim();\n\n if (!valueAsString) {\n return acc;\n }\n\n if (key === 'content') {\n acc[key] = valueAsString;\n } else {\n try {\n acc[key] = JSON.parse(valueAsString);\n } catch (e) {\n acc[key] = valueAsString;\n }\n }\n\n return acc;\n },\n {}\n );\n\n return props;\n}\n\nexport function evaluateProps(\n reference: ReferenceElement,\n props: Props\n): Props {\n const out = {\n ...props,\n content: invokeWithArgsOrReturn(props.content, [reference]),\n ...(props.ignoreAttributes\n ? {}\n : getDataAttributeProps(reference, props.plugins)),\n };\n\n out.aria = {\n ...defaultProps.aria,\n ...out.aria,\n };\n\n out.aria = {\n expanded:\n out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,\n content:\n out.aria.content === 'auto'\n ? props.interactive\n ? null\n : 'describedby'\n : out.aria.content,\n };\n\n return out;\n}\n\nexport function validateProps(\n partialProps: Partial<Props> = {},\n plugins: Plugin[] = []\n): void {\n const keys = Object.keys(partialProps) as Array<keyof Props>;\n keys.forEach((prop) => {\n const nonPluginProps = removeProperties(\n defaultProps,\n Object.keys(pluginProps)\n );\n\n let didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop);\n\n // Check if the prop exists in `plugins`\n if (didPassUnknownProp) {\n didPassUnknownProp =\n plugins.filter((plugin) => plugin.name === prop).length === 0;\n }\n\n warnWhen(\n didPassUnknownProp,\n [\n `\\`${prop}\\``,\n \"is not a valid prop. You may have spelled it incorrectly, or if it's\",\n 'a plugin, forgot to pass it in an array as props.plugins.',\n '\\n\\n',\n 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\\n',\n 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/',\n ].join(' ')\n );\n });\n}\n", "import {\n ARROW_CLASS,\n BACKDROP_CLASS,\n BOX_CLASS,\n CONTENT_CLASS,\n SVG_ARROW_CLASS,\n} from './constants';\nimport {div, isElement} from './dom-utils';\nimport {Instance, PopperElement, Props} from './types';\nimport {PopperChildren} from './types-internal';\nimport {arrayFrom} from './utils';\n\n// Firefox extensions don't allow .innerHTML = \"...\" property. This tricks it.\nconst innerHTML = (): 'innerHTML' => 'innerHTML';\n\nfunction dangerouslySetInnerHTML(element: Element, html: string): void {\n element[innerHTML()] = html;\n}\n\nfunction createArrowElement(value: Props['arrow']): HTMLDivElement {\n const arrow = div();\n\n if (value === true) {\n arrow.className = ARROW_CLASS;\n } else {\n arrow.className = SVG_ARROW_CLASS;\n\n if (isElement(value)) {\n arrow.appendChild(value);\n } else {\n dangerouslySetInnerHTML(arrow, value as string);\n }\n }\n\n return arrow;\n}\n\nexport function setContent(content: HTMLDivElement, props: Props): void {\n if (isElement(props.content)) {\n dangerouslySetInnerHTML(content, '');\n content.appendChild(props.content);\n } else if (typeof props.content !== 'function') {\n if (props.allowHTML) {\n dangerouslySetInnerHTML(content, props.content);\n } else {\n content.textContent = props.content;\n }\n }\n}\n\nexport function getChildren(popper: PopperElement): PopperChildren {\n const box = popper.firstElementChild as HTMLDivElement;\n const boxChildren = arrayFrom(box.children);\n\n return {\n box,\n content: boxChildren.find((node) => node.classList.contains(CONTENT_CLASS)),\n arrow: boxChildren.find(\n (node) =>\n node.classList.contains(ARROW_CLASS) ||\n node.classList.contains(SVG_ARROW_CLASS)\n ),\n backdrop: boxChildren.find((node) =>\n node.classList.contains(BACKDROP_CLASS)\n ),\n };\n}\n\nexport function render(\n instance: Instance\n): {\n popper: PopperElement;\n onUpdate?: (prevProps: Props, nextProps: Props) => void;\n} {\n const popper = div();\n\n const box = div();\n box.className = BOX_CLASS;\n box.setAttribute('data-state', 'hidden');\n box.setAttribute('tabindex', '-1');\n\n const content = div();\n content.className = CONTENT_CLASS;\n content.setAttribute('data-state', 'hidden');\n\n setContent(content, instance.props);\n\n popper.appendChild(box);\n box.appendChild(content);\n\n onUpdate(instance.props, instance.props);\n\n function onUpdate(prevProps: Props, nextProps: Props): void {\n const {box, content, arrow} = getChildren(popper);\n\n if (nextProps.theme) {\n box.setAttribute('data-theme', nextProps.theme);\n } else {\n box.removeAttribute('data-theme');\n }\n\n if (typeof nextProps.animation === 'string') {\n box.setAttribute('data-animation', nextProps.animation);\n } else {\n box.removeAttribute('data-animation');\n }\n\n if (nextProps.inertia) {\n box.setAttribute('data-inertia', '');\n } else {\n box.removeAttribute('data-inertia');\n }\n\n box.style.maxWidth =\n typeof nextProps.maxWidth === 'number'\n ? `${nextProps.maxWidth}px`\n : nextProps.maxWidth;\n\n if (nextProps.role) {\n box.setAttribute('role', nextProps.role);\n } else {\n box.removeAttribute('role');\n }\n\n if (\n prevProps.content !== nextProps.content ||\n prevProps.allowHTML !== nextProps.allowHTML\n ) {\n setContent(content, instance.props);\n }\n\n if (nextProps.arrow) {\n if (!arrow) {\n box.appendChild(createArrowElement(nextProps.arrow));\n } else if (prevProps.arrow !== nextProps.arrow) {\n box.removeChild(arrow);\n box.appendChild(createArrowElement(nextProps.arrow));\n }\n } else if (arrow) {\n box.removeChild(arrow!);\n }\n }\n\n return {\n popper,\n onUpdate,\n };\n}\n\n// Runtime check to identify if the render function is the default one; this\n// way we can apply default CSS transitions logic and it can be tree-shaken away\nrender.$$tippy = true;\n", "import {createPopper, StrictModifiers, Modifier} from '@popperjs/core';\nimport {currentInput} from './bindGlobalEventListeners';\nimport {isIE11} from './browser';\nimport {TIPPY_DEFAULT_APPEND_TO, TOUCH_OPTIONS} from './constants';\nimport {\n actualContains,\n div,\n getOwnerDocument,\n isCursorOutsideInteractiveBorder,\n isMouseEvent,\n setTransitionDuration,\n setVisibilityState,\n updateTransitionEndListener,\n} from './dom-utils';\nimport {defaultProps, evaluateProps, getExtendedPassedProps} from './props';\nimport {getChildren} from './template';\nimport {\n Content,\n Instance,\n LifecycleHooks,\n PopperElement,\n Props,\n ReferenceElement,\n} from './types';\nimport {ListenerObject, PopperTreeData, PopperChildren} from './types-internal';\nimport {\n arrayFrom,\n debounce,\n getValueAtIndexOrReturn,\n invokeWithArgsOrReturn,\n normalizeToArray,\n pushIfUnique,\n splitBySpaces,\n unique,\n removeUndefinedProps,\n} from './utils';\nimport {createMemoryLeakWarning, errorWhen, warnWhen} from './validation';\n\nlet idCounter = 1;\nlet mouseMoveListeners: ((event: MouseEvent) => void)[] = [];\n\n// Used by `hideAll()`\nexport let mountedInstances: Instance[] = [];\n\nexport default function createTippy(\n reference: ReferenceElement,\n passedProps: Partial<Props>\n): Instance {\n const props = evaluateProps(reference, {\n ...defaultProps,\n ...getExtendedPassedProps(removeUndefinedProps(passedProps)),\n });\n\n // ===========================================================================\n // 🔒 Private members\n // ===========================================================================\n let showTimeout: any;\n let hideTimeout: any;\n let scheduleHideAnimationFrame: number;\n let isVisibleFromClick = false;\n let didHideDueToDocumentMouseDown = false;\n let didTouchMove = false;\n let ignoreOnFirstUpdate = false;\n let lastTriggerEvent: Event | undefined;\n let currentTransitionEndListener: (event: TransitionEvent) => void;\n let onFirstUpdate: () => void;\n let listeners: ListenerObject[] = [];\n let debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);\n let currentTarget: Element;\n\n // ===========================================================================\n // 🔑 Public members\n // ===========================================================================\n const id = idCounter++;\n const popperInstance = null;\n const plugins = unique(props.plugins);\n\n const state = {\n // Is the instance currently enabled?\n isEnabled: true,\n // Is the tippy currently showing and not transitioning out?\n isVisible: false,\n // Has the instance been destroyed?\n isDestroyed: false,\n // Is the tippy currently mounted to the DOM?\n isMounted: false,\n // Has the tippy finished transitioning in?\n isShown: false,\n };\n\n const instance: Instance = {\n // properties\n id,\n reference,\n popper: div(),\n popperInstance,\n props,\n state,\n plugins,\n // methods\n clearDelayTimeouts,\n setProps,\n setContent,\n show,\n hide,\n hideWithInteractivity,\n enable,\n disable,\n unmount,\n destroy,\n };\n\n // TODO: Investigate why this early return causes a TDZ error in the tests —\n // it doesn't seem to happen in the browser\n /* istanbul ignore if */\n if (!props.render) {\n if (__DEV__) {\n errorWhen(true, 'render() function has not been supplied.');\n }\n\n return instance;\n }\n\n // ===========================================================================\n // Initial mutations\n // ===========================================================================\n const {popper, onUpdate} = props.render(instance);\n\n popper.setAttribute('data-__NAMESPACE_PREFIX__-root', '');\n popper.id = `__NAMESPACE_PREFIX__-${instance.id}`;\n\n instance.popper = popper;\n reference._tippy = instance;\n popper._tippy = instance;\n\n const pluginsHooks = plugins.map((plugin) => plugin.fn(instance));\n const hasAriaExpanded = reference.hasAttribute('aria-expanded');\n\n addListeners();\n handleAriaExpandedAttribute();\n handleStyles();\n\n invokeHook('onCreate', [instance]);\n\n if (props.showOnCreate) {\n scheduleShow();\n }\n\n // Prevent a tippy with a delay from hiding if the cursor left then returned\n // before it started hiding\n popper.addEventListener('mouseenter', () => {\n if (instance.props.interactive && instance.state.isVisible) {\n instance.clearDelayTimeouts();\n }\n });\n\n popper.addEventListener('mouseleave', () => {\n if (\n instance.props.interactive &&\n instance.props.trigger.indexOf('mouseenter') >= 0\n ) {\n getDocument().addEventListener('mousemove', debouncedOnMouseMove);\n }\n });\n\n return instance;\n\n // ===========================================================================\n // 🔒 Private methods\n // ===========================================================================\n function getNormalizedTouchSettings(): [string | boolean, number] {\n const {touch} = instance.props;\n return Array.isArray(touch) ? touch : [touch, 0];\n }\n\n function getIsCustomTouchBehavior(): boolean {\n return getNormalizedTouchSettings()[0] === 'hold';\n }\n\n function getIsDefaultRenderFn(): boolean {\n // @ts-ignore\n return !!instance.props.render?.$$tippy;\n }\n\n function getCurrentTarget(): Element {\n return currentTarget || reference;\n }\n\n function getDocument(): Document {\n const parent = getCurrentTarget().parentNode as Element;\n return parent ? getOwnerDocument(parent) : document;\n }\n\n function getDefaultTemplateChildren(): PopperChildren {\n return getChildren(popper);\n }\n\n function getDelay(isShow: boolean): number {\n // For touch or keyboard input, force `0` delay for UX reasons\n // Also if the instance is mounted but not visible (transitioning out),\n // ignore delay\n if (\n (instance.state.isMounted && !instance.state.isVisible) ||\n currentInput.isTouch ||\n (lastTriggerEvent && lastTriggerEvent.type === 'focus')\n ) {\n return 0;\n }\n\n return getValueAtIndexOrReturn(\n instance.props.delay,\n isShow ? 0 : 1,\n defaultProps.delay\n );\n }\n\n function handleStyles(fromHide = false): void {\n popper.style.pointerEvents =\n instance.props.interactive && !fromHide ? '' : 'none';\n popper.style.zIndex = `${instance.props.zIndex}`;\n }\n\n function invokeHook(\n hook: keyof LifecycleHooks,\n args: [Instance, any?],\n shouldInvokePropsHook = true\n ): void {\n pluginsHooks.forEach((pluginHooks) => {\n if (pluginHooks[hook]) {\n pluginHooks[hook]!(...args);\n }\n });\n\n if (shouldInvokePropsHook) {\n instance.props[hook](...args);\n }\n }\n\n function handleAriaContentAttribute(): void {\n const {aria} = instance.props;\n\n if (!aria.content) {\n return;\n }\n\n const attr = `aria-${aria.content}`;\n const id = popper.id;\n const nodes = normalizeToArray(instance.props.triggerTarget || reference);\n\n nodes.forEach((node) => {\n const currentValue = node.getAttribute(attr);\n\n if (instance.state.isVisible) {\n node.setAttribute(attr, currentValue ? `${currentValue} ${id}` : id);\n } else {\n const nextValue = currentValue && currentValue.replace(id, '').trim();\n\n if (nextValue) {\n node.setAttribute(attr, nextValue);\n } else {\n node.removeAttribute(attr);\n }\n }\n });\n }\n\n function handleAriaExpandedAttribute(): void {\n if (hasAriaExpanded || !instance.props.aria.expanded) {\n return;\n }\n\n const nodes = normalizeToArray(instance.props.triggerTarget || reference);\n\n nodes.forEach((node) => {\n if (instance.props.interactive) {\n node.setAttribute(\n 'aria-expanded',\n instance.state.isVisible && node === getCurrentTarget()\n ? 'true'\n : 'false'\n );\n } else {\n node.removeAttribute('aria-expanded');\n }\n });\n }\n\n function cleanupInteractiveMouseListeners(): void {\n getDocument().removeEventListener('mousemove', debouncedOnMouseMove);\n mouseMoveListeners = mouseMoveListeners.filter(\n (listener) => listener !== debouncedOnMouseMove\n );\n }\n\n function onDocumentPress(event: MouseEvent | TouchEvent): void {\n // Moved finger to scroll instead of an intentional tap outside\n if (currentInput.isTouch) {\n if (didTouchMove || event.type === 'mousedown') {\n return;\n }\n }\n\n const actualTarget =\n (event.composedPath && event.composedPath()[0]) || event.target;\n\n // Clicked on interactive popper\n if (\n instance.props.interactive &&\n actualContains(popper, actualTarget as Element)\n ) {\n return;\n }\n\n // Clicked on the event listeners target\n if (\n normalizeToArray(instance.props.triggerTarget || reference).some((el) =>\n actualContains(el, actualTarget as Element)\n )\n ) {\n if (currentInput.isTouch) {\n return;\n }\n\n if (\n instance.state.isVisible &&\n instance.props.trigger.indexOf('click') >= 0\n ) {\n return;\n }\n } else {\n invokeHook('onClickOutside', [instance, event]);\n }\n\n if (instance.props.hideOnClick === true) {\n instance.clearDelayTimeouts();\n instance.hide();\n\n // `mousedown` event is fired right before `focus` if pressing the\n // currentTarget. This lets a tippy with `focus` trigger know that it\n // should not show\n didHideDueToDocumentMouseDown = true;\n setTimeout(() => {\n didHideDueToDocumentMouseDown = false;\n });\n\n // The listener gets added in `scheduleShow()`, but this may be hiding it\n // before it shows, and hide()'s early bail-out behavior can prevent it\n // from being cleaned up\n if (!instance.state.isMounted) {\n removeDocumentPress();\n }\n }\n }\n\n function onTouchMove(): void {\n didTouchMove = true;\n }\n\n function onTouchStart(): void {\n didTouchMove = false;\n }\n\n function addDocumentPress(): void {\n const doc = getDocument();\n doc.addEventListener('mousedown', onDocumentPress, true);\n doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);\n doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);\n doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);\n }\n\n function removeDocumentPress(): void {\n const doc = getDocument();\n doc.removeEventListener('mousedown', onDocumentPress, true);\n doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);\n doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);\n doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);\n }\n\n function onTransitionedOut(duration: number, callback: () => void): void {\n onTransitionEnd(duration, () => {\n if (\n !instance.state.isVisible &&\n popper.parentNode &&\n popper.parentNode.contains(popper)\n ) {\n callback();\n }\n });\n }\n\n function onTransitionedIn(duration: number, callback: () => void): void {\n onTransitionEnd(duration, callback);\n }\n\n function onTransitionEnd(duration: number, callback: () => void): void {\n const box = getDefaultTemplateChildren().box;\n\n function listener(event: TransitionEvent): void {\n if (event.target === box) {\n updateTransitionEndListener(box, 'remove', listener);\n callback();\n }\n }\n\n // Make callback synchronous if duration is 0\n // `transitionend` won't fire otherwise\n if (duration === 0) {\n return callback();\n }\n\n updateTransitionEndListener(box, 'remove', currentTransitionEndListener);\n updateTransitionEndListener(box, 'add', listener);\n\n currentTransitionEndListener = listener;\n }\n\n function on(\n eventType: string,\n handler: EventListener,\n options: boolean | Record<string, unknown> = false\n ): void {\n const nodes = normalizeToArray(instance.props.triggerTarget || reference);\n nodes.forEach((node) => {\n node.addEventListener(eventType, handler, options);\n listeners.push({node, eventType, handler, options});\n });\n }\n\n function addListeners(): void {\n if (getIsCustomTouchBehavior()) {\n on('touchstart', onTrigger, {passive: true});\n on('touchend', onMouseLeave as EventListener, {passive: true});\n }\n\n splitBySpaces(instance.props.trigger).forEach((eventType) => {\n if (eventType === 'manual') {\n return;\n }\n\n on(eventType, onTrigger);\n\n switch (eventType) {\n case 'mouseenter':\n on('mouseleave', onMouseLeave as EventListener);\n break;\n case 'focus':\n on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut as EventListener);\n break;\n case 'focusin':\n on('focusout', onBlurOrFocusOut as EventListener);\n break;\n }\n });\n }\n\n function removeListeners(): void {\n listeners.forEach(({node, eventType, handler, options}: ListenerObject) => {\n node.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n\n function onTrigger(event: Event): void {\n let shouldScheduleClickHide = false;\n\n if (\n !instance.state.isEnabled ||\n isEventListenerStopped(event) ||\n didHideDueToDocumentMouseDown\n ) {\n return;\n }\n\n const wasFocused = lastTriggerEvent?.type === 'focus';\n\n lastTriggerEvent = event;\n currentTarget = event.currentTarget as Element;\n\n handleAriaExpandedAttribute();\n\n if (!instance.state.isVisible && isMouseEvent(event)) {\n // If scrolling, `mouseenter` events can be fired if the cursor lands\n // over a new target, but `mousemove` events don't get fired. This\n // causes interactive tooltips to get stuck open until the cursor is\n // moved\n mouseMoveListeners.forEach((listener) => listener(event));\n }\n\n // Toggle show/hide when clicking click-triggered tooltips\n if (\n event.type === 'click' &&\n (instance.props.trigger.indexOf('mouseenter') < 0 ||\n isVisibleFromClick) &&\n instance.props.hideOnClick !== false &&\n instance.state.isVisible\n ) {\n shouldScheduleClickHide = true;\n } else {\n scheduleShow(event);\n }\n\n if (event.type === 'click') {\n isVisibleFromClick = !shouldScheduleClickHide;\n }\n\n if (shouldScheduleClickHide && !wasFocused) {\n scheduleHide(event);\n }\n }\n\n function onMouseMove(event: MouseEvent): void {\n const target = event.target as Node;\n const isCursorOverReferenceOrPopper =\n getCurrentTarget().contains(target) || popper.contains(target);\n\n if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {\n return;\n }\n\n const popperTreeData = getNestedPopperTree()\n .concat(popper)\n .map((popper) => {\n const instance = popper._tippy!;\n const state = instance.popperInstance?.state;\n\n if (state) {\n return {\n popperRect: popper.getBoundingClientRect(),\n popperState: state,\n props,\n };\n }\n\n return null;\n })\n .filter(Boolean) as PopperTreeData[];\n\n if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {\n cleanupInteractiveMouseListeners();\n scheduleHide(event);\n }\n }\n\n function onMouseLeave(event: MouseEvent): void {\n const shouldBail =\n isEventListenerStopped(event) ||\n (instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick);\n\n if (shouldBail) {\n return;\n }\n\n if (instance.props.interactive) {\n instance.hideWithInteractivity(event);\n return;\n }\n\n scheduleHide(event);\n }\n\n function onBlurOrFocusOut(event: FocusEvent): void {\n if (\n instance.props.trigger.indexOf('focusin') < 0 &&\n event.target !== getCurrentTarget()\n ) {\n return;\n }\n\n // If focus was moved to within the popper\n if (\n instance.props.interactive &&\n event.relatedTarget &&\n popper.contains(event.relatedTarget as Element)\n ) {\n return;\n }\n\n scheduleHide(event);\n }\n\n function isEventListenerStopped(event: Event): boolean {\n return currentInput.isTouch\n ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0\n : false;\n }\n\n function createPopperInstance(): void {\n destroyPopperInstance();\n\n const {\n popperOptions,\n placement,\n offset,\n getReferenceClientRect,\n moveTransition,\n } = instance.props;\n\n const arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null;\n\n const computedReference = getReferenceClientRect\n ? {\n getBoundingClientRect: getReferenceClientRect,\n contextElement:\n getReferenceClientRect.contextElement || getCurrentTarget(),\n }\n : reference;\n\n const tippyModifier: Modifier<'$$tippy', Record<string, unknown>> = {\n name: '$$tippy',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn({state}) {\n if (getIsDefaultRenderFn()) {\n const {box} = getDefaultTemplateChildren();\n\n ['placement', 'reference-hidden', 'escaped'].forEach((attr) => {\n if (attr === 'placement') {\n box.setAttribute('data-placement', state.placement);\n } else {\n if (state.attributes.popper[`data-popper-${attr}`]) {\n box.setAttribute(`data-${attr}`, '');\n } else {\n box.removeAttribute(`data-${attr}`);\n }\n }\n });\n\n state.attributes.popper = {};\n }\n },\n };\n\n type TippyModifier = Modifier<'$$tippy', Record<string, unknown>>;\n type ExtendedModifiers = StrictModifiers | Partial<TippyModifier>;\n\n const modifiers: Array<ExtendedModifiers> = [\n {\n name: 'offset',\n options: {\n offset,\n },\n },\n {\n name: 'preventOverflow',\n options: {\n padding: {\n top: 2,\n bottom: 2,\n left: 5,\n right: 5,\n },\n },\n },\n {\n name: 'flip',\n options: {\n padding: 5,\n },\n },\n {\n name: 'computeStyles',\n options: {\n adaptive: !moveTransition,\n },\n },\n tippyModifier,\n ];\n\n if (getIsDefaultRenderFn() && arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrow,\n padding: 3,\n },\n });\n }\n\n modifiers.push(...(popperOptions?.modifiers || []));\n\n instance.popperInstance = createPopper<ExtendedModifiers>(\n computedReference,\n popper,\n {\n ...popperOptions,\n placement,\n onFirstUpdate,\n modifiers,\n }\n );\n }\n\n function destroyPopperInstance(): void {\n if (instance.popperInstance) {\n instance.popperInstance.destroy();\n instance.popperInstance = null;\n }\n }\n\n function mount(): void {\n const {appendTo} = instance.props;\n\n let parentNode: any;\n\n // By default, we'll append the popper to the triggerTargets's parentNode so\n // it's directly after the reference element so the elements inside the\n // tippy can be tabbed to\n // If there are clipping issues, the user can specify a different appendTo\n // and ensure focus management is handled correctly manually\n const node = getCurrentTarget();\n\n if (\n (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO) ||\n appendTo === 'parent'\n ) {\n parentNode = node.parentNode;\n } else {\n parentNode = invokeWithArgsOrReturn(appendTo, [node]);\n }\n\n // The popper element needs to exist on the DOM before its position can be\n // updated as Popper needs to read its dimensions\n if (!parentNode.contains(popper)) {\n parentNode.appendChild(popper);\n }\n\n instance.state.isMounted = true;\n\n createPopperInstance();\n\n /* istanbul ignore else */\n if (__DEV__) {\n // Accessibility check\n warnWhen(\n instance.props.interactive &&\n appendTo === defaultProps.appendTo &&\n node.nextElementSibling !== popper,\n [\n 'Interactive tippy element may not be accessible via keyboard',\n 'navigation because it is not directly after the reference element',\n 'in the DOM source order.',\n '\\n\\n',\n 'Using a wrapper <div> or <span> tag around the reference element',\n 'solves this by creating a new parentNode context.',\n '\\n\\n',\n 'Specifying `appendTo: document.body` silences this warning, but it',\n 'assumes you are using a focus management solution to handle',\n 'keyboard navigation.',\n '\\n\\n',\n 'See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity',\n ].join(' ')\n );\n }\n }\n\n function getNestedPopperTree(): PopperElement[] {\n return arrayFrom(\n popper.querySelectorAll('[data-__NAMESPACE_PREFIX__-root]')\n );\n }\n\n function scheduleShow(event?: Event): void {\n instance.clearDelayTimeouts();\n\n if (event) {\n invokeHook('onTrigger', [instance, event]);\n }\n\n addDocumentPress();\n\n let delay = getDelay(true);\n const [touchValue, touchDelay] = getNormalizedTouchSettings();\n\n if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {\n delay = touchDelay;\n }\n\n if (delay) {\n showTimeout = setTimeout(() => {\n instance.show();\n }, delay);\n } else {\n instance.show();\n }\n }\n\n function scheduleHide(event: Event): void {\n instance.clearDelayTimeouts();\n\n invokeHook('onUntrigger', [instance, event]);\n\n if (!instance.state.isVisible) {\n removeDocumentPress();\n\n return;\n }\n\n // For interactive tippies, scheduleHide is added to a document.body handler\n // from onMouseLeave so must intercept scheduled hides from mousemove/leave\n // events when trigger contains mouseenter and click, and the tip is\n // currently shown as a result of a click.\n if (\n instance.props.trigger.indexOf('mouseenter') >= 0 &&\n instance.props.trigger.indexOf('click') >= 0 &&\n ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 &&\n isVisibleFromClick\n ) {\n return;\n }\n\n const delay = getDelay(false);\n\n if (delay) {\n hideTimeout = setTimeout(() => {\n if (instance.state.isVisible) {\n instance.hide();\n }\n }, delay);\n } else {\n // Fixes a `transitionend` problem when it fires 1 frame too\n // late sometimes, we don't want hide() to be called.\n scheduleHideAnimationFrame = requestAnimationFrame(() => {\n instance.hide();\n });\n }\n }\n\n // ===========================================================================\n // 🔑 Public methods\n // ===========================================================================\n function enable(): void {\n instance.state.isEnabled = true;\n }\n\n function disable(): void {\n // Disabling the instance should also hide it\n // https://github.com/atomiks/tippy.js-react/issues/106\n instance.hide();\n instance.state.isEnabled = false;\n }\n\n function clearDelayTimeouts(): void {\n clearTimeout(showTimeout);\n clearTimeout(hideTimeout);\n cancelAnimationFrame(scheduleHideAnimationFrame);\n }\n\n function setProps(partialProps: Partial<Props>): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));\n }\n\n if (instance.state.isDestroyed) {\n return;\n }\n\n invokeHook('onBeforeUpdate', [instance, partialProps]);\n\n removeListeners();\n\n const prevProps = instance.props;\n const nextProps = evaluateProps(reference, {\n ...prevProps,\n ...removeUndefinedProps(partialProps),\n ignoreAttributes: true,\n });\n\n instance.props = nextProps;\n\n addListeners();\n\n if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {\n cleanupInteractiveMouseListeners();\n debouncedOnMouseMove = debounce(\n onMouseMove,\n nextProps.interactiveDebounce\n );\n }\n\n // Ensure stale aria-expanded attributes are removed\n if (prevProps.triggerTarget && !nextProps.triggerTarget) {\n normalizeToArray(prevProps.triggerTarget).forEach((node) => {\n node.removeAttribute('aria-expanded');\n });\n } else if (nextProps.triggerTarget) {\n reference.removeAttribute('aria-expanded');\n }\n\n handleAriaExpandedAttribute();\n handleStyles();\n\n if (onUpdate) {\n onUpdate(prevProps, nextProps);\n }\n\n if (instance.popperInstance) {\n createPopperInstance();\n\n // Fixes an issue with nested tippies if they are all getting re-rendered,\n // and the nested ones get re-rendered first.\n // https://github.com/atomiks/tippyjs-react/issues/177\n // TODO: find a cleaner / more efficient solution(!)\n getNestedPopperTree().forEach((nestedPopper) => {\n // React (and other UI libs likely) requires a rAF wrapper as it flushes\n // its work in one\n requestAnimationFrame(nestedPopper._tippy!.popperInstance!.forceUpdate);\n });\n }\n\n invokeHook('onAfterUpdate', [instance, partialProps]);\n }\n\n function setContent(content: Content): void {\n instance.setProps({content});\n }\n\n function show(): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));\n }\n\n // Early bail-out\n const isAlreadyVisible = instance.state.isVisible;\n const isDestroyed = instance.state.isDestroyed;\n const isDisabled = !instance.state.isEnabled;\n const isTouchAndTouchDisabled =\n currentInput.isTouch && !instance.props.touch;\n const duration = getValueAtIndexOrReturn(\n instance.props.duration,\n 0,\n defaultProps.duration\n );\n\n if (\n isAlreadyVisible ||\n isDestroyed ||\n isDisabled ||\n isTouchAndTouchDisabled\n ) {\n return;\n }\n\n // Normalize `disabled` behavior across browsers.\n // Firefox allows events on disabled elements, but Chrome doesn't.\n // Using a wrapper element (i.e. <span>) is recommended.\n if (getCurrentTarget().hasAttribute('disabled')) {\n return;\n }\n\n invokeHook('onShow', [instance], false);\n if (instance.props.onShow(instance) === false) {\n return;\n }\n\n instance.state.isVisible = true;\n\n if (getIsDefaultRenderFn()) {\n popper.style.visibility = 'visible';\n }\n\n handleStyles();\n addDocumentPress();\n\n if (!instance.state.isMounted) {\n popper.style.transition = 'none';\n }\n\n // If flipping to the opposite side after hiding at least once, the\n // animation will use the wrong placement without resetting the duration\n if (getIsDefaultRenderFn()) {\n const {box, content} = getDefaultTemplateChildren();\n setTransitionDuration([box, content], 0);\n }\n\n onFirstUpdate = (): void => {\n if (!instance.state.isVisible || ignoreOnFirstUpdate) {\n return;\n }\n\n ignoreOnFirstUpdate = true;\n\n // reflow\n void popper.offsetHeight;\n\n popper.style.transition = instance.props.moveTransition;\n\n if (getIsDefaultRenderFn() && instance.props.animation) {\n const {box, content} = getDefaultTemplateChildren();\n setTransitionDuration([box, content], duration);\n setVisibilityState([box, content], 'visible');\n }\n\n handleAriaContentAttribute();\n handleAriaExpandedAttribute();\n\n pushIfUnique(mountedInstances, instance);\n\n // certain modifiers (e.g. `maxSize`) require a second update after the\n // popper has been positioned for the first time\n instance.popperInstance?.forceUpdate();\n\n invokeHook('onMount', [instance]);\n\n if (instance.props.animation && getIsDefaultRenderFn()) {\n onTransitionedIn(duration, () => {\n instance.state.isShown = true;\n invokeHook('onShown', [instance]);\n });\n }\n };\n\n mount();\n }\n\n function hide(): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));\n }\n\n // Early bail-out\n const isAlreadyHidden = !instance.state.isVisible;\n const isDestroyed = instance.state.isDestroyed;\n const isDisabled = !instance.state.isEnabled;\n const duration = getValueAtIndexOrReturn(\n instance.props.duration,\n 1,\n defaultProps.duration\n );\n\n if (isAlreadyHidden || isDestroyed || isDisabled) {\n return;\n }\n\n invokeHook('onHide', [instance], false);\n if (instance.props.onHide(instance) === false) {\n return;\n }\n\n instance.state.isVisible = false;\n instance.state.isShown = false;\n ignoreOnFirstUpdate = false;\n isVisibleFromClick = false;\n\n if (getIsDefaultRenderFn()) {\n popper.style.visibility = 'hidden';\n }\n\n cleanupInteractiveMouseListeners();\n removeDocumentPress();\n handleStyles(true);\n\n if (getIsDefaultRenderFn()) {\n const {box, content} = getDefaultTemplateChildren();\n\n if (instance.props.animation) {\n setTransitionDuration([box, content], duration);\n setVisibilityState([box, content], 'hidden');\n }\n }\n\n handleAriaContentAttribute();\n handleAriaExpandedAttribute();\n\n if (instance.props.animation) {\n if (getIsDefaultRenderFn()) {\n onTransitionedOut(duration, instance.unmount);\n }\n } else {\n instance.unmount();\n }\n }\n\n function hideWithInteractivity(event: MouseEvent): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(\n instance.state.isDestroyed,\n createMemoryLeakWarning('hideWithInteractivity')\n );\n }\n\n getDocument().addEventListener('mousemove', debouncedOnMouseMove);\n pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);\n debouncedOnMouseMove(event);\n }\n\n function unmount(): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));\n }\n\n if (instance.state.isVisible) {\n instance.hide();\n }\n\n if (!instance.state.isMounted) {\n return;\n }\n\n destroyPopperInstance();\n\n // If a popper is not interactive, it will be appended outside the popper\n // tree by default. This seems mainly for interactive tippies, but we should\n // find a workaround if possible\n getNestedPopperTree().forEach((nestedPopper) => {\n nestedPopper._tippy!.unmount();\n });\n\n if (popper.parentNode) {\n popper.parentNode.removeChild(popper);\n }\n\n mountedInstances = mountedInstances.filter((i) => i !== instance);\n\n instance.state.isMounted = false;\n invokeHook('onHidden', [instance]);\n }\n\n function destroy(): void {\n /* istanbul ignore else */\n if (__DEV__) {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));\n }\n\n if (instance.state.isDestroyed) {\n return;\n }\n\n instance.clearDelayTimeouts();\n instance.unmount();\n\n removeListeners();\n\n delete reference._tippy;\n\n instance.state.isDestroyed = true;\n\n invokeHook('onDestroy', [instance]);\n }\n}\n", "import bindGlobalEventListeners, {\n currentInput,\n} from './bindGlobalEventListeners';\nimport createTippy, {mountedInstances} from './createTippy';\nimport {getArrayOfElements, isElement, isReferenceElement} from './dom-utils';\nimport {defaultProps, setDefaultProps, validateProps} from './props';\nimport {HideAll, HideAllOptions, Instance, Props, Targets} from './types';\nimport {validateTargets, warnWhen} from './validation';\n\nfunction tippy(\n targets: Targets,\n optionalProps: Partial<Props> = {}\n): Instance | Instance[] {\n const plugins = defaultProps.plugins.concat(optionalProps.plugins || []);\n\n /* istanbul ignore else */\n if (__DEV__) {\n validateTargets(targets);\n validateProps(optionalProps, plugins);\n }\n\n bindGlobalEventListeners();\n\n const passedProps: Partial<Props> = {...optionalProps, plugins};\n\n const elements = getArrayOfElements(targets);\n\n /* istanbul ignore else */\n if (__DEV__) {\n const isSingleContentElement = isElement(passedProps.content);\n const isMoreThanOneReferenceElement = elements.length > 1;\n warnWhen(\n isSingleContentElement && isMoreThanOneReferenceElement,\n [\n 'tippy() was passed an Element as the `content` prop, but more than',\n 'one tippy instance was created by this invocation. This means the',\n 'content element will only be appended to the last tippy instance.',\n '\\n\\n',\n 'Instead, pass the .innerHTML of the element, or use a function that',\n 'returns a cloned version of the element instead.',\n '\\n\\n',\n '1) content: element.innerHTML\\n',\n '2) content: () => element.cloneNode(true)',\n ].join(' ')\n );\n }\n\n const instances = elements.reduce<Instance[]>(\n (acc, reference): Instance[] => {\n const instance = reference && createTippy(reference, passedProps);\n\n if (instance) {\n acc.push(instance);\n }\n\n return acc;\n },\n []\n );\n\n return isElement(targets) ? instances[0] : instances;\n}\n\ntippy.defaultProps = defaultProps;\ntippy.setDefaultProps = setDefaultProps;\ntippy.currentInput = currentInput;\n\nexport default tippy;\n\nexport const hideAll: HideAll = ({\n exclude: excludedReferenceOrInstance,\n duration,\n}: HideAllOptions = {}) => {\n mountedInstances.forEach((instance) => {\n let isExcluded = false;\n\n if (excludedReferenceOrInstance) {\n isExcluded = isReferenceElement(excludedReferenceOrInstance)\n ? instance.reference === excludedReferenceOrInstance\n : instance.popper === (excludedReferenceOrInstance as Instance).popper;\n }\n\n if (!isExcluded) {\n const originalDuration = instance.props.duration;\n\n instance.setProps({duration});\n instance.hide();\n\n if (!instance.state.isDestroyed) {\n instance.setProps({duration: originalDuration});\n }\n }\n });\n};\n", "import tippy from '..';\nimport {div} from '../dom-utils';\nimport {\n CreateSingleton,\n Plugin,\n CreateSingletonProps,\n ReferenceElement,\n CreateSingletonInstance,\n Instance,\n Props,\n} from '../types';\nimport {normalizeToArray, removeProperties} from '../utils';\nimport {errorWhen} from '../validation';\nimport {applyStyles, Modifier} from '@popperjs/core';\n\n// The default `applyStyles` modifier has a cleanup function that gets called\n// every time the popper is destroyed (i.e. a new target), removing the styles\n// and causing transitions to break for singletons when the console is open, but\n// most notably for non-transform styles being used, `gpuAcceleration: false`.\nconst applyStylesModifier: Modifier<'applyStyles', Record<string, unknown>> = {\n ...applyStyles,\n effect({state}) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0',\n },\n arrow: {\n position: 'absolute',\n },\n reference: {},\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n // intentionally return no cleanup function\n // return () => { ... }\n },\n};\n\nconst createSingleton: CreateSingleton = (\n tippyInstances,\n optionalProps = {}\n) => {\n /* istanbul ignore else */\n if (__DEV__) {\n errorWhen(\n !Array.isArray(tippyInstances),\n [\n 'The first argument passed to createSingleton() must be an array of',\n 'tippy instances. The passed value was',\n String(tippyInstances),\n ].join(' ')\n );\n }\n\n let individualInstances = tippyInstances;\n let references: Array<ReferenceElement> = [];\n let triggerTargets: Array<Element> = [];\n let currentTarget: Element | null;\n let overrides = optionalProps.overrides;\n let interceptSetPropsCleanups: Array<() => void> = [];\n let shownOnCreate = false;\n\n function setTriggerTargets(): void {\n triggerTargets = individualInstances\n .map((instance) =>\n normalizeToArray(instance.props.triggerTarget || instance.reference)\n )\n .reduce((acc, item) => acc.concat(item), []);\n }\n\n function setReferences(): void {\n references = individualInstances.map((instance) => instance.reference);\n }\n\n function enableInstances(isEnabled: boolean): void {\n individualInstances.forEach((instance) => {\n if (isEnabled) {\n instance.enable();\n } else {\n instance.disable();\n }\n });\n }\n\n function interceptSetProps(singleton: Instance): Array<() => void> {\n return individualInstances.map((instance) => {\n const originalSetProps = instance.setProps;\n\n instance.setProps = (props): void => {\n originalSetProps(props);\n\n if (instance.reference === currentTarget) {\n singleton.setProps(props);\n }\n };\n\n return (): void => {\n instance.setProps = originalSetProps;\n };\n });\n }\n\n // have to pass singleton, as it maybe undefined on first call\n function prepareInstance(\n singleton: Instance,\n target: ReferenceElement\n ): void {\n const index = triggerTargets.indexOf(target);\n\n // bail-out\n if (target === currentTarget) {\n return;\n }\n\n currentTarget = target;\n\n const overrideProps: Partial<Props> = (overrides || [])\n .concat('content')\n .reduce((acc, prop) => {\n (acc as any)[prop] = individualInstances[index].props[prop];\n return acc;\n }, {});\n\n singleton.setProps({\n ...overrideProps,\n getReferenceClientRect:\n typeof overrideProps.getReferenceClientRect === 'function'\n ? overrideProps.getReferenceClientRect\n : (): ClientRect => references[index]?.getBoundingClientRect(),\n });\n }\n\n enableInstances(false);\n setReferences();\n setTriggerTargets();\n\n const plugin: Plugin = {\n fn() {\n return {\n onDestroy(): void {\n enableInstances(true);\n },\n onHidden(): void {\n currentTarget = null;\n },\n onClickOutside(instance): void {\n if (instance.props.showOnCreate && !shownOnCreate) {\n shownOnCreate = true;\n currentTarget = null;\n }\n },\n onShow(instance): void {\n if (instance.props.showOnCreate && !shownOnCreate) {\n shownOnCreate = true;\n prepareInstance(instance, references[0]);\n }\n },\n onTrigger(instance, event): void {\n prepareInstance(instance, event.currentTarget as Element);\n },\n };\n },\n };\n\n const singleton = tippy(div(), {\n ...removeProperties(optionalProps, ['overrides']),\n plugins: [plugin, ...(optionalProps.plugins || [])],\n triggerTarget: triggerTargets,\n popperOptions: {\n ...optionalProps.popperOptions,\n modifiers: [\n ...(optionalProps.popperOptions?.modifiers || []),\n applyStylesModifier,\n ],\n },\n }) as CreateSingletonInstance<CreateSingletonProps>;\n\n const originalShow = singleton.show;\n\n singleton.show = (target?: ReferenceElement | Instance | number): void => {\n originalShow();\n\n // first time, showOnCreate or programmatic call with no params\n // default to showing first instance\n if (!currentTarget && target == null) {\n return prepareInstance(singleton, references[0]);\n }\n\n // triggered from event (do nothing as prepareInstance already called by onTrigger)\n // programmatic call with no params when already visible (do nothing again)\n if (currentTarget && target == null) {\n return;\n }\n\n // target is index of instance\n if (typeof target === 'number') {\n return (\n references[target] && prepareInstance(singleton, references[target])\n );\n }\n\n // target is a child tippy instance\n if (individualInstances.indexOf(target as Instance) >= 0) {\n const ref = (target as Instance).reference;\n return prepareInstance(singleton, ref);\n }\n\n // target is a ReferenceElement\n if (references.indexOf(target as ReferenceElement) >= 0) {\n return prepareInstance(singleton, target as ReferenceElement);\n }\n };\n\n singleton.showNext = (): void => {\n const first = references[0];\n if (!currentTarget) {\n return singleton.show(0);\n }\n const index = references.indexOf(currentTarget);\n singleton.show(references[index + 1] || first);\n };\n\n singleton.showPrevious = (): void => {\n const last = references[references.length - 1];\n if (!currentTarget) {\n return singleton.show(last);\n }\n const index = references.indexOf(currentTarget);\n const target = references[index - 1] || last;\n singleton.show(target);\n };\n\n const originalSetProps = singleton.setProps;\n\n singleton.setProps = (props): void => {\n overrides = props.overrides || overrides;\n originalSetProps(props);\n };\n\n singleton.setInstances = (nextInstances): void => {\n enableInstances(true);\n interceptSetPropsCleanups.forEach((fn) => fn());\n\n individualInstances = nextInstances;\n\n enableInstances(false);\n setReferences();\n setTriggerTargets();\n interceptSetPropsCleanups = interceptSetProps(singleton);\n\n singleton.setProps({triggerTarget: triggerTargets});\n };\n\n interceptSetPropsCleanups = interceptSetProps(singleton);\n\n return singleton;\n};\n\nexport default createSingleton;\n", "import tippy from '..';\nimport {TOUCH_OPTIONS} from '../constants';\nimport {defaultProps} from '../props';\nimport {Instance, Props, Targets} from '../types';\nimport {ListenerObject} from '../types-internal';\nimport {normalizeToArray, removeProperties} from '../utils';\nimport {errorWhen} from '../validation';\n\nconst BUBBLING_EVENTS_MAP = {\n mouseover: 'mouseenter',\n focusin: 'focus',\n click: 'click',\n};\n\n/**\n * Creates a delegate instance that controls the creation of tippy instances\n * for child elements (`target` CSS selector).\n */\nfunction delegate(\n targets: Targets,\n props: Partial<Props> & {target: string}\n): Instance | Instance[] {\n /* istanbul ignore else */\n if (__DEV__) {\n errorWhen(\n !(props && props.target),\n [\n 'You must specity a `target` prop indicating a CSS selector string matching',\n 'the target elements that should receive a tippy.',\n ].join(' ')\n );\n }\n\n let listeners: ListenerObject[] = [];\n let childTippyInstances: Instance[] = [];\n let disabled = false;\n\n const {target} = props;\n\n const nativeProps = removeProperties(props, ['target']);\n const parentProps = {...nativeProps, trigger: 'manual', touch: false};\n const childProps = {\n touch: defaultProps.touch,\n ...nativeProps,\n showOnCreate: true,\n };\n\n const returnValue = tippy(targets, parentProps);\n const normalizedReturnValue = normalizeToArray(returnValue);\n\n function onTrigger(event: Event): void {\n if (!event.target || disabled) {\n return;\n }\n\n const targetNode = (event.target as Element).closest(target);\n\n if (!targetNode) {\n return;\n }\n\n // Get relevant trigger with fallbacks:\n // 1. Check `data-tippy-trigger` attribute on target node\n // 2. Fallback to `trigger` passed to `delegate()`\n // 3. Fallback to `defaultProps.trigger`\n const trigger =\n targetNode.getAttribute('data-tippy-trigger') ||\n props.trigger ||\n defaultProps.trigger;\n\n // @ts-ignore\n if (targetNode._tippy) {\n return;\n }\n\n if (event.type === 'touchstart' && typeof childProps.touch === 'boolean') {\n return;\n }\n\n if (\n event.type !== 'touchstart' &&\n trigger.indexOf((BUBBLING_EVENTS_MAP as any)[event.type]) < 0\n ) {\n return;\n }\n\n const instance = tippy(targetNode, childProps);\n\n if (instance) {\n childTippyInstances = childTippyInstances.concat(instance);\n }\n }\n\n function on(\n node: Element,\n eventType: string,\n handler: EventListener,\n options: boolean | Record<string, unknown> = false\n ): void {\n node.addEventListener(eventType, handler, options);\n listeners.push({node, eventType, handler, options});\n }\n\n function addEventListeners(instance: Instance): void {\n const {reference} = instance;\n\n on(reference, 'touchstart', onTrigger, TOUCH_OPTIONS);\n on(reference, 'mouseover', onTrigger);\n on(reference, 'focusin', onTrigger);\n on(reference, 'click', onTrigger);\n }\n\n function removeEventListeners(): void {\n listeners.forEach(({node, eventType, handler, options}: ListenerObject) => {\n node.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n\n function applyMutations(instance: Instance): void {\n const originalDestroy = instance.destroy;\n const originalEnable = instance.enable;\n const originalDisable = instance.disable;\n\n instance.destroy = (shouldDestroyChildInstances = true): void => {\n if (shouldDestroyChildInstances) {\n childTippyInstances.forEach((instance) => {\n instance.destroy();\n });\n }\n\n childTippyInstances = [];\n\n removeEventListeners();\n originalDestroy();\n };\n\n instance.enable = (): void => {\n originalEnable();\n childTippyInstances.forEach((instance) => instance.enable());\n disabled = false;\n };\n\n instance.disable = (): void => {\n originalDisable();\n childTippyInstances.forEach((instance) => instance.disable());\n disabled = true;\n };\n\n addEventListeners(instance);\n }\n\n normalizedReturnValue.forEach(applyMutations);\n\n return returnValue;\n}\n\nexport default delegate;\n", "import {BACKDROP_CLASS} from '../constants';\nimport {div, setVisibilityState} from '../dom-utils';\nimport {getChildren} from '../template';\nimport {AnimateFill} from '../types';\nimport {errorWhen} from '../validation';\n\nconst animateFill: AnimateFill = {\n name: 'animateFill',\n defaultValue: false,\n fn(instance) {\n // @ts-ignore\n if (!instance.props.render?.$$tippy) {\n if (__DEV__) {\n errorWhen(\n instance.props.animateFill,\n 'The `animateFill` plugin requires the default render function.'\n );\n }\n\n return {};\n }\n\n const {box, content} = getChildren(instance.popper);\n\n const backdrop = instance.props.animateFill\n ? createBackdropElement()\n : null;\n\n return {\n onCreate(): void {\n if (backdrop) {\n box.insertBefore(backdrop, box.firstElementChild!);\n box.setAttribute('data-animatefill', '');\n box.style.overflow = 'hidden';\n\n instance.setProps({arrow: false, animation: 'shift-away'});\n }\n },\n onMount(): void {\n if (backdrop) {\n const {transitionDuration} = box.style;\n const duration = Number(transitionDuration.replace('ms', ''));\n\n // The content should fade in after the backdrop has mostly filled the\n // tooltip element. `clip-path` is the other alternative but is not\n // well-supported and is buggy on some devices.\n content.style.transitionDelay = `${Math.round(duration / 10)}ms`;\n\n backdrop.style.transitionDuration = transitionDuration;\n setVisibilityState([backdrop], 'visible');\n }\n },\n onShow(): void {\n if (backdrop) {\n backdrop.style.transitionDuration = '0ms';\n }\n },\n onHide(): void {\n if (backdrop) {\n setVisibilityState([backdrop], 'hidden');\n }\n },\n };\n },\n};\n\nexport default animateFill;\n\nfunction createBackdropElement(): HTMLDivElement {\n const backdrop = div();\n backdrop.className = BACKDROP_CLASS;\n setVisibilityState([backdrop], 'hidden');\n return backdrop;\n}\n", "import {getOwnerDocument, isMouseEvent} from '../dom-utils';\nimport {FollowCursor, Instance} from '../types';\n\nlet mouseCoords = {clientX: 0, clientY: 0};\nlet activeInstances: Array<{instance: Instance; doc: Document}> = [];\n\nfunction storeMouseCoords({clientX, clientY}: MouseEvent): void {\n mouseCoords = {clientX, clientY};\n}\n\nfunction addMouseCoordsListener(doc: Document): void {\n doc.addEventListener('mousemove', storeMouseCoords);\n}\n\nfunction removeMouseCoordsListener(doc: Document): void {\n doc.removeEventListener('mousemove', storeMouseCoords);\n}\n\nconst followCursor: FollowCursor = {\n name: 'followCursor',\n defaultValue: false,\n fn(instance) {\n const reference = instance.reference;\n const doc = getOwnerDocument(instance.props.triggerTarget || reference);\n\n let isInternalUpdate = false;\n let wasFocusEvent = false;\n let isUnmounted = true;\n let prevProps = instance.props;\n\n function getIsInitialBehavior(): boolean {\n return (\n instance.props.followCursor === 'initial' && instance.state.isVisible\n );\n }\n\n function addListener(): void {\n doc.addEventListener('mousemove', onMouseMove);\n }\n\n function removeListener(): void {\n doc.removeEventListener('mousemove', onMouseMove);\n }\n\n function unsetGetReferenceClientRect(): void {\n isInternalUpdate = true;\n instance.setProps({getReferenceClientRect: null});\n isInternalUpdate = false;\n }\n\n function onMouseMove(event: MouseEvent): void {\n // If the instance is interactive, avoid updating the position unless it's\n // over the reference element\n const isCursorOverReference = event.target\n ? reference.contains(event.target as Node)\n : true;\n const {followCursor} = instance.props;\n const {clientX, clientY} = event;\n\n const rect = reference.getBoundingClientRect();\n const relativeX = clientX - rect.left;\n const relativeY = clientY - rect.top;\n\n if (isCursorOverReference || !instance.props.interactive) {\n instance.setProps({\n // @ts-ignore - unneeded DOMRect properties\n getReferenceClientRect() {\n const rect = reference.getBoundingClientRect();\n\n let x = clientX;\n let y = clientY;\n\n if (followCursor === 'initial') {\n x = rect.left + relativeX;\n y = rect.top + relativeY;\n }\n\n const top = followCursor === 'horizontal' ? rect.top : y;\n const right = followCursor === 'vertical' ? rect.right : x;\n const bottom = followCursor === 'horizontal' ? rect.bottom : y;\n const left = followCursor === 'vertical' ? rect.left : x;\n\n return {\n width: right - left,\n height: bottom - top,\n top,\n right,\n bottom,\n left,\n };\n },\n });\n }\n }\n\n function create(): void {\n if (instance.props.followCursor) {\n activeInstances.push({instance, doc});\n addMouseCoordsListener(doc);\n }\n }\n\n function destroy(): void {\n activeInstances = activeInstances.filter(\n (data) => data.instance !== instance\n );\n\n if (activeInstances.filter((data) => data.doc === doc).length === 0) {\n removeMouseCoordsListener(doc);\n }\n }\n\n return {\n onCreate: create,\n onDestroy: destroy,\n onBeforeUpdate(): void {\n prevProps = instance.props;\n },\n onAfterUpdate(_, {followCursor}): void {\n if (isInternalUpdate) {\n return;\n }\n\n if (\n followCursor !== undefined &&\n prevProps.followCursor !== followCursor\n ) {\n destroy();\n\n if (followCursor) {\n create();\n\n if (\n instance.state.isMounted &&\n !wasFocusEvent &&\n !getIsInitialBehavior()\n ) {\n addListener();\n }\n } else {\n removeListener();\n unsetGetReferenceClientRect();\n }\n }\n },\n onMount(): void {\n if (instance.props.followCursor && !wasFocusEvent) {\n if (isUnmounted) {\n onMouseMove(mouseCoords as MouseEvent);\n isUnmounted = false;\n }\n\n if (!getIsInitialBehavior()) {\n addListener();\n }\n }\n },\n onTrigger(_, event): void {\n if (isMouseEvent(event)) {\n mouseCoords = {clientX: event.clientX, clientY: event.clientY};\n }\n wasFocusEvent = event.type === 'focus';\n },\n onHidden(): void {\n if (instance.props.followCursor) {\n unsetGetReferenceClientRect();\n removeListener();\n isUnmounted = true;\n }\n },\n };\n },\n};\n\nexport default followCursor;\n", "import {Modifier, Placement} from '@popperjs/core';\nimport {isMouseEvent} from '../dom-utils';\nimport {BasePlacement, InlinePositioning, Props} from '../types';\nimport {arrayFrom, getBasePlacement} from '../utils';\n\nfunction getProps(props: Props, modifier: Modifier<any, any>): Partial<Props> {\n return {\n popperOptions: {\n ...props.popperOptions,\n modifiers: [\n ...(props.popperOptions?.modifiers || []).filter(\n ({name}) => name !== modifier.name\n ),\n modifier,\n ],\n },\n };\n}\n\nconst inlinePositioning: InlinePositioning = {\n name: 'inlinePositioning',\n defaultValue: false,\n fn(instance) {\n const {reference} = instance;\n\n function isEnabled(): boolean {\n return !!instance.props.inlinePositioning;\n }\n\n let placement: Placement;\n let cursorRectIndex = -1;\n let isInternalUpdate = false;\n let triedPlacements: Array<string> = [];\n\n const modifier: Modifier<\n 'tippyInlinePositioning',\n Record<string, unknown>\n > = {\n name: 'tippyInlinePositioning',\n enabled: true,\n phase: 'afterWrite',\n fn({state}) {\n if (isEnabled()) {\n if (triedPlacements.indexOf(state.placement) !== -1) {\n triedPlacements = [];\n }\n\n if (\n placement !== state.placement &&\n triedPlacements.indexOf(state.placement) === -1\n ) {\n triedPlacements.push(state.placement);\n instance.setProps({\n // @ts-ignore - unneeded DOMRect properties\n getReferenceClientRect: () =>\n getReferenceClientRect(state.placement),\n });\n }\n\n placement = state.placement;\n }\n },\n };\n\n function getReferenceClientRect(placement: Placement): Partial<DOMRect> {\n return getInlineBoundingClientRect(\n getBasePlacement(placement),\n reference.getBoundingClientRect(),\n arrayFrom(reference.getClientRects()),\n cursorRectIndex\n );\n }\n\n function setInternalProps(partialProps: Partial<Props>): void {\n isInternalUpdate = true;\n instance.setProps(partialProps);\n isInternalUpdate = false;\n }\n\n function addModifier(): void {\n if (!isInternalUpdate) {\n setInternalProps(getProps(instance.props, modifier));\n }\n }\n\n return {\n onCreate: addModifier,\n onAfterUpdate: addModifier,\n onTrigger(_, event): void {\n if (isMouseEvent(event)) {\n const rects = arrayFrom(instance.reference.getClientRects());\n const cursorRect = rects.find(\n (rect) =>\n rect.left - 2 <= event.clientX &&\n rect.right + 2 >= event.clientX &&\n rect.top - 2 <= event.clientY &&\n rect.bottom + 2 >= event.clientY\n );\n const index = rects.indexOf(cursorRect);\n cursorRectIndex = index > -1 ? index : cursorRectIndex;\n }\n },\n onHidden(): void {\n cursorRectIndex = -1;\n },\n };\n },\n};\n\nexport default inlinePositioning;\n\nexport function getInlineBoundingClientRect(\n currentBasePlacement: BasePlacement | null,\n boundingRect: DOMRect,\n clientRects: DOMRect[],\n cursorRectIndex: number\n): {\n top: number;\n bottom: number;\n left: number;\n right: number;\n width: number;\n height: number;\n} {\n // Not an inline element, or placement is not yet known\n if (clientRects.length < 2 || currentBasePlacement === null) {\n return boundingRect;\n }\n\n // There are two rects and they are disjoined\n if (\n clientRects.length === 2 &&\n cursorRectIndex >= 0 &&\n clientRects[0].left > clientRects[1].right\n ) {\n return clientRects[cursorRectIndex] || boundingRect;\n }\n\n switch (currentBasePlacement) {\n case 'top':\n case 'bottom': {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = currentBasePlacement === 'top';\n\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n\n return {top, bottom, left, right, width, height};\n }\n case 'left':\n case 'right': {\n const minLeft = Math.min(...clientRects.map((rects) => rects.left));\n const maxRight = Math.max(...clientRects.map((rects) => rects.right));\n const measureRects = clientRects.filter((rect) =>\n currentBasePlacement === 'left'\n ? rect.left === minLeft\n : rect.right === maxRight\n );\n\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n\n return {top, bottom, left, right, width, height};\n }\n default: {\n return boundingRect;\n }\n }\n}\n", "import {VirtualElement} from '@popperjs/core';\nimport {ReferenceElement, Sticky} from '../types';\n\nconst sticky: Sticky = {\n name: 'sticky',\n defaultValue: false,\n fn(instance) {\n const {reference, popper} = instance;\n\n function getReference(): ReferenceElement | VirtualElement {\n return instance.popperInstance\n ? instance.popperInstance.state.elements.reference\n : reference;\n }\n\n function shouldCheck(value: 'reference' | 'popper'): boolean {\n return instance.props.sticky === true || instance.props.sticky === value;\n }\n\n let prevRefRect: ClientRect | null = null;\n let prevPopRect: ClientRect | null = null;\n\n function updatePosition(): void {\n const currentRefRect = shouldCheck('reference')\n ? getReference().getBoundingClientRect()\n : null;\n const currentPopRect = shouldCheck('popper')\n ? popper.getBoundingClientRect()\n : null;\n\n if (\n (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect)) ||\n (currentPopRect && areRectsDifferent(prevPopRect, currentPopRect))\n ) {\n if (instance.popperInstance) {\n instance.popperInstance.update();\n }\n }\n\n prevRefRect = currentRefRect;\n prevPopRect = currentPopRect;\n\n if (instance.state.isMounted) {\n requestAnimationFrame(updatePosition);\n }\n }\n\n return {\n onMount(): void {\n if (instance.props.sticky) {\n updatePosition();\n }\n },\n };\n },\n};\n\nexport default sticky;\n\nfunction areRectsDifferent(\n rectA: ClientRect | null,\n rectB: ClientRect | null\n): boolean {\n if (rectA && rectB) {\n return (\n rectA.top !== rectB.top ||\n rectA.right !== rectB.right ||\n rectA.bottom !== rectB.bottom ||\n rectA.left !== rectB.left\n );\n }\n\n return true;\n}\n", "import tippy from '../src';\nimport {render} from '../src/template';\n\ntippy.setDefaultProps({render});\n\nexport {default, hideAll} from '../src';\nexport {default as createSingleton} from '../src/addons/createSingleton';\nexport {default as delegate} from '../src/addons/delegate';\nexport {default as animateFill} from '../src/plugins/animateFill';\nexport {default as followCursor} from '../src/plugins/followCursor';\nexport {default as inlinePositioning} from '../src/plugins/inlinePositioning';\nexport {default as sticky} from '../src/plugins/sticky';\nexport {ROUND_ARROW as roundArrow} from '../src/constants';\n", "import { JQElementHelper } from \"../../lib/JQElementHelper\";\nimport { AxDropdownInteraction } from './AxDropdownInteraction';\nimport { BehaviorSubject, Subject } from \"rxjs\";\nimport tippy from 'tippy.js';\nexport class AxDropdownEvents {\n constructor(selector, options) {\n this.jqElementHelper = new JQElementHelper();\n this.$parents = $(selector);\n this.interaction = new AxDropdownInteraction(options);\n this.options = options;\n this.interaction.openSubject = new Subject();\n this.interaction.onShownSubject = new Subject();\n this.interaction.changeSubject = new BehaviorSubject(null);\n this.createIntersectionObserver();\n this.jqElementHelper.iterateSelector(this.$parents, ($elem) => {\n const $menu = $elem.find('.ax-dropdown__menu');\n const isMultiSelect = this.interaction.hasMultiSelectClass($elem);\n const instance = tippy($elem[0], {\n content: $menu[0],\n allowHTML: true,\n placement: 'bottom',\n trigger: 'click',\n arrow: false,\n interactive: true,\n maxWidth: 'none',\n animation: false,\n onShow: (instance) => {\n let $parent = $(instance.reference);\n let $popperInstance = $(instance.popper);\n instance.popper.style.width = instance.reference.getBoundingClientRect().width + 'px';\n this.interaction.afterOpen($parent, $popperInstance);\n },\n onShown(instance) {\n let $parent = $(instance.reference);\n let $popperInstance = $(instance.popper);\n //instance.popper.style.width = instance.reference.getBoundingClientRect().width + 'px';\n this.interaction.afterOnShown($parent, $popperInstance);\n },\n appendTo: () => document.body,\n });\n const $parent = $(instance.reference);\n this.assignIntersectionObserver($parent);\n const $popperInstance = $(instance.popper);\n let $selectedList = $popperInstance.find('.ax-dropdown__item.selected');\n if ($selectedList.length > 0) {\n for (let selected of $selectedList) {\n const $selected = $(selected);\n if (isMultiSelect) {\n $selected.removeClass('selected');\n }\n this.interaction.select($selected, $elem);\n }\n }\n this.assignSelectEvent($parent, $popperInstance);\n this.assignSearchEvent($parent, $popperInstance);\n this.assignMultiSelectDelete($parent, $popperInstance);\n this.assignResetEvent($parent, $popperInstance);\n });\n }\n assignResetEvent($parent, $popperElem) {\n $parent.on(\"click\", \".ax-dropdown--reset\", (event) => {\n $parent.find('.ax-dropdown__trigger').removeClass('has-selection');\n $parent.find(\".ax-dropdown__selection\").text(\"\");\n let currentTarget = $popperElem.find(\".ax-dropdown__item.selected\");\n if (currentTarget.length > 0) {\n currentTarget.removeClass(\"selected\");\n }\n $(event.currentTarget).remove();\n });\n }\n assignMultiSelectDelete($parent, $popperElem) {\n const hasMultiSelect = this.options.multiSelect && $parent.hasClass('ax-dropdown--multiselect');\n if (hasMultiSelect) {\n $parent.on(\"click\", \".ax-dropdown__muli-remove\", (e) => {\n e.preventDefault();\n const id = $(e.currentTarget).parent().attr(\"data-value\");\n this.interaction.deleteMultiSelection($parent, id, $popperElem);\n });\n }\n }\n assignSearchEvent($parent, $popperElem) {\n if (this.options.searchBar || $parent.hasClass('ax-dropdown--hero')) {\n $popperElem.find(\".ax-dropdown__search-input\").on(\"keyup\", e => {\n e.preventDefault();\n const $target = $(e.delegateTarget);\n this.interaction.search($target, $parent, $popperElem);\n });\n }\n }\n assignSelectEvent($parent, $popperElem) {\n const hasMultiSelect = this.options.multiSelect && $parent.hasClass('ax-dropdown--multiselect');\n if (this.options.multiSelect && !hasMultiSelect) {\n console.warn(`Element is set to multiselect but doesn't contain multiselect class`);\n console.warn($parent);\n }\n $popperElem.find(\".ax-dropdown__menu\").on(\"click\", '.ax-dropdown__item:not(.ax-dropdown__search)', (e) => {\n const $target = $(e.currentTarget);\n this.interaction.select($target, $parent);\n });\n }\n createIntersectionObserver() {\n if (!this.options.hideOnOutOfScreen)\n return;\n const options = {\n root: window.document,\n rootMargin: \"0px\",\n threshold: 1,\n };\n const interSectionCallback = (entries, observer) => {\n for (let entry of entries) {\n this.interaction.close($(entry.target));\n }\n };\n this.observer = new IntersectionObserver(interSectionCallback, options);\n }\n assignIntersectionObserver($parent) {\n if (this.options.hideOnOutOfScreen) {\n this.observer.observe($parent[0]);\n }\n }\n}\n", "import { JQElementHelper } from \"../lib/JQElementHelper\";\nimport { AxDropdownEvents } from \"./lib/AxDropdownEvents\";\nexport var Direction;\n(function (Direction) {\n Direction[Direction[\"added\"] = 0] = \"added\";\n Direction[Direction[\"removed\"] = 1] = \"removed\";\n})(Direction || (Direction = {}));\nexport class AxDropdown {\n constructor(jqElementHelper = new JQElementHelper()) {\n this.jqElementHelper = jqElementHelper;\n this.defaultOptions = { searchBar: false, multiSelect: false, hideOnOutOfScreen: true };\n }\n /**\n * Init AxDropdown.\n *\n * @remarks\n * As soon as init is called menu is removed from DOM\n *\n * @param selector - Javascript QuerySelector\n * @param options -\n * - onSelect: on new selected element return parent and selected element, in case of multiselect all selected elements\n * - onChange: with multiselect false, same behavior as onSelect bad called twice (one selected, one unselected),\n * with multiselect true called on every change\n * return parent and selected element, in case of multiselect all selected elements, effected element\n */\n init(selector, options) {\n this.selector = selector;\n this.options = Object.assign(Object.assign({}, this.defaultOptions), options);\n this.axDropdownEvents = new AxDropdownEvents(selector, this.options);\n }\n getElements() {\n return this.axDropdownEvents.$parents;\n }\n toggleMenu($parent) {\n $parent = $parent || $(this.selector);\n let instance = this.axDropdownEvents.interaction.getTippyInstance($parent);\n if (instance.state.isVisible) {\n this.axDropdownEvents.interaction.close($parent);\n }\n else {\n this.axDropdownEvents.interaction.open($parent);\n }\n }\n open($parent) {\n $parent = $parent || $(this.selector);\n this.axDropdownEvents.interaction.open($parent);\n }\n close($parent) {\n $parent = $parent || $(this.selector);\n this.axDropdownEvents.interaction.close($parent);\n }\n select($elem) {\n const $parent = this.getParent($elem);\n this.axDropdownEvents.interaction.select($elem, $parent);\n }\n resetSelection($parent) {\n $parent = $parent || $(this.selector);\n $parent.each((i, e) => {\n this.axDropdownEvents.interaction.resetSelection($(e));\n });\n }\n getSelected($parent) {\n $parent = $parent || this.getParent(null);\n let instance = this.axDropdownEvents.interaction.getTippyInstance($parent);\n return $(instance.popper).find('.ax-dropdown__menu .ax-dropdown__item.selected');\n }\n getValue($parent) {\n $parent = $parent || this.getParent(null);\n return this.axDropdownEvents.interaction.getValue($parent);\n }\n setValue(value, $parent) {\n $parent = $parent || this.getParent(null);\n return this.axDropdownEvents.interaction.setValue(value, $parent);\n }\n val() {\n return this.getValue();\n }\n getOpenObserver() {\n return this.axDropdownEvents.interaction.openSubject;\n }\n getOnShownObserver() {\n return this.axDropdownEvents.interaction.onShownSubject;\n }\n getSelectObserver() {\n return this.axDropdownEvents.interaction.changeSubject;\n }\n /// <summary>\n /// \n /// </summary>\n /// <param name=\"option\">Jquery element or string value of option</param>\n /// <param name=\"disabled\">null for toggle</param>\n /// <param name=\"$parent\">Optional - parent</param>\n /// <returns>new state of options</returns>\n toggleDisabled(option, disabled, $parent) {\n $parent = $parent || this.getParent(null);\n return this.axDropdownEvents.interaction.toggleDisabled(option, disabled, $parent);\n }\n getParent($elem) {\n var $elements = this.getElements();\n if ($elements.length === 1) {\n return $($elements[0]);\n }\n if ($elem !== null && $elem.length > 0) {\n for (let parent of $elements) {\n let $parent = $(parent);\n if ($parent.has($elem[0]).length > 0) {\n return $parent;\n }\n }\n }\n return $($elements[0]);\n }\n jumpToElement($parent) {\n $([document.documentElement, document.body]).animate({\n scrollTop: $parent.offset().top - 100\n }, 100);\n }\n validate(scrollToElement = false) {\n //placeholder\n // for (let dropdown of this.Dropdowns) {\n // const element = $(dropdown.ValueElem);\n // const formGroup = element.closest('.ax-form-group');\n // if (dropdown.ValueElem.innerHTML == '') {\n // if (formGroup.length > 0) {\n // $(formGroup).addClass('invalid-form');\n // if (scrollToElement) {\n // this.JumpToElement();\n // }\n // }\n // return false;\n // } else {\n // if (formGroup.length > 0) {\n // $(formGroup).removeClass('invalid-form');\n // }\n // }\n // }\n return true;\n }\n getSelector() {\n return this.selector;\n }\n}\n// Override expression to make it case insensitive\n// @ts-ignore\njQuery.expr[\":\"].contains = function (a, i, m) {\n return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0;\n};\n", "export class InputIconHelper {\n constructor($elem, $icon) {\n this.$elem = $elem;\n this.$icon = $icon;\n this.isPassword = $elem.is(\":password\");\n }\n drawValidOrResetIcon() {\n if (this.isPassword)\n return;\n let hasValue = this.$elem.val() != \"\";\n hasValue ? this.drawValidIcon() : this.resetIcon();\n }\n drawDeleteIcon() {\n if (this.isPassword)\n return;\n if (this.$elem.val() === '')\n return;\n this.$icon.removeClass().addClass(\"lar la-times-circle ax-empty-input\");\n }\n resetIcon() {\n if (this.isPassword)\n return;\n this.$icon.removeClass();\n this.$icon.addClass(\"d-none\");\n }\n drawValidIcon() {\n if (this.isPassword)\n return;\n if (this.$elem.hasClass('valid')) {\n this.$icon.removeClass();\n this.$icon.addClass(\"las la-check ax-color-green-500\");\n }\n }\n togglePasswordIcon() {\n this.$icon.removeClass();\n this.$icon.addClass(\"lar la-eye\");\n }\n}\n", "import { InputIconHelper } from \"./InputIconHelper\";\nexport class InputEventHelper {\n constructor($elem, $parent, $icon) {\n this.$elem = $elem;\n this.$parent = $parent;\n this.$icon = $icon;\n this.iconHelper = new InputIconHelper($elem, $icon);\n this.$passwordValidiation = $parent.find(\".ax-password-validation\");\n this.isPassword = $elem.is(\":password\");\n if (this.isPassword) {\n this.iconHelper.togglePasswordIcon();\n }\n }\n focus() {\n this.$elem.addClass(\"active\");\n }\n keyup() {\n let tmpval = this.$elem.val();\n let hasValue = tmpval != \"\";\n this.$parent.removeClass(\"field-error\");\n this.$elem.toggleClass(\"value\", hasValue);\n if (this.isPassword) {\n this.$passwordValidiation.css(\"display\", hasValue ? \"flex\" : \"none\");\n if (hasValue && this.$elem.hasClass(\"js-password-strength\")) {\n this.checkStrength();\n }\n }\n hasValue ? this.iconHelper.drawDeleteIcon() : this.iconHelper.resetIcon();\n }\n blur() {\n this.$elem.removeClass(\"active\");\n if ($(\".js-password-strength\").hasClass(\"field-error\")) {\n $(\".ax-password-validation__label\").not(\".valid\").addClass(\"invalid\");\n }\n this.iconHelper.drawValidOrResetIcon();\n }\n iconClick() {\n if (this.isPassword) {\n let inputTypePassword = this.$elem.attr(\"type\") === \"password\";\n this.$elem.attr(\"type\", inputTypePassword ? \"text\" : \"password\");\n this.$icon.removeClass().addClass(inputTypePassword ? \"lar la-eye-slash\" : \"lar la-eye\");\n return;\n }\n this.$elem.val(\"\").removeClass(\"value valid\").trigger('change');\n this.iconHelper.resetIcon();\n }\n checkStrength() {\n let strength = 0;\n let password = this.$elem.val();\n let $passwordStrength = this.$parent.find(\".password-strength\");\n let $progressText = this.$parent.find(\".progress-text\");\n let $lengthCheckIndicator = this.$passwordValidiation.find(\".js-pw-char\");\n let $lowerCaseCheckIndicator = this.$passwordValidiation.find(\".js-pw-lower\");\n let $upperCaseCheckIndicator = this.$passwordValidiation.find(\".js-pw-upper\");\n let $numberCheckIndicator = this.$passwordValidiation.find(\".js-pw-num\");\n let $specialCharCheckIndicator = this.$passwordValidiation.find(\".js-pw-spec-char\");\n this.$parent.find(\".ax-progress-wrapper\").toggleClass(\"visible\", password != '');\n if (this.$elem.hasClass(\"field-error\")) {\n this.$passwordValidiation.find(\".ax-password-validation__label\").not(\".valid\").addClass(\"invalid\");\n }\n if (/^(.{8,}$)/.test(password)) {\n strength += 1;\n $lengthCheckIndicator.addClass(\"valid\").removeClass(\"invalid\");\n }\n else {\n $lengthCheckIndicator.removeClass(\"valid\");\n }\n if (/^(?=.*[a-z])/.test(password)) {\n strength += 1;\n $lowerCaseCheckIndicator.addClass(\"valid\").removeClass(\"invalid\");\n }\n else {\n $lowerCaseCheckIndicator.removeClass(\"valid\");\n }\n if (/^(?=.*[A-Z])/.test(password)) {\n strength += 1;\n $upperCaseCheckIndicator.addClass(\"valid\").removeClass(\"invalid\");\n }\n else {\n $upperCaseCheckIndicator.removeClass(\"valid\");\n }\n if (/^(?=.*[0-9])/.test(password)) {\n strength += 1;\n $numberCheckIndicator.addClass(\"valid\").removeClass(\"invalid\");\n }\n else {\n $numberCheckIndicator.removeClass(\"valid\");\n }\n if (/^(?=.*[@#$%&!\\.\\(\\)\\{\\}\\[\\]\\^\\$\\*\\+\\-\\?\\/\\|\\\u2014\\/])/.test(password)) {\n strength += 1;\n $specialCharCheckIndicator.addClass(\"valid\").removeClass(\"invalid\");\n }\n else {\n $specialCharCheckIndicator.removeClass(\"valid\");\n }\n if (strength < 2) {\n $passwordStrength.removeClass(\"progress-bar-warning\");\n $passwordStrength.removeClass(\"progress-bar-success\");\n $passwordStrength.addClass(\"progress-bar-danger\");\n $passwordStrength.css(\"width\", \"30%\");\n $progressText.text(\"weak\");\n }\n else if (strength == 4) {\n $passwordStrength.removeClass(\"progress-bar-success\");\n $passwordStrength.removeClass(\"progress-bar-danger\");\n $passwordStrength.addClass(\"progress-bar-warning\");\n $passwordStrength.css(\"width\", \"65%\");\n $progressText.text(\"medium\");\n }\n else if (strength == 5) {\n $passwordStrength.removeClass(\"progress-bar-warning\");\n $passwordStrength.removeClass(\"progress-bar-danger\");\n $passwordStrength.addClass(\"progress-bar-success\");\n $passwordStrength.css(\"width\", \"100%\");\n $progressText.text(\"strong\");\n this.$passwordValidiation.hide();\n }\n }\n}\n", "import { JQElementHelper } from \"../lib/JQElementHelper\";\nimport { InputEventHelper } from \"./Helper/InputEventHelper\";\nimport { InputIconHelper } from \"./Helper/InputIconHelper\";\nexport class AxInput {\n constructor(selector) {\n this.jqElementHelper = new JQElementHelper();\n this.selector = selector;\n }\n init() {\n this.$parents = $(this.selector);\n this.jqElementHelper.iterateSelector(this.$parents, ($elem) => {\n let $parent = $elem.parent();\n let $icon = $parent.find('i');\n if ($icon.length === 0) {\n $parent.append('<i class=\"d-none\"></i>');\n $icon = $parent.find('i');\n }\n const iconHelper = new InputIconHelper($elem, $icon);\n const inputEventHelper = new InputEventHelper($elem, $parent, $icon);\n $elem.on({\n focus: () => {\n inputEventHelper.focus();\n },\n keyup: () => {\n inputEventHelper.keyup();\n },\n blur: () => {\n inputEventHelper.blur();\n }\n });\n $parent.on({\n mouseenter: () => {\n iconHelper.drawDeleteIcon();\n },\n mouseleave: () => {\n iconHelper.drawValidOrResetIcon();\n }\n });\n $icon.on(\"click\", () => {\n inputEventHelper.iconClick();\n });\n });\n }\n}\n", "import i18next from '../i18n';\nexport class AxFormValidation {\n constructor(options) {\n this.selector = options.selector;\n this.rules = options.rules;\n this.messages = options.messages;\n this.callBack = options.callback;\n }\n init() {\n $.validator.messages.required = i18next.t('form.required');\n /**\n * Client side form validation\n * Using Jquery Validation plugin\n * src: https://jqueryvalidation.org/\n *\n * @param {[type]} .ax-form [.ax-form description]\n * @param {[type]} function Form validation\n *\n * @return {[type]} error rule and message\n */\n $(this.selector).each((i, e) => {\n var _a;\n $(e).validate({\n errorClass: \"field-error\",\n ignore: \"\",\n focusInvalid: false,\n rules: this.rules,\n messages: (_a = this.messages) !== null && _a !== void 0 ? _a : this.getMessages(),\n submitHandler: (form) => {\n if (this.callBack != null) {\n this.callBack(form);\n return;\n }\n form.submit();\n },\n invalidHandler: (event, validator) => {\n this.invalidHandler();\n },\n errorPlacement: function (error, element) {\n error.appendTo(element.parents(\".ax-form-group\"));\n if (\".ax-phone-field\") {\n error.appendTo(element.parents(\".ax-phone-field\"));\n }\n if (element.is(\":checkbox\")) {\n error.appendTo(element.parents(\".ax-checkbox-wrapper\"));\n }\n if (element.is(\":radio\")) {\n error.appendTo(element.parents(\".ax-radio-wrapper\"));\n }\n },\n });\n });\n }\n getMessages() {\n return {\n checkbox: i18next.t('form.msgRadioCheck'),\n checkboxMd: i18next.t('form.msgRadioCheck'),\n checkboxMulti: i18next.t('form.msgRadioCheck'),\n checkboxMultiMd: i18next.t('form.msgRadioCheck'),\n radio: i18next.t('form.msgRadioCheck'),\n radioMd: i18next.t('form.msgRadioCheck'),\n inputName: i18next.t('form.required'),\n dropdown: i18next.t('form.msgDropdown'),\n hiddenPhone: {\n regex: i18next.t('form.msgPhoneRequired'),\n },\n email: {\n email: i18next.t('form.msgEmail'),\n regex: i18next.t('form.msgEmail')\n },\n emailguestconfirm: {\n required: true,\n equalTo: i18next.t('form.msgEmailGuestConfirm'),\n },\n };\n }\n invalidHandler() {\n $(\".ax-dropdown\").each(function () {\n if (!$(this).find(\".hidden-input\").val()) {\n if ($(this).find(\".hidden-input\").val() === \"\") {\n $(this)\n .find(\".ax-dropdown__trigger\")\n .addClass(\"has-error\");\n }\n else {\n $(this)\n .find(\".ax-dropdown__trigger\")\n .parent()\n .removeClass(\"has-error\");\n }\n }\n else {\n $(this).find(\"label.field-error\").hide();\n $(this)\n .find(\".ax-dropdown__trigger\")\n .parent()\n .removeClass(\"has-error\");\n }\n if (!$(this).find(\".ax-form-group input\").val()) {\n $(this)\n .find(\".ax-form-group input\")\n .addClass(\"field-error\");\n }\n if ($(this).find(\"field-error\")) {\n $(this)\n .find(\".ax-form-group input\")\n .removeClass(\"valid\")\n .addClass(\"field-error\");\n $(this).find(\".ax-form-group .la-check\").remove();\n }\n });\n }\n}\n$.validator.addMethod(\n/* The value you can use inside the object in the validator. */\n\"regex\", \n/* The function that tests a given string against a given regEx. */\nfunction (value, element, regexp) {\n /* Check if the value is truthy (avoid null.constructor) & if it's not a RegEx. (Edited: regex --> regexp)*/\n if (regexp && regexp.constructor != RegExp) {\n /* Create a new regular expression using the regex argument. */\n regexp = new RegExp(regexp);\n }\n else if (regexp.global)\n regexp.lastIndex = 0;\n /* Check whether the argument is global and, if so set its last index to 0. */\n /* Return whether the element is optional or the result of the validation. */\n return (this.optional(element) ||\n regexp.test(value));\n});\n$.validator.addMethod(\"pwcheck\", function (value, element) {\n let password = value;\n if (!/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[@#$%&!\\.\\(\\)\\{\\}\\[\\]\\^\\$\\*\\+\\-\\?\\/\\|\\\u2014\\/])(.{8,20}$)/.test(password)) {\n return false;\n }\n return true;\n}, function (value, element) {\n let password = $(element).val();\n if (!/^(.{8,20}$)/.test(password)) {\n return i18next.t('form.msgPasswordInvalid');\n }\n else if (!/^(?=.*[A-Z])/.test(password)) {\n return i18next.t('form.msgPasswordUppercase');\n }\n else if (!/^(?=.*[a-z])/.test(password)) {\n return i18next.t('form.msgPasswordLowercase');\n }\n else if (!/^(?=.*[0-9])/.test(password)) {\n return i18next.t('form.msgPasswordDigit');\n }\n else if (!/^(?=.*[@#$%&!\\.\\(\\)\\{\\}\\[\\]\\^\\$\\*\\+\\-\\?\\/\\|\\\u2014\\/])/.test(password)) {\n return i18next.t('form.msgPasswordSpecChar');\n }\n return false;\n});\n", "import { JQElementHelper } from \"../lib/JQElementHelper\";\nconst onOpenEvent = new CustomEvent(\"show.modal\", {\n bubbles: false,\n cancelable: false,\n composed: true\n});\nconst onOpenedEvent = new CustomEvent(\"shown.modal\", {\n bubbles: false,\n cancelable: false,\n composed: true\n});\nconst onHideEvent = new CustomEvent(\"hide.modal\", {\n bubbles: false,\n cancelable: false,\n composed: true\n});\nconst onHiddenEvent = new CustomEvent(\"hidden.modal\", {\n bubbles: false,\n cancelable: false,\n composed: true\n});\nexport class AxModal {\n constructor(jqElementHelper = new JQElementHelper()) {\n this.jqElementHelper = jqElementHelper;\n this.isClickable = true;\n this.closeOnClick = (el) => {\n let $currentModal = el.closest('.ax-modal');\n $currentModal[0].dispatchEvent(onHideEvent);\n $currentModal.trigger('hide.modal', []);\n $currentModal.removeClass(\"fade-in\");\n $currentModal.addClass(\"fade-out\");\n setTimeout(function () {\n $currentModal.removeClass(\"fade-out\");\n }, 600);\n setTimeout(function () {\n $currentModal.removeClass(\"is-open\");\n $currentModal[0].dispatchEvent(onHiddenEvent);\n $currentModal.trigger('hidden.modal', []);\n }, 450);\n };\n }\n init(options) {\n var _a, _b, _c, _d;\n this.trigger = $(((_a = options === null || options === void 0 ? void 0 : options.selector) !== null && _a !== void 0 ? _a : \".ax-modal-trigger\"));\n this.closeModal = $((_b = options === null || options === void 0 ? void 0 : options.closeModalSelector) !== null && _b !== void 0 ? _b : \".ax-modal-header-wrapper\");\n this.closeModalBtn = $((_c = options === null || options === void 0 ? void 0 : options.closeModalBtnSelector) !== null && _c !== void 0 ? _c : \".js-close-modal\");\n this.closeOnBackground = (_d = this.closeOnBackground) !== null && _d !== void 0 ? _d : true;\n this.jqElementHelper.iterateSelector(this.trigger, ($elem) => {\n let modalAttr = $elem.attr('data-target');\n $elem.on(\"click\", (e) => {\n let modalAttr = $(e.delegateTarget).attr('data-target');\n let $modal = $(`.ax-modal[id=${modalAttr}]`);\n this.open($modal[0]);\n });\n $(`.ax-modal[id=${modalAttr}]`).on(\"click\", (e) => {\n const $elem = $(e.delegateTarget);\n const staticBackdrop = $elem.attr('data-backdrop') === 'static';\n if ($(window).width() > 576 && staticBackdrop) {\n $elem.addClass(\"bounce\");\n if (!this.isClickable)\n return false;\n this.isClickable = false;\n setTimeout(() => {\n $('.ax-modal[data-backdrop=\"static\"]').removeClass(\"bounce\");\n this.isClickable = true;\n }, 550);\n $(\".ax-modal-content\").on(\"click\", (e) => {\n e.stopPropagation();\n });\n }\n if (!staticBackdrop && this.closeOnBackground && $(e.target).is($elem)) {\n this.closeOnClick($elem);\n }\n });\n });\n this.closeModal.on(\"click\", (e) => {\n if ($(window).width() < 576) {\n this.closeOnClick($(e.delegateTarget));\n }\n });\n this.closeModalBtn.on(\"click\", (e) => {\n this.closeOnClick($(e.delegateTarget));\n });\n }\n close(target) {\n this.closeOnClick($(target));\n }\n open(modal) {\n const $modal = $(modal);\n $modal[0].dispatchEvent(onOpenEvent);\n $modal.trigger('show.modal', []);\n $modal.removeClass(\"fade-out\");\n $modal.addClass(\"fade-in is-open\");\n setTimeout(function () {\n $modal.removeClass(\"fade-in\");\n $modal[0].dispatchEvent(onOpenedEvent);\n $modal.trigger('shown.modal', []);\n }, 600);\n }\n}\n", "import { Subject } from \"rxjs\";\r\n\r\nexport interface Options {\r\n Selector: string | HTMLElement;\r\n Value: number;\r\n Min?: number;\r\n Max?: number;\r\n}\r\n\r\nexport class AxCounter {\r\n private element: HTMLElement;\r\n private $QuantityCounter: JQuery<HTMLElement>;\r\n private value: number;\r\n\r\n private min: number;\r\n private max: number;\r\n private default: number;\r\n\r\n private observer: Subject<number>;\r\n\r\n Init(options: Options) {\r\n\r\n if (typeof options.Selector == \"string\") {\r\n let $e = $(options.Selector);\r\n if ($e.length !== 1) {\r\n throw `AxCounter::Element with selector '${options.Selector}' not found or not unique!`;\r\n }\r\n this.element = $e[0];\r\n } else {\r\n this.element = options.Selector;\r\n }\r\n\r\n this.value = options.Value;\r\n this.min = options.Min;\r\n this.max = options.Max;\r\n this.default = options.Value;\r\n\r\n this.$QuantityCounter = $(this.element).find(`*[data-quantity-selection]`);\r\n\r\n this.observer = new Subject<number>();\r\n\r\n this.UpdateQuantity();\r\n\r\n this.$QuantityCounter.prev('button').click(x => {\r\n this.DecreaseQuantity();\r\n });\r\n this.$QuantityCounter.next('button').click(x => {\r\n this.IncreaseQuantity();\r\n });\r\n }\r\n\r\n resetValue() {\r\n this.value = this.default;\r\n this.UpdateQuantity();\r\n }\r\n\r\n updateMin(min: number) {\r\n this.min = min;\r\n this.updateButtonState();\r\n }\r\n\r\n updateMax(max: number) {\r\n this.max = max;\r\n this.updateButtonState();\r\n }\r\n\r\n getElement() {\r\n return this.element;\r\n }\r\n\r\n setValue(value: number) {\r\n this.value = value;\r\n this.UpdateQuantity();\r\n }\r\n\r\n Subscribe(x: (x: number) => void) {\r\n return this.observer.subscribe(y => x(y));\r\n }\r\n\r\n getSubscription(): Subject<number> {\r\n return this.observer;\r\n }\r\n\r\n GetValue() {\r\n return this.value;\r\n }\r\n\r\n IncreaseQuantity() {\r\n if (this.max == null || this.max > this.value) {\r\n this.value++;\r\n this.observer.next(this.value);\r\n this.UpdateQuantity();\r\n }\r\n }\r\n\r\n DecreaseQuantity() {\r\n if (this.value > 0 && (this.min == null || this.value > this.min)) {\r\n this.value--;\r\n this.observer.next(this.value);\r\n this.UpdateQuantity();\r\n }\r\n }\r\n\r\n UpdateQuantity() {\r\n if (this.$QuantityCounter.is('input')) {\r\n this.$QuantityCounter.val(this.value.toString());\r\n return;\r\n }\r\n this.$QuantityCounter.html(this.value.toString());\r\n this.updateButtonState();\r\n }\r\n\r\n updateButtonState() {\r\n if (this.value == this.max) {\r\n this.$QuantityCounter.next('button').attr('disabled', 'disabeld');\r\n } else {\r\n this.$QuantityCounter.next('button').removeAttr('disabled');\r\n }\r\n if (this.value == this.min) {\r\n this.$QuantityCounter.prev('button').attr('disabled', 'disabeld');\r\n } else {\r\n this.$QuantityCounter.prev('button').removeAttr('disabled');\r\n }\r\n }\r\n}\r\n", "export class BodyUtility {\r\n ToggleScroll() {\r\n if (!$('html').hasClass('ax-noscroll')) {\r\n this.DisableScroll();\r\n return;\r\n }\r\n this.EnableScroll();\r\n }\r\n\r\n EnableScroll() {\r\n let scrollTop = parseInt($('html').css('top'));\r\n $('html').removeClass('ax-noscroll');\r\n $('html,body').scrollTop(-scrollTop);\r\n }\r\n\r\n DisableScroll() {\r\n if ($(document).height() > $(window).height()) {\r\n let scrollTop = ($('html').scrollTop()) ? $('html').scrollTop() : $('body').scrollTop(); // Works for Chrome, Firefox, IE...\r\n $('html').addClass('ax-noscroll').css('top', -scrollTop);\r\n }\r\n }\r\n\r\n enableOverlay() {\r\n let scrollTop = ($('html').scrollTop()) ? $('html').scrollTop() : $('body').scrollTop(); // Works for Chrome, Firefox, IE...\r\n $('html').addClass('ax-noscroll').css('top', -scrollTop);\r\n }\r\n\r\n disableOverlay() {\r\n let scrollTop = parseInt($('html').css('top'));\r\n $('html').removeClass('ax-noscroll');\r\n $('html,body').scrollTop(-scrollTop);\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\n\r\nexport interface PackageMinMaxData {\r\n MinConstraint: number;\r\n MaxConstraint: number;\r\n HasMinCountConstraint: boolean;\r\n HasMaxCountConstraint: boolean;\r\n}\r\n\r\nexport class CheckMinMaxConstraintResult {\r\n errorMessage: string;\r\n minMaxOk: boolean;\r\n}\r\n\r\n@ModuleName(\"PackageMinMaxConstraint\")\r\nexport class PackageMinMaxConstraint implements AxInit {\r\n\r\n private i18NHelper = new I18nHelper();\r\n public packageMinMaxData: PackageMinMaxData;\r\n\r\n AxInit(initData: PackageMinMaxData): void {\r\n this.packageMinMaxData = initData;\r\n }\r\n\r\n public CheckMinMaxConstraint(count: number): CheckMinMaxConstraintResult {\r\n\r\n let minMaxOk: boolean = false;\r\n let minOk: boolean = false;\r\n let maxOk: boolean = false;\r\n\r\n if (!this.packageMinMaxData.HasMinCountConstraint && !this.packageMinMaxData.HasMaxCountConstraint) {\r\n let result = new CheckMinMaxConstraintResult();\r\n result.minMaxOk = true;\r\n return result;\r\n }\r\n\r\n if (this.packageMinMaxData.HasMinCountConstraint) {\r\n if (count >= this.packageMinMaxData.MinConstraint) {\r\n minOk = true;\r\n }\r\n } else {\r\n minOk = true; \r\n }\r\n\r\n if (this.packageMinMaxData.HasMinCountConstraint) {\r\n if (count <= this.packageMinMaxData.MaxConstraint) {\r\n maxOk = true;\r\n } \r\n } else {\r\n maxOk = true;\r\n }\r\n\r\n minMaxOk = minOk && maxOk;\r\n\r\n let result = new CheckMinMaxConstraintResult();\r\n result.minMaxOk = minMaxOk;\r\n result.errorMessage = this.getErrorMessage(minMaxOk, minOk, maxOk);\r\n\r\n return result;\r\n }\r\n\r\n // getErrorMessage\r\n getErrorMessage(minMaxOk: boolean, minOk: boolean, maxOk: boolean): string {\r\n let that = this;\r\n\r\n if (minMaxOk) {\r\n return \"\";\r\n }\r\n\r\n if (!minOk) {\r\n return `${that.i18NHelper.GetTranslation(Translations.MinQuantity)}: ${that.packageMinMaxData.MinConstraint} ${that.i18NHelper.GetTranslation(Translations.Tickets) }`;\r\n }\r\n\r\n if (!maxOk) {\r\n return `${that.i18NHelper.GetTranslation(Translations.MaxQuantity)}: ${that.packageMinMaxData.MaxConstraint} ${that.i18NHelper.GetTranslation(Translations.Tickets) }`;\r\n }\r\n }\r\n}", "export enum LoadingSpinnerPositionEnum {\r\n Center,\r\n Left,\r\n Right,\r\n Top\r\n}", "export class RandomHelper {\r\n GetRandomString(length: number): string {\r\n let result = '';\r\n let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n let charactersLength = characters.length;\r\n for (let i = 0; i < length; i++) {\r\n result += characters.charAt(Math.floor(Math.random() *\r\n charactersLength));\r\n }\r\n return result;\r\n }\r\n\r\n GetGuid(): string {\r\n function S4() {\r\n return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\r\n }\r\n return (S4() + S4() + \"-\" + S4() + \"-4\" + S4().substr(0, 3) + \"-\" + S4() + \"-\" + S4() + S4() + S4()).toLowerCase();\r\n }\r\n\r\n static GenerateUniqueId(): string {\r\n return `id-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\r\n }\r\n}", "import { forEach } from \"mathjs\";\r\nimport { LoadingSpinnerPositionEnum } from \"../../Lib/Enums/LoadingSpinnerPositionEnum\";\r\nimport { RandomHelper } from \"../../Lib/Helper/RandomHelper\";\r\n\r\nexport class AxLoading {\r\n constructor(private _RandomHelper = new RandomHelper()) {}\r\n\r\n private ActiveLoading: ActiveLoading[] = [];\r\n\r\n ShowLoadingIndicatorForMultible(elems: HTMLElement[], transparent?: boolean, position?: LoadingSpinnerPositionEnum) {\r\n\r\n for (let elem of elems) {\r\n this.ShowLoadingIndicator(elem, transparent, position);\r\n }\r\n }\r\n\r\n HideLoadingIndicatorForMultible(elems: HTMLElement[]) {\r\n for (let elem of elems) {\r\n this.HideLoadingIndicator(elem);\r\n }\r\n }\r\n\r\n ShowLoadingIndicatorGetId(elem: HTMLElement, transparent?: boolean, position?: LoadingSpinnerPositionEnum, prepend?: boolean): string {\r\n\r\n this.ShowLoadingIndicator(elem, transparent, position, prepend);\r\n const guid = $(elem).data('ax-loading-guid');\r\n return guid;\r\n }\r\n\r\n HideLoadingIndicatorWithId(guid: string) {\r\n let active = this.GetActiveLoading(guid);\r\n\r\n if (active != null) {\r\n active.target.remove();\r\n this.ActiveLoading = this.ActiveLoading.filter(x => x.guid != guid);\r\n return;\r\n }\r\n\r\n let elem = $(\"div[ax-loading-guid='\" + guid + \"']\");\r\n $(elem).find('.loading-spinner').remove();\r\n }\r\n\r\n ShowLoadingIndicatorGreyBackGround(elem: HTMLElement, position?: LoadingSpinnerPositionEnum, prepend?: boolean) {\r\n let guid = $(elem).data('ax-loading-guid');\r\n prepend = prepend || false;\r\n\r\n if (this.GetActiveLoading(guid) != null) {\r\n return;\r\n }\r\n\r\n let loadingIndicator = document.createElement('div');\r\n loadingIndicator.classList.add('ax-loading-spinner');\r\n loadingIndicator.classList.add('ax-bg-default');\r\n\r\n this.setPosition(loadingIndicator, position);\r\n\r\n if (prepend) {\r\n $(elem).prepend(loadingIndicator);\r\n } else {\r\n $(elem).append(loadingIndicator);\r\n }\r\n\r\n guid = this._RandomHelper.GetGuid();\r\n $(elem).data('ax-loading-guid', guid);\r\n\r\n this.ActiveLoading.push({\r\n guid: guid,\r\n target: loadingIndicator\r\n });\r\n }\r\n\r\n ShowLoadingIndicator(elem: HTMLElement, transparent?: boolean, position?: LoadingSpinnerPositionEnum, prepend?: boolean) {\r\n let guid = $(elem).data('ax-loading-guid');\r\n transparent = transparent || false;\r\n prepend = prepend || false;\r\n\r\n if (this.GetActiveLoading(guid) != null) {\r\n return;\r\n }\r\n\r\n let loadingIndicator = document.createElement('div');\r\n loadingIndicator.classList.add('ax-loading-spinner');\r\n\r\n if (transparent) {\r\n loadingIndicator.classList.add('ax-loading-spinner--transparent');\r\n }\r\n\r\n this.setPosition(loadingIndicator, position);\r\n\r\n if (prepend) {\r\n $(elem).prepend(loadingIndicator);\r\n } else {\r\n $(elem).append(loadingIndicator);\r\n }\r\n\r\n guid = this._RandomHelper.GetGuid();\r\n $(elem).data('ax-loading-guid', guid);\r\n\r\n this.ActiveLoading.push({\r\n guid: guid,\r\n target: loadingIndicator\r\n });\r\n }\r\n\r\n private setPosition(loadingIndicator: HTMLDivElement, position: LoadingSpinnerPositionEnum) {\r\n if (position != null || position != undefined) {\r\n if (position == LoadingSpinnerPositionEnum.Left) {\r\n loadingIndicator.classList.add('justify-content-start');\r\n loadingIndicator.classList.add('ax-pl-2');\r\n }\r\n else if (position == LoadingSpinnerPositionEnum.Right) {\r\n loadingIndicator.classList.add('justify-content-end');\r\n loadingIndicator.classList.add('ax-pr-2');\r\n }\r\n else if (position == LoadingSpinnerPositionEnum.Top) {\r\n this.setToTop(loadingIndicator);\r\n }\r\n }\r\n }\r\n\r\n ShowLoadingIndicatorButtonPrimary(elem: HTMLElement, transparent?: boolean) {\r\n let guid = $(elem).data('ax-loading-guid');\r\n transparent = transparent || false;\r\n\r\n if (this.GetActiveLoading(guid) != null) {\r\n return;\r\n }\r\n\r\n let loadingIndicator = document.createElement('div');\r\n loadingIndicator.classList.add('ax-loading-spinner-button');\r\n loadingIndicator.classList.add('ax-btn');\r\n loadingIndicator.classList.add('ax-btn-primary');\r\n\r\n if (transparent) {\r\n loadingIndicator.classList.add('ax-loading-spinner--transparent');\r\n }\r\n\r\n $(elem).append(loadingIndicator);\r\n guid = this._RandomHelper.GetGuid();\r\n $(elem).data('ax-loading-guid', guid);\r\n\r\n this.ActiveLoading.push({\r\n guid: guid,\r\n target: loadingIndicator\r\n });\r\n }\r\n\r\n private setToTop(loadingIndicator: any) {\r\n loadingIndicator.classList.add('d-flex');\r\n loadingIndicator.classList.add('align-items-start');\r\n loadingIndicator.classList.add('p-2');\r\n }\r\n\r\n ShowLoadingIndicatorTop(elem: HTMLElement) {\r\n let guid = $(elem).data('ax-loading-guid');\r\n\r\n if (this.GetActiveLoading(guid) != null) {\r\n return;\r\n }\r\n\r\n let loadingIndicator = document.createElement('div');\r\n loadingIndicator.classList.add('ax-loading-spinner');\r\n this.setToTop(loadingIndicator);\r\n\r\n $(elem).append(loadingIndicator);\r\n guid = this._RandomHelper.GetGuid();\r\n $(elem).data('ax-loading-guid', guid);\r\n\r\n this.ActiveLoading.push({\r\n guid: guid,\r\n target: loadingIndicator\r\n });\r\n }\r\n\r\n ShowLoadingIndicatorFixed(elem: HTMLElement) {\r\n let guid = $(elem).data('ax-loading-guid');\r\n\r\n if (this.GetActiveLoading(guid) != null) {\r\n return;\r\n }\r\n\r\n let loadingIndicator = document.createElement('div');\r\n loadingIndicator.classList.add('ax-loading-spinner');\r\n loadingIndicator.classList.add('position-fixed');\r\n\r\n $(elem).append(loadingIndicator);\r\n guid = this._RandomHelper.GetGuid();\r\n $(elem).data('ax-loading-guid', guid);\r\n\r\n this.ActiveLoading.push({\r\n guid: guid,\r\n target: loadingIndicator\r\n });\r\n }\r\n\r\n HideLoadingIndicator(elem: HTMLElement) {\r\n let guid = $(elem).data('ax-loading-guid');\r\n let active = this.GetActiveLoading(guid);\r\n\r\n if (active != null) {\r\n active.target.remove();\r\n this.ActiveLoading = this.ActiveLoading.filter(x => x.guid != guid);\r\n return;\r\n }\r\n $(elem).find('.loading-spinner').remove();\r\n }\r\n\r\n private GetActiveLoading(guid: string): ActiveLoading {\r\n if (guid != null) {\r\n return this.ActiveLoading.find(x => x.guid == guid);\r\n }\r\n return null;\r\n }\r\n}\r\n\r\n\r\ninterface ActiveLoading {\r\n guid: string;\r\n target: HTMLElement;\r\n}", "export class ProductCalcModel {\r\n\r\n constructor(DatumFrom: string, DatumTo: string, Quantity: number, CustomerCardsTypeNo?: number, PersTypNo?: number, PoolNo?: number,\r\n ArtikelNo?: number, RentalItemNo?: number, RentalPersTypeNo?: number, WareSaleItemNo?: number, PackPos?: number, RemainingNo?: number) {\r\n\r\n this.Quantity = Quantity;\r\n this.CustomerCardsTypeNo = CustomerCardsTypeNo;\r\n this.PersTypNo = PersTypNo;\r\n this.PoolNo = PoolNo;\r\n this.ArtikelNo = ArtikelNo;\r\n this.RentalItemNo = RentalItemNo;\r\n this.RentalPersTypeNo = RentalPersTypeNo;\r\n this.WareSaleItemNo = WareSaleItemNo;\r\n this.PackPos = PackPos;\r\n this.RemainingNo = RemainingNo;\r\n this.DatumFrom = DatumFrom;\r\n this.DatumTo = DatumTo;\r\n }\r\n\r\n Quantity: number;\r\n CustomerCardsTypeNo?: number;\r\n PersTypNo?: number;\r\n PoolNo?: number;\r\n ArtikelNo?: number;\r\n RentalItemNo?: number;\r\n RentalPersTypeNo?: number;\r\n WareSaleItemNo?: number;\r\n PackPos?: number;\r\n RemainingNo?: number;\r\n DatumFrom: string;\r\n DatumTo: string;\r\n}", "import { LoadingSpinnerPositionEnum } from \"../../Lib/Enums/LoadingSpinnerPositionEnum\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { ProductCalcModel } from \"../../Models/BestMatch/ProductCalcModel\";\r\nimport { Product } from \"../../Models/Tickets/Product\";\r\n\r\nexport class BestMatchHandler {\r\n private betterMatchHolderName: string;\r\n private packageNameHolderName: string;\r\n private betterPriceHolderName: string;\r\n private originalSinglePriceName: string;\r\n private calculatedPriceHolderName: string;\r\n private divisor: number;\r\n private getBestMatchActivated: boolean;\r\n private axLoading: AxLoading;\r\n\r\n private requestQueue: BestMatchProSelectRequestValues[];\r\n private requestTimerSecCounter: number;\r\n private timer: NodeJS.Timer;\r\n\r\n private requestTimerSecCounterInitialValue = 1;\r\n\r\n constructor(getBestMatchActivated: boolean, divisor: number, betterMatchHolderName: string, packageNameHolderName: string, betterPriceHolderName: string,\r\n originalSinglePriceName: string, calculatedPriceHolderName: string) {\r\n this.betterMatchHolderName = betterMatchHolderName;\r\n this.packageNameHolderName = packageNameHolderName;\r\n this.betterPriceHolderName = betterPriceHolderName;\r\n this.originalSinglePriceName = originalSinglePriceName;\r\n this.calculatedPriceHolderName = calculatedPriceHolderName;\r\n this.divisor = divisor;\r\n this.getBestMatchActivated = getBestMatchActivated;\r\n this.axLoading = new AxLoading();\r\n this.requestQueue = [];\r\n this.requestTimerSecCounter = this.requestTimerSecCounterInitialValue;\r\n }\r\n\r\n // GetBestMatchTicketsV4Date\r\n async GetBestMatchTicketsV4Date(ticketTypeNo: number, poolNo: number, dateFrom: moment.Moment, productList: Product[]): Promise<BestMatchTicketResult[]> {\r\n return new Promise<BestMatchTicketResult[]>(async (resolve, reject) => {\r\n\r\n if (!this.getBestMatchActivated) {\r\n return resolve([]);\r\n }\r\n\r\n let soapDateFrom = '';\r\n\r\n if (dateFrom != undefined) {\r\n soapDateFrom = dateFrom.format(\"YYYY-MM-DD\");\r\n }\r\n\r\n if (productList.filter(x => x.Quantity > 0).length < 1) {\r\n return resolve([]);\r\n }\r\n\r\n this.axLoading.ShowLoadingIndicatorForMultible($(\".prod_selection__personType_row\").toArray(), false, LoadingSpinnerPositionEnum.Left);\r\n\r\n let requestValues: BestMatchProSelectRequestValues = {\r\n ticketTypeNo: ticketTypeNo,\r\n poolNo: poolNo,\r\n dateFrom: soapDateFrom,\r\n productList: productList\r\n }\r\n\r\n this.requestQueue.push(requestValues);\r\n\r\n if (this.requestQueue.length > 1) {\r\n this.resetRequestTimer();\r\n reject();\r\n }\r\n else {\r\n let apiCallResult = await this.startRequestTimer();\r\n this.showBetterMatchPrices(apiCallResult, requestValues.productList);\r\n this.axLoading.HideLoadingIndicatorForMultible($(\".prod_selection__personType_row\").toArray());\r\n resolve(apiCallResult);\r\n }\r\n\r\n this.axLoading.HideLoadingIndicatorForMultible($(\".prod_selection__personType_row\").toArray());\r\n return resolve([]);\r\n });\r\n }\r\n\r\n // resetRequestTimer\r\n private resetRequestTimer() {\r\n this.requestTimerSecCounter = this.requestTimerSecCounterInitialValue;\r\n }\r\n\r\n // startRequestTimer\r\n private startRequestTimer(): Promise<BestMatchTicketResult[]> {\r\n return new Promise<BestMatchTicketResult[]>((resolve) => {\r\n this.timer = setInterval(async () => {\r\n\r\n this.requestTimerSecCounter = this.requestTimerSecCounter - 1;\r\n\r\n if (this.requestTimerSecCounter === 0) {\r\n\r\n let requestValues = this.requestQueue[this.requestQueue.length - 1];\r\n\r\n this.requestTimerSecCounter = this.requestTimerSecCounterInitialValue;\r\n\r\n if (this.timer) {\r\n clearInterval(\"\" + this.timer);\r\n }\r\n\r\n let apiCallResult = await this.CallApi(requestValues).then((bestMatchResultList) => {\r\n this.requestQueue = [];\r\n resolve(bestMatchResultList);\r\n });\r\n }\r\n },\r\n 1000);\r\n });\r\n }\r\n\r\n // CallApi\r\n private async CallApi(requestValues: BestMatchProSelectRequestValues): Promise<BestMatchTicketResult[]> {\r\n return new Promise<BestMatchTicketResult[]>((resolve) => {\r\n\r\n let productCalcMap = [];\r\n\r\n for (let prod of requestValues.productList) {\r\n\r\n let productCalcModel = new ProductCalcModel(requestValues.dateFrom, requestValues.dateFrom, prod.Quantity,\r\n requestValues.ticketTypeNo, prod.SubProductIdentifier, requestValues.poolNo);\r\n\r\n productCalcMap.push({ \"Key\": prod.Id, \"Value\": productCalcModel });\r\n }\r\n\r\n let data = {\r\n productCalcMap: productCalcMap\r\n }\r\n\r\n AxessViewer.loadPartialView('/BestMatchPackage/GetBestMatchForTicketProdSelection', data, (x: BestMatchTicketResponse) => {\r\n resolve(x.bestMatchResults);\r\n }, {});\r\n });\r\n }\r\n\r\n // showBetterMatchPrices\r\n showBetterMatchPrices(bestMatchResults: BestMatchTicketResult[], productList: Product[]) {\r\n $(this.betterMatchHolderName).css('display', 'none');\r\n $(this.betterPriceHolderName).css('display', 'none');\r\n $(this.originalSinglePriceName).css('display', 'initial');\r\n $(this.calculatedPriceHolderName).css('text-decoration', 'none');\r\n $(this.calculatedPriceHolderName).removeClass('ax-color-gray-600');\r\n\r\n for (let bestMatchResultObj of bestMatchResults) {\r\n\r\n let bestMatchTicketResult = bestMatchResultObj as BestMatchTicketResult;\r\n\r\n let betterMatchHolder = $(`${this.betterMatchHolderName}[data_pType_betterMatch='${bestMatchTicketResult.productSelectionId}']`);\r\n $(betterMatchHolder).css('display', 'flex');\r\n\r\n let packageNameHolder = $(`${this.packageNameHolderName}[data_pType_packName='${bestMatchTicketResult.productSelectionId}']`);\r\n $(packageNameHolder).html(bestMatchTicketResult.packageName);\r\n\r\n let betterPriceHolder = $(`${this.betterPriceHolderName}[data_pType_betterPrice='${bestMatchTicketResult.productSelectionId}'] > span`);\r\n $(betterPriceHolder).html(this.GetBestMatchPositionPriceString(bestMatchTicketResult, productList));\r\n\r\n $(`${this.betterPriceHolderName}[data_pType_betterPrice='${bestMatchTicketResult.productSelectionId}']`).css('display', 'inline-block');\r\n\r\n let originalSinglePriceHolder = $(`${this.originalSinglePriceName}[data-base-single-price-holder='${bestMatchTicketResult.productSelectionId}']`);\r\n $(originalSinglePriceHolder).css('display', 'none');\r\n\r\n let calculatedPriceHolder = $(`${this.calculatedPriceHolderName}[data-calculated-price-holder='${bestMatchTicketResult.productSelectionId}']`);\r\n $(calculatedPriceHolder).css('text-decoration', 'line-through');\r\n $(calculatedPriceHolder).addClass('ax-color-gray-600');\r\n }\r\n }\r\n\r\n // GetBestMatchPositionPriceString\r\n GetBestMatchPositionPriceString(bestMatchResult: BestMatchTicketResult, productList: Product[]): string {\r\n let product = productList.find(x => x.Id == bestMatchResult.productSelectionId);\r\n let priceSumInt = this.GetBestMatchProductPriceSum(product.Quantity, product.Price, bestMatchResult);\r\n return priceSumInt.toFixed(2);\r\n }\r\n\r\n // GetBestMatchProductPrice\r\n GetBestMatchProductPriceSum(quantity: number, originalPrice: number, bestMatchResult: BestMatchTicketResult): number {\r\n if (bestMatchResult == null || bestMatchResult == undefined) {\r\n return 0;\r\n }\r\n\r\n if (bestMatchResult.countUnmatched == 0) {\r\n return quantity * this.GetPrice(bestMatchResult.betterTariffInt, this.divisor);\r\n }\r\n\r\n let matchedQuantity = quantity - bestMatchResult.countUnmatched;\r\n\r\n let sumBetterMatchProducts = matchedQuantity * this.GetPrice(bestMatchResult.betterTariffInt, this.divisor);\r\n\r\n let sumUnmatchedProducts = bestMatchResult.countUnmatched * this.GetPrice(originalPrice, this.divisor)\r\n\r\n return sumBetterMatchProducts + sumUnmatchedProducts;\r\n }\r\n\r\n // FindBestMatch\r\n FindBestMatch(prodSelectionId: number, bestMatchResults: BestMatchTicketResult[]): BestMatchTicketResult {\r\n let bestMatchResult = bestMatchResults.find(x => x.productSelectionId === prodSelectionId);\r\n return bestMatchResult;\r\n }\r\n\r\n // GetPrice\r\n GetPrice(price: number, divisor: number): number {\r\n return price / divisor;\r\n }\r\n\r\n // stopRequestTimer\r\n stopRequestTimer() {\r\n clearInterval('' + this.timer);\r\n }\r\n}\r\n\r\nclass BestMatchProSelectRequestValues {\r\n ticketTypeNo: number;\r\n poolNo: number;\r\n dateFrom: string;\r\n productList: Product[];\r\n}\r\n\r\ninterface BestMatchTicketResponse {\r\n bestMatchResults: BestMatchTicketResult[]\r\n}\r\n\r\ninterface BestMatchTicketResult {\r\n betterTariff: string;\r\n betterTariffInt: number;\r\n productSelectionId: number;\r\n packageName: string;\r\n quantityFix: boolean;\r\n countUnmatched: number;\r\n}\r\n\r\n\r\n", "import { AxDropdown } from \"@axess/limestone\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxCounter } from \"../../Limestone/AxCounter/AxCounter\";\r\nimport { Product } from \"../../Models/Tickets/Product\";\r\nimport { BodyUtility } from \"../AxUtility/BodyUtility\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { PackageMinMaxConstraint, CheckMinMaxConstraintResult } from \"../../Modules/Packages/PackageMinMaxConstraint\";\r\nimport { BestMatchHandler } from \"../BestMatch/BestMatchHandler\";\r\nimport { BehaviorSubject } from \"rxjs\";\r\n\r\nexport class TicketList {\r\n private CultureInfo: any;\r\n private Divisor: number;\r\n\r\n public ProductList: Product[];\r\n\r\n public Total: string;\r\n public ProductDropdown: AxDropdown = new AxDropdown();\r\n public foreignCurrency: string;\r\n\r\n public Counter: AxCounter[] = [];\r\n\r\n public QuantityOkSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\r\n public QuantityChange: BehaviorSubject<number> = new BehaviorSubject<number>(0);\r\n\r\n public allotmentQuantity: number;\r\n\r\n private ticketTypeNo: number;\r\n private projectNo: number;\r\n private poolNo: number;\r\n private dateFromStringFormatted: string;\r\n private dateFrom: moment.Moment;\r\n\r\n private bestMatchHandler: BestMatchHandler;\r\n\r\n constructor(private _I18nHelper = new I18nHelper(),\r\n private _BodyUtility = new BodyUtility()) { }\r\n\r\n Init(initData: InitData): void {\r\n this.CultureInfo = initData.CultureInfo;\r\n this.Divisor = initData.NumberDivisor;\r\n this.ProductList = initData.ProductList;\r\n this.foreignCurrency = initData.ForeignCurrency;\r\n this.allotmentQuantity = initData.AllotmentAvailable ?? -1;\r\n\r\n this.ProductDropdown.init('.prod_selection__prod-selection .ax-dropdown');\r\n\r\n this.ticketTypeNo = initData.Id;\r\n this.projectNo = initData.ProjNr;\r\n this.poolNo = initData.ProductGroupIdentifier;\r\n\r\n this.bestMatchHandler = new BestMatchHandler(initData.GetBestMatch, this.Divisor, \"div.prod_selection__betterMatch_holder\", \"div.prod_selection__betterMatch_packageName_holder\",\r\n \"div.prod_selection__betterMatch_betterPrice_holder\", \"span.prod_selection__original_SinglePrice\", \"div.prod_selection__calculatedPrice\");\r\n\r\n $('.prod_selection__date-selection').click(x => {\r\n $('.prod_selection__date-wrapper').addClass('active');\r\n this._BodyUtility.DisableScroll();\r\n });\r\n\r\n $('.prod_selection__prod-selection').click(x => {\r\n $('.prod_selection__prod-wrapper').addClass('active');\r\n this._BodyUtility.DisableScroll();\r\n });\r\n\r\n $('.prod_selection__prod-continue').click(x => {\r\n $('.prod_selection__prod-wrapper').removeClass('active');\r\n $('.prod_selection__date-wrapper').addClass('active');\r\n });\r\n\r\n $('.prod_selection__prod-wrapper .prod_selection__prod-close').click(x => {\r\n $('.prod_selection__prod-wrapper').removeClass('active');\r\n this._BodyUtility.EnableScroll();\r\n });\r\n\r\n $('.prod_selection__date-wrapper .prod_selection__prod-close').click(x => {\r\n $('.prod_selection__date-wrapper').removeClass('active');\r\n this._BodyUtility.EnableScroll();\r\n });\r\n\r\n $('.tv4_quantity__info_expand').click(x => {\r\n $('.tv4_quantity__info').toggleClass('active');\r\n });\r\n\r\n for (let prod of this.ProductList) {\r\n prod.ListElement = $('.prod_selection__prod-list')[prod.Id];\r\n\r\n let axCounter = new AxCounter();\r\n axCounter.Init({\r\n Value: prod.Quantity,\r\n Selector: `.prod__counter_${prod.Id}`,\r\n Max: prod.Max,\r\n Min: prod.Min,\r\n });\r\n axCounter.Subscribe((x) => {\r\n prod.Quantity = x;\r\n this.AdjustTotalAmount();\r\n });\r\n this.Counter.push(axCounter);\r\n }\r\n this.AdjustTotalAmount();\r\n }\r\n\r\n SetFromDateStringFormatted(dateFrom: string) {\r\n this.dateFromStringFormatted = dateFrom;\r\n }\r\n\r\n SetFromDate(dateFrom: moment.Moment) {\r\n this.dateFrom = dateFrom;\r\n }\r\n\r\n AdjustTotalAmount(updateBasePrice?: boolean) {\r\n let totalAmount: number = 0;\r\n let totalAmountFrc: number = 0;\r\n let quantity: number = 0;\r\n let namedProducts: string = '';\r\n let foreignCurrency: boolean = false;\r\n updateBasePrice = updateBasePrice || false;\r\n\r\n this.bestMatchHandler.GetBestMatchTicketsV4Date(this.ticketTypeNo, this.poolNo, this.dateFrom, this.ProductList).then((bestMatchResultList) => {\r\n\r\n for (let prod of this.ProductList) {\r\n\r\n if (prod.Quantity > 0) {\r\n quantity += prod.Quantity;\r\n\r\n let bestMatchResult = this.bestMatchHandler.FindBestMatch(prod.Id, bestMatchResultList);\r\n\r\n if (bestMatchResultList.length > 0) {\r\n totalAmount += this.bestMatchHandler.GetBestMatchProductPriceSum(prod.Quantity, prod.Price, bestMatchResult);\r\n } else {\r\n totalAmount += (prod.Quantity * this.GetPrice(prod.Price));\r\n }\r\n\r\n namedProducts += `${prod.Quantity} ${prod.Name}, `;\r\n }\r\n\r\n $(prod.ListElement).find(`*[data-quantity-selection=${prod.Id}]`).html(prod.Quantity.toString());\r\n $(prod.ListElement).find(`*[data-quantity-input=${prod.Id}]`).val(prod.Quantity.toString());\r\n\r\n let price = $.number((prod.Quantity * this.GetPrice(prod.Price)), this.CultureInfo.currencyDecimalDigits, this.CultureInfo.currencyDecimalSeparator, this.CultureInfo.currencyGroupSeparator);\r\n $(prod.ListElement).find(`*[data-calculated-price=${prod.Id}]`).html(price.toString());\r\n\r\n if (prod.ForeignPrice != null) {\r\n let priceFrc = $.number((prod.Quantity * this.GetPrice(prod.ForeignPrice)), this.CultureInfo.currencyDecimalDigits, this.CultureInfo.currencyDecimalSeparator, this.CultureInfo.currencyGroupSeparator);\r\n $(prod.ListElement).find(`*[data-calculated-price-frc=${prod.Id}]`).html(`${this.foreignCurrency} ${priceFrc.toString()}`);\r\n foreignCurrency = true;\r\n totalAmountFrc += (prod.Quantity * this.GetPrice(prod.ForeignPrice));\r\n }\r\n\r\n if (updateBasePrice) {\r\n $(prod.ListElement).find(`*[data-base-price=${prod.Id}]`).html(this.GetPriceString(this.GetPrice(prod.Price)));\r\n\r\n if (prod.ForeignPrice != null) {\r\n $(prod.ListElement).find(`*[data-base-price-frc=${prod.Id}]`).html(`${this.foreignCurrency} ${this.GetPriceString(this.GetPrice(prod.ForeignPrice))}`);\r\n }\r\n }\r\n }\r\n\r\n namedProducts = namedProducts.substr(0, namedProducts.length - 2);\r\n\r\n let totalPrice: string = this.GetPriceString(totalAmount);\r\n this.Total = totalPrice;\r\n\r\n let summaryText = quantity.toString();\r\n\r\n if (quantity == 1) {\r\n summaryText += ` ${this._I18nHelper.GetTranslation(Translations.Ticket)}`;\r\n } else {\r\n summaryText += ` ${this._I18nHelper.GetTranslation(Translations.Tickets)}`;\r\n }\r\n\r\n let quantityOK: boolean = quantity > 0 && (this.allotmentQuantity === -1 || this.allotmentQuantity >= quantity);\r\n\r\n this.QuantityOkSubject.next(quantityOK);\r\n this.QuantityChange.next(quantity);\r\n\r\n\r\n let checkMinMaxConstraintResult = new CheckMinMaxConstraintResult();\r\n\r\n let minMaxConstraintModule = AxLoad.GetModule<PackageMinMaxConstraint>('PackageMinMaxConstraint');\r\n\r\n if (minMaxConstraintModule != null) {\r\n checkMinMaxConstraintResult = minMaxConstraintModule.CheckMinMaxConstraint(quantity);\r\n } else {\r\n checkMinMaxConstraintResult.minMaxOk = true;\r\n }\r\n\r\n if (quantityOK && checkMinMaxConstraintResult.minMaxOk) {\r\n this.ProductDropdown.setValue(namedProducts);\r\n $('.prod_selection__prod-continue').removeAttr('disabled');\r\n $('.prod_selection__prod-continue').html(this._I18nHelper.GetTranslation(Translations.Next));\r\n } else {\r\n this.ProductDropdown.resetSelection();\r\n $('.prod_selection__prod-continue').attr('disabled', 'disabled');\r\n\r\n if (!checkMinMaxConstraintResult.minMaxOk) {\r\n $('.prod_selection__prod-continue').html(checkMinMaxConstraintResult.errorMessage);\r\n } else {\r\n $('.prod_selection__prod-continue').html(this._I18nHelper.GetTranslation(Translations.Next));\r\n }\r\n }\r\n\r\n $('.prod_selection__persontype-summary').html(summaryText);\r\n $('.prod_selection__calculated-sum').html(totalPrice);\r\n\r\n if (foreignCurrency) {\r\n let totalPriceFrc: string = this.GetPriceString(totalAmountFrc);\r\n $('.prod_selection__calculated-sum-frc').html(`${this.foreignCurrency} ${totalPriceFrc}`);\r\n }\r\n }).catch(function () { });\r\n }\r\n\r\n GetQuantity() {\r\n let quantity = 0;\r\n for (let prod of this.ProductList) {\r\n quantity += prod.Quantity;\r\n }\r\n\r\n return quantity;\r\n }\r\n\r\n GetPriceString(totalAmount: number) {\r\n return $.number(totalAmount, this.CultureInfo.currencyDecimalDigits, this.CultureInfo.currencyDecimalSeparator, this.CultureInfo.currencyGroupSeparator)\r\n }\r\n\r\n GetPriceStringWithCurrencySymbol(totalAmount: number) {\r\n return `${this.CultureInfo.CurrencyPosition == 0 ? this.CultureInfo.CurrencySymbol : ''}${this.GetPriceString(totalAmount)}${this.CultureInfo.CurrencyPosition == 1 ? this.CultureInfo.CurrencySymbol : ''}`\r\n }\r\n\r\n GetPrice(price: number): number {\r\n return price / this.Divisor;\r\n }\r\n}\r\n\r\nexport interface InitData {\r\n CultureInfo: any;\r\n NumberDivisor: number;\r\n ProductList: Product[];\r\n ProjNr: number;\r\n ProductGroupIdentifier: number;\r\n Id: number;\r\n ForeignCurrency: string;\r\n AllotmentAvailable: number;\r\n GetBestMatch: boolean;\r\n}\r\n", "export class RequestHelper {\r\n \r\n objectifyForm(formArray: any): object {\r\n let returnArray = {};\r\n for (let i = 0; i < formArray.length; i++){\r\n returnArray[formArray[i]['name']] = formArray[i]['value'];\r\n }\r\n return returnArray;\r\n }\r\n\r\n\r\n findGetParameter(parameterName: string): string {\r\n let result = null,\r\n tmp = [];\r\n location.search\r\n .substr(1)\r\n .split(\"&\")\r\n .forEach(function (item) {\r\n tmp = item.split(\"=\");\r\n if (tmp[0] === parameterName) result = decodeURIComponent(tmp[1]);\r\n });\r\n return result;\r\n }\r\n\r\n base64UrlSave(obj) {\r\n const data = JSON.stringify(obj);\r\n return btoa(data).replace(/\\//g, '_').replace(/\\+/g, '-');\r\n }\r\n\r\n postToUrl(path: string, data: any, options?: any) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n let method = options.method || \"post\"; // Set method to post by default if not specified.\r\n\r\n let form = document.createElement(\"form\");\r\n form.setAttribute(\"method\", method);\r\n form.setAttribute(\"action\", path);\r\n\r\n function constructElements(item, parentString) {\r\n if (typeof item == \"function\") return;\r\n\r\n if (typeof item != \"object\") {\r\n createInput(parentString.slice(0, -1), item);\r\n }\r\n\r\n for (let key in item) {\r\n if (item.hasOwnProperty(key) && item[key] != null && typeof item[key] != 'function') {\r\n if (Object.prototype.toString.call(item[key]) === '[object Array]') {\r\n for (let i = 0; i < item[key].length; i++) {\r\n constructElements(item[key][i], parentString + key + \"[\" + i + \"].\");\r\n }\r\n } else if (Object.prototype.toString.call(item[key]) === '[object Object]') {\r\n constructElements(item[key], parentString + key + \".\");\r\n } else {\r\n createInput(parentString + key, item[key]);\r\n }\r\n }\r\n }\r\n\r\n function createInput(name: string, value: string) {\r\n let hiddenField = document.createElement(\"input\");\r\n hiddenField.setAttribute(\"type\", \"hidden\");\r\n hiddenField.setAttribute(\"name\", name);\r\n hiddenField.setAttribute(\"value\", value);\r\n form.appendChild(hiddenField);\r\n }\r\n }\r\n\r\n //if the parent 'data' object is an array we need to treat it a little differently\r\n if (Object.prototype.toString.call(data) === '[object Array]') {\r\n if (options.arrayName === undefined) console.warn(\"Posting array-type to url will doubtfully work without an arrayName defined in options.\");\r\n //loop through each array item at the parent level\r\n for (let i = 0; i < data.length; i++) {\r\n constructElements(data[i], (options.arrayName || \"\") + \"[\" + i + \"].\");\r\n }\r\n } else {\r\n //otherwise treat it normally\r\n constructElements(data, \"\");\r\n }\r\n\r\n document.body.appendChild(form);\r\n form.submit();\r\n };\r\n\r\n insertParam(url: string, key: string, value: string) {\r\n let absolutePath = this.absolutePath(url);\r\n let urlObj = new URL(absolutePath);\r\n urlObj.searchParams.append(key, value);\r\n return urlObj.toString();\r\n }\r\n\r\n absolutePath(href) {\r\n let link = document.createElement(\"a\");\r\n link.href = href;\r\n return link.href;\r\n }\r\n}", "import { RequestHelper } from \"../RequestHelper\";\r\nimport { AxLoad } from \"../../AxSystem/AxLoad\";\r\nimport { AxStaticConfigModule } from \"../../../Modules/AxConfig/AxStaticConfigModule\";\r\n\r\nexport class SummaryRedirect {\r\n constructor(private _requestHelper = new RequestHelper()) {}\r\n\r\n redirect(postURL: string, data: any, timeSlots: boolean) {\r\n let configModule = AxLoad.GetModule<AxStaticConfigModule>('AxStaticConfigModule');\r\n\r\n if (configModule.skipSummary) {\r\n AxessViewer.loadPartialView(postURL, data, (result) => {\r\n AxLoad.LoadModule('AxFireShoppingCartModal', {\r\n result: result,\r\n continueShoppingPath: \"Tickets\",\r\n btn: '.tv4_prod-selection__addToCart-submit',\r\n ResetQuantity: false,\r\n queryAddition: timeSlots ? '?ref=pit' : '?ref=pi'\r\n });\r\n }, {\r\n silent: true,\r\n skipShoppingCartReload: false,\r\n addCulturInfo: false\r\n });\r\n\r\n return;\r\n }\r\n\r\n this._requestHelper.postToUrl(postURL, data, {});\r\n }\r\n}", "import { ProgressBar, ProgressBarMode } from \"../../Global/Progressbar\";\r\nimport { InitData, TicketList } from \"../../../Components/ProductList/TicketList\";\r\nimport { SummaryRedirect } from \"../../../Lib/Helper/AxProdSelection/SummaryRedirect\";\r\n\r\nexport abstract class NonPreDateable {\r\n protected PostURL: string;\r\n\r\n constructor(protected _Progressbar = new ProgressBar(),\r\n protected _TicketList = new TicketList(),\r\n protected _summaryRedirect = new SummaryRedirect()) { }\r\n\r\n Init(initData: AxProdNonPredateableInit): void {\r\n this.PostURL = initData.PostURL;\r\n\r\n this._Progressbar.Init({\r\n Mode: ProgressBarMode.Default,\r\n Progress: 0\r\n });\r\n\r\n this._TicketList.Init(initData);\r\n this._TicketList.QuantityOkSubject.subscribe(x => this.CheckSubmit(x));\r\n }\r\n\r\n CheckSubmit(quantityOk: boolean): boolean {\r\n if (quantityOk) {\r\n $('.prod_selection__persontype-submit').removeAttr('disabled');\r\n $('.prod_selection__prod-save').removeAttr('disabled');\r\n $('.prod_selection__summary').toggle(true);\r\n return true;\r\n } else {\r\n $('.prod_selection__persontype-submit').attr('disabled', 'disabled');\r\n $('.prod_selection__prod-save').attr('disabled', 'disabled');\r\n $('.prod_selection__summary').toggle(false);\r\n return false;\r\n }\r\n }\r\n\r\n abstract ToSummary(): void;\r\n}\r\n\r\nexport interface AxProdNonPredateableInit extends InitData {\r\n PostURL: string;\r\n}", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { ProductMapper } from \"../../../Lib/Mapper/ProductMapper\";\r\nimport { AxLimeStone } from \"../../../Limestone/AxLimeStone\";\r\nimport { IAddToCartRequest } from \"../../../Models/Package/IAddToCartRequest\";\r\nimport { AxProdNonPredateableInit, NonPreDateable } from \"../Abstraction/NonPreDateable\";\r\n\r\n@ModuleName(\"AxPackNonPredateable\")\r\nexport class AxPackNonPredateable extends NonPreDateable implements AxInit {\r\n private ProjNr: number;\r\n private TariffSheetNr: number;\r\n private PackageNr: number;\r\n\r\n constructor(private _ProductMapper = new ProductMapper(),\r\n private _AxLimestone = new AxLimeStone()) { super(); }\r\n\r\n AxInit(initData: AxProdNonPredateableInit): void {\r\n this.ProjNr = initData.ProjNr;\r\n this.TariffSheetNr = initData.ProductGroupIdentifier;\r\n this.PackageNr = initData.Id;\r\n\r\n $('.prod_selection__persontype-submit').click(e => {\r\n this._AxLimestone.LockButton(e.delegateTarget);\r\n this.ToSummary();\r\n });\r\n\r\n this.Init(initData);\r\n }\r\n\r\n ToSummary(): void {\r\n if (this._TicketList.ProductList.filter(x => x.Quantity > 0).length > 0) {\r\n let requestObj: IAddToCartRequest = {\r\n ProjNr: this.ProjNr,\r\n PackTariffSheetNo: this.TariffSheetNr,\r\n PackageNr: this.PackageNr,\r\n PackagePositions: this._ProductMapper.GetPackagePositionList(this._TicketList.ProductList),\r\n Date: moment().format('YYYY-MM-DD')\r\n };\r\n\r\n this._summaryRedirect.redirect(this.PostURL, requestObj, false);\r\n }\r\n }\r\n}\r\n", "import { AxDatePicker, Cell } from \"./AxDatepicker\";\r\nimport { Direction } from \"./EventHelper\";\r\n\r\nexport class InteractionHelper {\r\n constructor() { }\r\n\r\n private Class_range: string = 'in-range';\r\n private Class_e_month: string = 'in-range--e-month';\r\n private Class_a_month: string = 'in-range--a-month';\r\n private Class_e_week: string = 'in-range--e-week';\r\n private Class_a_week: string = 'in-range--a-week';\r\n private Class_range_end: string = 'in-range--end';\r\n\r\n private Class_active: string = 'active';\r\n\r\n private TextCache: TextCacheEntry[] = [];\r\n\r\n ActivateDay(cell: Cell, parent: AxDatePicker, informSubscribers: boolean) {\r\n if (!cell.Element.classList.contains('axp__cell-blocked')) {\r\n this.unsetDate(parent, false);\r\n\r\n cell.Element.classList.add(this.Class_active);\r\n cell.Active = true;\r\n \r\n if (cell.DayRange > 0) {\r\n this.SetActiveRange(cell, parent);\r\n }\r\n\r\n if (informSubscribers) {\r\n parent.ActivationSubject.next(cell);\r\n }\r\n }\r\n }\r\n\r\n unsetDate(parent: AxDatePicker, sendSubscription: boolean) {\r\n for (let tmpCell of parent.Cells.filter(x => x.Active)) {\r\n tmpCell.Active = false;\r\n tmpCell.Element.classList.remove(this.Class_active);\r\n }\r\n this.DeactivateDayRange(parent);\r\n\r\n if (sendSubscription) {\r\n parent.ActivationSubject.next(null);\r\n }\r\n }\r\n\r\n SetActiveRange(cell: Cell, parent: AxDatePicker) {\r\n let targetDate = moment(cell.Date).add(cell.DayRange, 'd');\r\n\r\n let filteredCells = parent.Cells.filter(x => x.Date.isAfter(cell.Date) && x.Date.isBefore(targetDate));\r\n\r\n if (filteredCells.length >= 1) {\r\n if (cell.Date.isSame(moment(cell.Date).endOf('month'), 'day')) {\r\n cell.Element.classList.add(this.Class_e_month);\r\n }\r\n\r\n if (cell.Date.isSame(moment(cell.Date).endOf('week'), 'day')) {\r\n cell.Element.classList.add(this.Class_e_week);\r\n }\r\n\r\n for (let tmpCell of filteredCells) {\r\n let tmpDate = moment(tmpCell.Date);\r\n if (tmpDate.isSame(moment(tmpCell.Date).endOf('month'), 'day')) {\r\n tmpCell.Element.classList.add(this.Class_e_month);\r\n }\r\n\r\n if (tmpDate.isSame(moment(tmpCell.Date).startOf('month'), 'day')) {\r\n tmpCell.Element.classList.add(this.Class_a_month);\r\n }\r\n\r\n if (tmpDate.isSame(moment(tmpCell.Date).endOf('week'), 'day')) {\r\n tmpCell.Element.classList.add(this.Class_e_week);\r\n }\r\n\r\n if (tmpDate.isSame(moment(tmpCell.Date).startOf('week'), 'day')) {\r\n tmpCell.Element.classList.add(this.Class_a_week);\r\n }\r\n\r\n if (tmpDate.isSame(moment(targetDate).add(-1, 'day'), 'day')) {\r\n tmpCell.Element.classList.add(this.Class_range_end);\r\n }\r\n\r\n tmpCell.Element.classList.add(this.Class_range);\r\n tmpCell.InRange = true;\r\n }\r\n }\r\n }\r\n\r\n DeactivateDay(cell: Cell, parent: AxDatePicker) {\r\n cell.Active = false;\r\n cell.Element.classList.remove(this.Class_active);\r\n this.DeactivateDayRange(parent);\r\n parent.ActivationSubject.next(null);\r\n }\r\n\r\n DeactivateDayRange(parent: AxDatePicker) {\r\n for (let tmpCell of parent.Cells.filter(x => x.InRange || x.Active)) {\r\n tmpCell.Element.classList.remove(this.Class_range);\r\n tmpCell.Element.classList.remove(this.Class_e_month);\r\n tmpCell.Element.classList.remove(this.Class_a_month);\r\n tmpCell.Element.classList.remove(this.Class_e_week);\r\n tmpCell.Element.classList.remove(this.Class_a_week);\r\n tmpCell.Element.classList.remove(this.Class_range_end);\r\n tmpCell.InRange = false;\r\n }\r\n }\r\n\r\n BlockDate(date: moment.Moment, parent: AxDatePicker) {\r\n let cell = this.findCell(date, parent);\r\n\r\n if (cell != null || cell != undefined) {\r\n cell.Element.classList.add('axp__cell-blocked');\r\n\r\n if (cell.Active) {\r\n this.DeactivateDay(cell, parent);\r\n }\r\n }\r\n }\r\n\r\n findCell(date: moment.Moment, parent: AxDatePicker) {\r\n return parent.Cells.find(x => x.Date.isSame(date, 'day'));\r\n }\r\n\r\n UnblockDate(date: moment.Moment, parent: AxDatePicker) {\r\n this.findCell(date, parent).Element.classList.remove('axp__cell-blocked');\r\n }\r\n\r\n AddText(date: moment.Moment, text: string, parent: AxDatePicker) {\r\n this.CacheText(date, text);\r\n let cell = this.findCell(date, parent);\r\n\r\n if (cell != null || cell != undefined) {\r\n cell.Text = text;\r\n cell.Element.classList.toggle('axp__cell--text', cell.Text != '');\r\n parent.RenderH.AddText(cell);\r\n }\r\n }\r\n\r\n FillEmptyText(parent: AxDatePicker) {\r\n let text = '-';\r\n for (let cell of parent.Cells.filter(x => x.Text == '')) {\r\n this.CacheText(cell.Date, text);\r\n\r\n if (cell != null) {\r\n cell.Text = text;\r\n cell.Element.classList.toggle('axp__cell--text', cell.Text != '');\r\n parent.RenderH.AddText(cell);\r\n }\r\n }\r\n }\r\n\r\n RemoveText(date: moment.Moment, parent: AxDatePicker, removeCache: boolean) {\r\n let cell = this.findCell(date, parent);\r\n\r\n if (cell != null) {\r\n cell.Text = '';\r\n cell.Element.classList.toggle('axp__cell--text', cell.Text != '');\r\n parent.RenderH.RemoveText(cell);\r\n\r\n if (removeCache) {\r\n this.TextCache = this.TextCache.filter(x => !x.Date.isSame(date, 'day'));\r\n }\r\n }\r\n }\r\n\r\n RemoveAllText(parent: AxDatePicker, removeCache: boolean) {\r\n if (parent.Cells != null) {\r\n for (let cell of parent.Cells) {\r\n cell.Text = '';\r\n cell.Element.classList.toggle('axp__cell--text', cell.Text != '');\r\n parent.RenderH.RemoveText(cell);\r\n }\r\n }\r\n\r\n if (removeCache) {\r\n this.TextCache = [];\r\n }\r\n }\r\n\r\n LoadCachedText(date: moment.Moment, parent: AxDatePicker) {\r\n let existingEntry = this.TextCache.find(x => x.Date.isSame(date, 'day'));\r\n if (existingEntry != null) {\r\n this.AddText(existingEntry.Date, existingEntry.Text, parent);\r\n }\r\n }\r\n\r\n setDate(date: moment.Moment, parent: AxDatePicker, retVal: (x: HTMLElement[], d: Direction) => void) {\r\n parent.CurrentDate = date;\r\n parent.RenderH.RenderCalendar().then(x => {\r\n retVal(x, Direction.Jump);\r\n });\r\n }\r\n\r\n Next(parent: AxDatePicker, retVal: (x: HTMLElement[], d: Direction) => void) {\r\n parent.CurrentDate.add(parent.monthsShown, 'M');\r\n parent.RenderH.RenderCalendar().then(x => {\r\n retVal(x, Direction.Forward);\r\n if (x.length == 0) {\r\n parent.CurrentDate.add(parent.monthsShown * -1, 'M');\r\n }\r\n });\r\n }\r\n\r\n Previous(parent: AxDatePicker, retVal: (x: HTMLElement[], d: Direction) => void) {\r\n //if (parent.CurrentStartDate.startOf('month').isSame(parent.Options.StartDate.startOf('month'))) {\r\n // return;\r\n //}\r\n\r\n parent.CurrentDate.add(parent.monthsShown * -1, 'M');\r\n parent.RenderH.RenderCalendar().then(x => {\r\n retVal(x, Direction.Backward);\r\n if (x.length == 0) {\r\n parent.CurrentDate.add(parent.monthsShown, 'M');\r\n }\r\n });\r\n }\r\n\r\n\r\n private CacheText(date: moment.Moment, text: string) {\r\n let existingEntry = this.TextCache.find(x => x.Date.isSame(date, 'day'));\r\n\r\n if (existingEntry == null) {\r\n this.TextCache.push({\r\n Date: date,\r\n Text: text\r\n });\r\n } else {\r\n existingEntry.Text = text;\r\n }\r\n }\r\n}\r\n\r\ninterface TextCacheEntry {\r\n Date: moment.Moment;\r\n Text: string;\r\n}", "import { AxDatePicker, Cell } from \"./AxDatepicker\";\r\nimport { InteractionHelper } from \"./InteractionHelper\";\r\n\r\nexport class AxPEventHelper {\r\n private Parent: AxDatePicker;\r\n\r\n constructor(private ActionHelper: InteractionHelper = new InteractionHelper()) { }\r\n\r\n public AnimationDuration = 250;\r\n public InAnimation: boolean = false;\r\n\r\n public Init(parent: AxDatePicker) {\r\n this.Parent = parent;\r\n }\r\n\r\n public AddDayActivation(cell: Cell) {\r\n cell.Element.addEventListener(\"click\", ev => {\r\n this.ActionHelper.ActivateDay(cell, this.Parent, true);\r\n });\r\n }\r\n\r\n public setDate(date: moment.Moment) {\r\n this.InAnimation = true;\r\n this.ActionHelper.setDate(date, this.Parent, (a, b) => { this.AsyncNavigate(a, b) });\r\n }\r\n\r\n public AddNavigatorEvents(elem: HTMLElement, direction: Direction) {\r\n elem.addEventListener(\"click\", ev => {\r\n if (this.InAnimation == false) {\r\n this.InAnimation = true;\r\n\r\n if (direction == Direction.Forward) {\r\n this.ActionHelper.Next(this.Parent, (a, b) => { this.AsyncNavigate(a, b) });\r\n } else {\r\n this.ActionHelper.Previous(this.Parent, (a, b) => { this.AsyncNavigate(a, b) });\r\n }\r\n }\r\n });\r\n }\r\n\r\n public AsyncNavigate(newEntries: HTMLElement[], direction: Direction) {\r\n if (newEntries.length == 0) {\r\n this.InAnimation = false;\r\n return;\r\n }\r\n\r\n //I hate JS Size calculations\r\n let currentHeight = this.Parent.RootElement.offsetHeight;\r\n let currentWidth = this.Parent.RootElement.parentElement.offsetWidth;\r\n\r\n if (currentHeight !== 0) {\r\n this.Parent.RootElement.style.height = `${currentHeight}px`;\r\n }\r\n if (currentWidth !== 0) {\r\n this.Parent.RootElement.parentElement.style.width = `${currentWidth}px`;\r\n this.Parent.RootElement.parentElement.style.minWidth = `${currentWidth}px`;\r\n this.Parent.RootElement.parentElement.style.maxWidth = `${currentWidth}px`;\r\n }\r\n\r\n let newWeekRows = 0;\r\n let orgWeekRows = 0;\r\n let rowHeight = (this.Parent.RootElement.querySelector('.axp__week-Wrapper') as HTMLElement).offsetHeight;\r\n\r\n let currentMonths = this.Parent.RootElement.querySelectorAll('.axp__month');\r\n for (let i = 0; i < currentMonths.length; ++i) {\r\n let weekRows = currentMonths[i].querySelectorAll('.axp__week-Wrapper').length;\r\n if (weekRows > orgWeekRows) {\r\n orgWeekRows = weekRows;\r\n }\r\n }\r\n\r\n for (let entry of newEntries) {\r\n let weekRows = entry.querySelectorAll('.axp__week-Wrapper').length;\r\n if (weekRows > newWeekRows) {\r\n newWeekRows = weekRows;\r\n }\r\n }\r\n\r\n let newHeight = (currentHeight + ((newWeekRows - orgWeekRows) * rowHeight));\r\n // Puh, I'm glad it's done\r\n\r\n let count = 0;\r\n\r\n if (direction === Direction.Jump) {\r\n this.Parent.RootElement.innerHTML = '';\r\n }\r\n\r\n for (const elem of $(this.Parent.RootElement).find('.axp__month')) {\r\n $(elem).css('min-width', `${elem.getBoundingClientRect().width}px`);\r\n }\r\n\r\n for (let entry of newEntries) {\r\n switch (direction) {\r\n case Direction.Forward:\r\n case Direction.Jump:\r\n this.Parent.RootElement.appendChild(entry);\r\n break;\r\n case Direction.Backward:\r\n this.Parent.RootElement.style.marginLeft = \"-100%\";\r\n this.Parent.RootElement.insertBefore(entry, this.Parent.RootElement.children[count]);\r\n break;\r\n default:\r\n console.log(`Unsupported direction.`);\r\n }\r\n count++;\r\n }\r\n\r\n this.SwitchMonth(direction, newHeight);\r\n }\r\n\r\n public SwitchMonth(direction: Direction, height: number) {\r\n\r\n let margin = 0;\r\n\r\n switch (direction) {\r\n case Direction.Forward:\r\n margin = 100 * -1;\r\n break;\r\n case Direction.Backward:\r\n case Direction.Jump:\r\n margin = 100 * 0;\r\n break;\r\n }\r\n\r\n let animateProperties: JQuery.PlainObject = {\r\n 'marginLeft': `${margin}%`,\r\n };\r\n\r\n if (height !== 0) {\r\n animateProperties.height = `${height}px`;\r\n }\r\n \r\n $(this.Parent.RootElement).animate(animateProperties, this.AnimationDuration, 'linear', () => {\r\n if (direction == Direction.Forward) {\r\n for (let i = 0; i < this.Parent.monthsShown; i++) {\r\n this.Parent.RootElement.removeChild(this.Parent.RootElement.firstChild);\r\n }\r\n } else if (direction == Direction.Backward) {\r\n for (let i = 0; i < this.Parent.monthsShown; i++) {\r\n this.Parent.RootElement.removeChild(this.Parent.RootElement.lastChild);\r\n }\r\n }\r\n\r\n\r\n this.Parent.CleanUpCells();\r\n this.Parent.RootElement.parentElement.style.width = \"\";\r\n this.Parent.RootElement.parentElement.style.maxWidth = \"\";\r\n this.Parent.RootElement.parentElement.style.minWidth = \"\";\r\n this.Parent.RootElement.style.marginLeft = \"0\";\r\n this.InAnimation = false;\r\n\r\n for (const elem of $(this.Parent.RootElement).find('.axp__month')) {\r\n $(elem).css('min-width', null);\r\n }\r\n\r\n if (this.Parent.Options.AfterChange != null) {\r\n this.Parent.Options.AfterChange(this.Parent.CurrentStartDate, this.Parent.CurrentEndDate);\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport enum Direction {\r\n Forward,\r\n Backward,\r\n Jump\r\n}", "import { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { AxDatePicker, Cell, Mode } from \"./AxDatepicker\";\r\nimport { Direction } from \"./EventHelper\";\r\n\r\nconst axDatePickerResizeObserver = new ResizeObserver(entries => {\r\n for (let entry of entries) {\r\n let target = entry.target;\r\n\r\n let weekWrapper = target.querySelectorAll('.axp__week-Wrapper');\r\n let sampleDaySize = target.querySelector('.axp__row_inner')?.scrollWidth ?? 0;\r\n\r\n weekWrapper.forEach((e: HTMLElement, i, p) => {\r\n e.style.gridTemplateRows = `${sampleDaySize}px`;\r\n });\r\n }\r\n});\r\n\r\nexport class RenderHelper {\r\n private Datepicker: AxDatePicker;\r\n private LoadingTimeout;\r\n private TmpLoadingIndicator: HTMLElement;\r\n\r\n constructor(private _AxLoading = new AxLoading()) {\r\n\r\n }\r\n\r\n Init(datePicker: AxDatePicker) {\r\n this.Datepicker = datePicker;\r\n\r\n let tbl: HTMLElement = this.Datepicker.parentElement;\r\n\r\n if (tbl == null) {\r\n console.warn(`Init AxDatePicker failed, selector ${this.Datepicker.Options.Target} doesn't exist`);\r\n return;\r\n }\r\n\r\n this.Datepicker.Cells = [];\r\n\r\n let calendarWrapper = document.createElement(\"div\");\r\n calendarWrapper.classList.add(\"axp__calendarWrapper\");\r\n\r\n tbl.appendChild(calendarWrapper);\r\n\r\n let calendarSlider = document.createElement(\"div\");\r\n calendarSlider.classList.add(\"axp__calendarSlider\");\r\n\r\n if (this.Datepicker.Options.Mode == Mode.Endless) {\r\n calendarWrapper.classList.add('axp__calendarWrapper--endless');\r\n (document.querySelector(this.Datepicker.Options.LegendTarget) || calendarWrapper).appendChild(this.GetDayLegend());\r\n axDatePickerResizeObserver.observe(calendarWrapper);\r\n }\r\n\r\n this.Datepicker.RootElement = calendarSlider;\r\n\r\n calendarWrapper.appendChild(calendarSlider);\r\n\r\n //this.Datepicker.CurrentDate = (moment(this.Datepicker.Options.StartDate) || moment());\r\n\r\n this.RenderCalendar().then(newEntries => {\r\n for (let entry of newEntries) {\r\n this.Datepicker.RootElement.appendChild(entry);\r\n }\r\n this.ClearLoadingIndicators();\r\n this.Datepicker.AfterRender();\r\n });\r\n }\r\n\r\n private SetDateRanges(month: number, year: number) {\r\n this.Datepicker.CurrentStartDate = moment(year + '-' + month + '-01 00:00:00', \"YYYY-MM-DD HH:mm:ss\");\r\n this.Datepicker.CurrentEndDate = moment(this.Datepicker.CurrentStartDate).add(this.Datepicker.monthsShown - 1, 'month').endOf('month');\r\n }\r\n\r\n\r\n RenderCalendar(): Promise<HTMLElement[]> {\r\n\r\n let month = parseInt(this.Datepicker.CurrentDate.format('MM'));\r\n let year = parseInt(this.Datepicker.CurrentDate.format('YYYY'));\r\n\r\n this.SetDateRanges(month, year);\r\n\r\n if (this.Datepicker.Options.OnChange != null) {\r\n this.LoadingTimeout = setTimeout(x => {\r\n if (this.Datepicker.Options.Mode == Mode.Inline) {\r\n this._AxLoading.ShowLoadingIndicator(this.Datepicker.RootElement);\r\n } else if (this.Datepicker.Options.Mode == Mode.Endless) {\r\n this.TmpLoadingIndicator = document.createElement(\"div\");\r\n this.TmpLoadingIndicator.classList.add('axp__loadingInd');\r\n this._AxLoading.ShowLoadingIndicator(this.TmpLoadingIndicator);\r\n this.Datepicker.RootElement.appendChild(this.TmpLoadingIndicator);\r\n this.TmpLoadingIndicator.scrollIntoView();\r\n }\r\n }, 500);\r\n\r\n return new Promise<HTMLElement[]>((resolve, reject) => {\r\n this.Datepicker.Options.OnChange(this.Datepicker.CurrentStartDate, this.Datepicker.CurrentEndDate).then(x => {\r\n resolve(this.RenderCalendarSync());\r\n });\r\n });\r\n }\r\n\r\n return new Promise<HTMLElement[]>((resolve, reject) => {\r\n resolve(this.RenderCalendarSync());\r\n });\r\n }\r\n\r\n ClearLoadingIndicators() {\r\n clearTimeout(this.LoadingTimeout)\r\n this._AxLoading.HideLoadingIndicator(this.Datepicker.RootElement);\r\n\r\n if (this.TmpLoadingIndicator != null) {\r\n this.TmpLoadingIndicator.remove();\r\n }\r\n }\r\n\r\n RenderCalendarSync(): HTMLElement[] {\r\n this.ClearLoadingIndicators();\r\n\r\n let month = parseInt(this.Datepicker.CurrentDate.format('MM'));\r\n let year = parseInt(this.Datepicker.CurrentDate.format('YYYY'));\r\n\r\n let newEntries: HTMLElement[] = [];\r\n if (this.Datepicker.Options.EndDate == null || moment(year + '-' + month + '-01 00:00:00', \"YYYY-MM-DD HH:mm:ss\") < this.Datepicker.Options.EndDate) {\r\n for (let h = 0; h < this.Datepicker.monthsShown; h++) {\r\n let monthEntry = this.RenderMonth(month, year, h);\r\n\r\n if (monthEntry != null) {\r\n newEntries.push(monthEntry);\r\n\r\n year = (month === 12) ? year + 1 : year;\r\n month = (month + 1) % 12;\r\n\r\n if (month == 0) {\r\n month = 12;\r\n }\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return newEntries;\r\n }\r\n\r\n GetDayLegend(): HTMLElement {\r\n let innerHead: HTMLElement = document.createElement('div');\r\n innerHead.classList.add(\"axp__cell-header\");\r\n\r\n for (let j = (0 + this.Datepicker.Options.StartOfWeek); j < (7 + this.Datepicker.Options.StartOfWeek); j++) {\r\n\r\n let weekdayName = moment().isoWeekday(j).format('dd').toUpperCase();\r\n let cellElem = document.createElement(\"div\");\r\n let cellText = document.createTextNode(weekdayName);\r\n cellElem.appendChild(cellText);\r\n innerHead.appendChild(cellElem);\r\n }\r\n\r\n return innerHead;\r\n }\r\n\r\n\r\n AddText(cell: Cell) {\r\n let child = cell.Element.querySelector('.axp__cell-text');\r\n\r\n if (child == null && cell.Text != '') {\r\n let addText: HTMLElement = document.createElement('div');\r\n addText.innerText = cell.Text;\r\n addText.classList.add(\"axp__cell-text\");\r\n\r\n cell.Element.querySelector('* > div:first-child').appendChild(addText);\r\n } else if (child != null && cell.Text != '') {\r\n child.innerHTML = cell.Text;\r\n } else if (child != null) {\r\n cell.Element.removeChild(child);\r\n }\r\n }\r\n\r\n\r\n RemoveText(cell: Cell) {\r\n let child = cell.Element.querySelector('.axp__cell-text');\r\n\r\n if (child != null) {\r\n child.remove();\r\n }\r\n }\r\n\r\n renderNavigatorArrows(direction: Direction, monthHeader: HTMLDivElement) {\r\n\r\n let monthNavigator = document.createElement(\"div\");\r\n monthNavigator.classList.add(\"axp__month-navigator\");\r\n monthNavigator.classList.add(direction == Direction.Backward ? \"axp__month-navigator--back\" : \"axp__month-navigator--next\");\r\n this.Datepicker.EventHelper.AddNavigatorEvents(monthNavigator, direction);\r\n monthHeader.appendChild(monthNavigator);\r\n }\r\n\r\n RenderMonth(month: number, year: number, index: number): HTMLElement {\r\n let monthWrapper = document.createElement(\"div\");\r\n monthWrapper.classList.add(\"axp__month\");\r\n\r\n let dt: moment.Moment = moment(year + '-' + month + '-01 00:00:00', \"YYYY-MM-DD HH:mm:ss\");\r\n let dateTemp: moment.Moment;\r\n\r\n if (moment(this.Datepicker.Options.StartDate).startOf(\"month\") > dt) {\r\n return null;\r\n }\r\n\r\n let currentWeek: number = parseInt(dt.format('w'));\r\n\r\n let monthHeader = document.createElement(\"div\");\r\n monthHeader.classList.add(\"axp__month-header\");\r\n\r\n monthHeader.innerHTML = dt.format(\"MMMM YYYY\");\r\n monthHeader.setAttribute('data-name', dt.format(\"MMMM\"));\r\n monthHeader.id = `axp__month--${dt.format(\"MM\")}-${dt.format(\"YYYY\")}`;\r\n\r\n if (this.Datepicker.Options.Mode == Mode.Inline && index == 0) {\r\n this.renderNavigatorArrows(Direction.Backward, monthHeader);\r\n }\r\n\r\n if (this.Datepicker.Options.Mode == Mode.Inline && this.Datepicker.monthsShown - 1 == index) {\r\n this.renderNavigatorArrows(Direction.Forward, monthHeader);\r\n }\r\n\r\n monthWrapper.appendChild(monthHeader);\r\n\r\n let startOfWeekTemp: moment.Moment = dt.startOf('week');\r\n\r\n let cell: HTMLElement = document.createElement(\"div\");\r\n\r\n let monthDays = document.createElement(\"div\");\r\n monthDays.classList.add(\"axp__day-wrapper\");\r\n\r\n\r\n if (this.Datepicker.Options.Mode == Mode.Inline) {\r\n monthDays.appendChild(this.GetDayLegend());\r\n }\r\n\r\n //Searching for the Correct Week for the this month?\r\n while (parseInt(startOfWeekTemp.format('DD')) >= 2 && parseInt(startOfWeekTemp.format('MM')) == month) {\r\n dateTemp = dt.add(-1, 'd');\r\n currentWeek = parseInt(dateTemp.format('w'));\r\n\r\n startOfWeekTemp = moment().isoWeekYear(parseInt(dateTemp.format('YYYY'))).isoWeek(currentWeek).startOf('week');\r\n }\r\n\r\n //Iterate 6 Weeks\r\n for (let i = 0; i < 6; i++) {\r\n let weekWrapper = document.createElement(\"div\");\r\n weekWrapper.classList.add(\"axp__week-Wrapper\");\r\n let startOfWeek = startOfWeekTemp;\r\n\r\n //Iterate 7 Days\r\n for (let j = 0; j < 7; j++) {\r\n let displayDate: moment.Moment = startOfWeek;\r\n\r\n let innerDay: HTMLElement = document.createElement('div');\r\n innerDay.classList.add(\"axp__row_inner\");\r\n innerDay.classList.add(\"axp__cell\");\r\n\r\n cell = document.createElement(\"div\");\r\n let dateHolder: HTMLElement = document.createElement(\"div\");\r\n\r\n let dayRange = this.Datepicker.Options.DayRange || 0;\r\n\r\n let nextYear: number = parseInt(displayDate.format('YYYY'));\r\n let cellObj: Cell = {\r\n Active: false,\r\n Date: moment(startOfWeek),\r\n Element: cell,\r\n Text: '',\r\n DayRange: dayRange,\r\n InRange: false\r\n };\r\n\r\n let blockedDays = this.Datepicker.Options.BlockedDates;\r\n\r\n let availableDates = this.Datepicker.Options.AvailableDates;\r\n let onlyDateSelection = this.Datepicker.Options.OnlySelectDates;\r\n\r\n if ((i === 0 && parseInt(displayDate.format('M')) < month) || nextYear > year && parseInt(displayDate.format('M')) < month ||\r\n parseInt(displayDate.format('M')) > month) {\r\n innerDay.classList.add(\"axp__cell-invisible\");\r\n } else if ((this.Datepicker.Options.EndDate != null && startOfWeek > this.Datepicker.Options.EndDate) ||\r\n displayDate.format('YYYY-MM-DD') < this.Datepicker.Options.StartDate.format('YYYY-MM-DD')) {\r\n innerDay.classList.add(\"axp__cell-inactive\");\r\n } else if (!onlyDateSelection && ((blockedDays != null && blockedDays.length != 0 && blockedDays.findIndex(x => x.isSame(displayDate)) != -1)\r\n || (availableDates != null && (availableDates.length == 0 || availableDates.findIndex(x => x.isSame(displayDate)) == -1)))) {\r\n innerDay.classList.add(\"axp__cell-inactive\");\r\n innerDay.classList.add(\"axp__cell-blocked\");\r\n } else {\r\n if (displayDate.format('YYYY-MM-DD') == this.Datepicker.Today.format('YYYY-MM-DD')) {\r\n innerDay.classList.add(\"axp__cell_dateholder-currentdate\");\r\n }\r\n\r\n cell.setAttribute(\"data-date\", displayDate.format('YYYY-MM-DD'));\r\n this.Datepicker.EventHelper.AddDayActivation(cellObj);\r\n }\r\n let dayNum = document.createElement(\"span\");\r\n dayNum.appendChild(document.createTextNode(displayDate.format('D')));\r\n dateHolder.appendChild(dayNum);\r\n\r\n cell.appendChild(dateHolder);\r\n innerDay.appendChild(cell);\r\n\r\n if (!innerDay.classList.contains(\"axp__cell-invisible\")) {\r\n this.Datepicker.Cells.push(cellObj);\r\n }\r\n\r\n //if (this.Datepicker.Options.CurrentDate != null &&\r\n // this.Datepicker.Options.CurrentDate != undefined &&\r\n // this.Datepicker.Options.CurrentDate.isSame(startOfWeek)) {\r\n\r\n // this.Datepicker.ActionHelper.ActivateDay(cellObj, this.Datepicker);\r\n //}\r\n\r\n startOfWeek.add(1, 'd');\r\n\r\n weekWrapper.appendChild(innerDay);\r\n }\r\n monthDays.appendChild(weekWrapper);\r\n\r\n currentWeek++;\r\n if (parseInt(startOfWeek.format('MM')) > month || parseInt(startOfWeek.format('YYYY')) > year) {\r\n break;\r\n }\r\n }\r\n monthWrapper.appendChild(monthDays);\r\n this.LoadCachedTextEntries();\r\n return monthWrapper;\r\n }\r\n\r\n LoadCachedTextEntries() {\r\n if (this.Datepicker.Cells != null) {\r\n for (let cell of this.Datepicker.Cells) {\r\n this.Datepicker.ActionHelper.LoadCachedText(cell.Date, this.Datepicker);\r\n }\r\n }\r\n }\r\n}", "import { BehaviorSubject, Observable } from \"rxjs\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxPEventHelper } from \"./EventHelper\";\r\nimport { InteractionHelper } from \"./InteractionHelper\";\r\nimport { RenderHelper } from \"./RenderHelper\";\r\n\r\nexport enum Mode {\r\n Inline,\r\n Endless\r\n}\r\n\r\nexport class Options {\r\n StartOfWeek: number = 1;\r\n Lang: string = 'en';\r\n StartDate: moment.Moment;\r\n EndDate?: moment.Moment;\r\n\r\n Target: string | HTMLElement = '#ax-datepicker';\r\n Mode: Mode;\r\n\r\n LegendTarget?: string;\r\n BlockedDates?: moment.Moment[];\r\n AvailableDates?: moment.Moment[];\r\n OnlySelectDates?: boolean = false;\r\n DayRange?: number;\r\n monthsShown?: number = 2;\r\n scrollTargetQuerySelector?: string = null\r\n\r\n OnChange?: (startDate: moment.Moment, endDate: moment.Moment) => Promise<void>;\r\n AfterChange?: (startDate: moment.Moment, endDate: moment.Moment) => void;\r\n};\r\n\r\nexport class AxDatePicker {\r\n public Options: Options;\r\n public Cells: Cell[];\r\n\r\n public Today: moment.Moment = moment();\r\n\r\n public RootElement: HTMLElement;\r\n public monthsShown: number = 2;\r\n\r\n public CurrentDate: moment.Moment;\r\n public CurrentStartDate: moment.Moment;\r\n public CurrentEndDate: moment.Moment;\r\n\r\n public parentElement: HTMLElement;\r\n\r\n public RenderEndless = false;\r\n\r\n constructor(public RenderH = new RenderHelper(),\r\n public EventHelper = new AxPEventHelper(),\r\n public ActionHelper: InteractionHelper = new InteractionHelper()) { }\r\n\r\n public ActivationSubject = new BehaviorSubject<Cell>(null);\r\n\r\n Init(options?: Options) {\r\n if (options != null) {\r\n this.Options = options;\r\n }\r\n\r\n //@ts-ignore\r\n let potentialTargets = $(this.Options.Target);\r\n if (potentialTargets.length > 0) {\r\n this.parentElement = potentialTargets[0];\r\n }\r\n\r\n this.monthsShown = this.Options.monthsShown ?? this.monthsShown;\r\n\r\n moment.lang(this.Options.Lang);\r\n moment.updateLocale(this.Options.Lang, {\r\n week: {\r\n dow: this.Options.StartOfWeek\r\n }\r\n });\r\n\r\n this.Today = moment();\r\n this.Today.set({ hour: 0, minute: 0, second: 0, millisecond: 0 });\r\n\r\n this.CurrentDate = (moment(this.Options.StartDate) || moment());\r\n\r\n this.EventHelper.Init(this);\r\n\r\n this.RenderH.Init(this);\r\n }\r\n\r\n setDate(date: moment.Moment, informSubscribers?: boolean) {\r\n this.CurrentDate = date;\r\n informSubscribers = informSubscribers ?? true;\r\n\r\n if (this.CurrentStartDate == null) return;\r\n\r\n if (this.CurrentStartDate.month() !== date.month()) {\r\n this.EventHelper.setDate(date);\r\n }\r\n this.ActionHelper.ActivateDay(this.ActionHelper.findCell(date, this), this, informSubscribers);\r\n }\r\n\r\n resetDateSelection() {\r\n this.ActionHelper.unsetDate(this, true);\r\n }\r\n\r\n DismissDatePicker() {\r\n $(this.parentElement).html(\"\");\r\n }\r\n\r\n BlockDate(date: moment.Moment) {\r\n this.ActionHelper.BlockDate(date, this);\r\n }\r\n\r\n UnblockDate(date: moment.Moment) {\r\n this.ActionHelper.UnblockDate(date, this);\r\n }\r\n\r\n AddText(date: moment.Moment, text: string) {\r\n this.ActionHelper.AddText(date, text, this);\r\n }\r\n\r\n RemoveText(date: moment.Moment, removeCache?: boolean) {\r\n this.ActionHelper.RemoveText(date, this, removeCache || false);\r\n }\r\n\r\n RemoveAllText(removeCache?: boolean) {\r\n this.ActionHelper.RemoveAllText(this, removeCache || false);\r\n }\r\n\r\n FillEmptyText() {\r\n this.ActionHelper.FillEmptyText(this);\r\n }\r\n\r\n CleanUpCells() {\r\n this.Cells = this.Cells.filter(x => this.RootElement.contains(x.Element));\r\n }\r\n\r\n\r\n public AfterRender() {\r\n if (this.Options.Mode == Mode.Endless) {\r\n if (this.Options.scrollTargetQuerySelector != null) {\r\n document.querySelector(this.Options.scrollTargetQuerySelector).addEventListener(\"scroll\", ev => {\r\n this.HeightCheck();\r\n });\r\n } else {\r\n this.parentElement.addEventListener(\"scroll\", ev => {\r\n this.HeightCheck();\r\n });\r\n }\r\n\r\n\r\n window.addEventListener(\"resize\", ev => {\r\n this.HeightCheck();\r\n });\r\n\r\n this.HeightCheck();\r\n }\r\n }\r\n\r\n public HeightCheck() {\r\n //TBH I have no idea what I'm doing but I think it works\r\n if (this.Options.Mode == Mode.Endless) {\r\n let scrollTarget: HTMLElement;\r\n\r\n if (this.Options.scrollTargetQuerySelector != null) {\r\n scrollTarget = document.querySelector(this.Options.scrollTargetQuerySelector);\r\n } else {\r\n scrollTarget = this.parentElement;\r\n }\r\n\r\n if ((this.Options.EndDate == null || this.CurrentDate <= this.Options.EndDate) && !this.RenderEndless && (Math.ceil(scrollTarget.offsetHeight + scrollTarget.scrollTop)) >= this.RootElement.offsetHeight) {\r\n this.RenderEndless = true;\r\n this.ActionHelper.Next(this, (a, b) => {\r\n for (let month of a) {\r\n this.RootElement.appendChild(month);\r\n }\r\n if (this.Options.AfterChange != null) {\r\n this.Options.AfterChange(this.CurrentStartDate, this.CurrentEndDate);\r\n }\r\n this.RenderEndless = false;\r\n });\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport interface Cell {\r\n Element: HTMLElement;\r\n Active: boolean;\r\n InRange: boolean;\r\n Date: moment.Moment;\r\n Text: string;\r\n DayRange: number;\r\n}", "import { AxDatePicker, Cell, Mode } from \"../../../Components/AxDatepicker/AxDatepicker\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\nimport { InitData, TicketList } from \"../../../Components/ProductList/TicketList\";\r\nimport { I18nHelper, Translations } from \"../../../Lib/Helper/I18nHelper\";\r\nimport { ProgressBar, ProgressBarMode } from \"../../Global/Progressbar\";\r\nimport { SummaryRedirect } from \"../../../Lib/Helper/AxProdSelection/SummaryRedirect\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { PackageMinMaxConstraint, CheckMinMaxConstraintResult } from \"../../Packages/PackageMinMaxConstraint\";\r\n\r\nexport abstract class PreDateable {\r\n protected ActivateDate: moment.Moment = null;\r\n protected QuantityOK: boolean;\r\n\r\n protected PostURL: string;\r\n protected CheckDateURL: string;\r\n protected DatePicker: AxDatePicker;\r\n protected DatePickerMobile: AxDatePicker;\r\n protected DatePattern: string;\r\n\r\n protected DateDropdown: AxDropdown = new AxDropdown();\r\n protected AvailableDateList: DateList[] = [];\r\n\r\n protected ContingentMode: boolean = false;\r\n\r\n private ShowPriceInCalendar: boolean = false;\r\n private CultureInfo: any;\r\n\r\n constructor(protected _summaryRedirect = new SummaryRedirect(),\r\n protected _Progressbar = new ProgressBar(),\r\n protected _TicketList = new TicketList(),\r\n protected _I18nHelper = new I18nHelper()\r\n ) { }\r\n\r\n Init(initData: AxProdInitData) {\r\n this.PostURL = initData.PostURL;\r\n this.CheckDateURL = initData.CheckDateLink;\r\n\r\n this.DatePattern = initData.DatePatternYear;\r\n this.CultureInfo = initData.CultureInfo;\r\n\r\n this._Progressbar.Init({\r\n Mode: ProgressBarMode.Default,\r\n Progress: 0\r\n });\r\n\r\n this.DatePicker = new AxDatePicker();\r\n this.DatePickerMobile = new AxDatePicker();\r\n\r\n this.DateDropdown.init('.prod_selection__date-selection .ax-dropdown');\r\n let endDate = initData.EndDate != null ? moment(initData.EndDate, \"YYYY-MM-DD\") : null;\r\n\r\n this.DatePicker.Init({\r\n StartOfWeek: initData.StartOfWeek,\r\n Lang: initData.Lang,\r\n StartDate: moment(initData.StartDate, \"YYYY-MM-DD\"),\r\n DayRange: initData.DayRange,\r\n Target: '#tariff_date',\r\n Mode: Mode.Inline,\r\n EndDate: endDate,\r\n OnChange: (x, y) => { return this.OnChangeDate(x, y) }\r\n });\r\n\r\n this.DatePickerMobile.Init({\r\n StartOfWeek: initData.StartOfWeek,\r\n Lang: initData.Lang,\r\n StartDate: moment(initData.StartDate, \"YYYY-MM-DD\"),\r\n DayRange: initData.DayRange,\r\n Target: '#tariff_date_mobile',\r\n Mode: Mode.Endless,\r\n LegendTarget: '#tariff_date_mobile__legend',\r\n EndDate: endDate,\r\n OnChange: (x, y) => { return this.OnChangeDate(x, y) }\r\n });\r\n\r\n this._TicketList.Init(initData);\r\n\r\n this.DatePicker.ActivationSubject.subscribe(x => this.CheckDate(x));\r\n this.DatePickerMobile.ActivationSubject.subscribe(x => this.CheckDate(x));\r\n\r\n this._TicketList.QuantityOkSubject.subscribe(x => {\r\n this.QuantityOK = x;\r\n this.CheckSubmit();\r\n\r\n });\r\n\r\n this._TicketList.QuantityChange.subscribe(x => {\r\n if (this.ContingentMode) {\r\n for (let tmp of this.AvailableDateList) {\r\n let date = moment(tmp.Date, 'YYYY-MM-DD');\r\n if (tmp.Contingent && tmp.Available >= x) {\r\n this.DatePicker.UnblockDate(date);\r\n this.DatePickerMobile.UnblockDate(date);\r\n } else {\r\n this.DatePicker.BlockDate(date);\r\n this.DatePickerMobile.BlockDate(date);\r\n }\r\n }\r\n }\r\n\r\n this.UpdateCalendarText(this.AvailableDateList);\r\n });\r\n\r\n\r\n this.QuantityOK = this._TicketList.QuantityOkSubject.getValue();\r\n\r\n $('.prod_selection__prod-save').click(x => {\r\n $('.prod_selection__prod-close').click();\r\n });\r\n }\r\n\r\n OnChangeDate(startDate: moment.Moment, endDate: moment.Moment): Promise<void> {\r\n return new Promise<void>((res, rej) => {\r\n AxessViewer.loadPartialView(this.CheckDateURL, {\r\n from: startDate.format('YYYY-MM-DD'),\r\n to: endDate.format('YYYY-MM-DD')\r\n }, (z: DateList[]) => {\r\n\r\n let availableDates: moment.Moment[] = [];\r\n this.ContingentMode = this.ContingentMode || z.filter(x => x.Contingent).length != 0;\r\n\r\n for (let tmpDate of z) {\r\n if (!this.ContingentMode || tmpDate.Contingent) {\r\n let date = moment(tmpDate.Date, 'YYYY-MM-DD');\r\n availableDates.push(date);\r\n }\r\n }\r\n\r\n for (let dateEntry of z) {\r\n if (this.AvailableDateList.find(x => x.Date == dateEntry.Date) == null) {\r\n this.AvailableDateList.push(dateEntry);\r\n }\r\n }\r\n\r\n this.UpdateCalendarText(z);\r\n\r\n this.DatePicker.Options.AvailableDates = availableDates;\r\n this.DatePickerMobile.Options.AvailableDates = availableDates;\r\n res();\r\n }, { silent: true, addCulturInfo: false });\r\n });\r\n }\r\n\r\n UpdateCalendarText(dateList: DateList[]) {\r\n let lastPriceList: PriceList[] = [];\r\n\r\n if (!this.ShowPriceInCalendar) {\r\n for (let tmpDate of dateList) {\r\n for (let priceEntry of tmpDate.TariffList) {\r\n if (lastPriceList.find(x => x.SubProductIdentifier == priceEntry.SubProductIdentifier) == null) {\r\n lastPriceList.push(priceEntry);\r\n continue;\r\n }\r\n\r\n let compareEntry = lastPriceList.find(x => x.SubProductIdentifier == priceEntry.SubProductIdentifier);\r\n if (compareEntry.Price != priceEntry.Price) {\r\n this.ShowPriceInCalendar = true;\r\n break;\r\n }\r\n }\r\n\r\n if (this.ShowPriceInCalendar) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n let totalQuantity = this._TicketList.GetQuantity();\r\n if (this.ShowPriceInCalendar && totalQuantity > 0) {\r\n for (let tmpDate of dateList) {\r\n let date = moment(tmpDate.Date, 'YYYY-MM-DD');\r\n this.ShowPriceInCalendar = true;\r\n let totalAmount: number = 0;\r\n\r\n for (let prod of this._TicketList.ProductList.filter(x => x.Quantity > 0)) {\r\n let dateEntry = tmpDate.TariffList.find(x => x.SubProductIdentifier == prod.SubProductIdentifier);\r\n totalAmount += (prod.Quantity * this._TicketList.GetPrice(dateEntry.Price));\r\n }\r\n let price = this._TicketList.GetPriceStringWithCurrencySymbol(totalAmount).replace(`${this.CultureInfo.currencyDecimalSeparator}00`, '');\r\n this.DatePicker.AddText(date, price);\r\n this.DatePickerMobile.AddText(date, price);\r\n }\r\n this.DatePicker.FillEmptyText();\r\n this.DatePickerMobile.FillEmptyText();\r\n } else if (totalQuantity <= 0) {\r\n this.DatePicker.RemoveAllText();\r\n this.DatePickerMobile.RemoveAllText();\r\n }\r\n }\r\n\r\n CheckPriceChangeOnDateChange(cell: Cell) {\r\n let dayPriceList = this.AvailableDateList.find(x => x.Date == cell.Date.format('YYYY-MM-DD'));\r\n let priceChange = false;\r\n if (dayPriceList != null) {\r\n for (let prod of this._TicketList.ProductList) {\r\n let cellTariff = dayPriceList.TariffList.find(x => x.SubProductIdentifier == prod.SubProductIdentifier);\r\n\r\n if (cellTariff != null && cellTariff.Price != prod.Price) {\r\n priceChange = true;\r\n prod.Price = cellTariff.Price;\r\n prod.ForeignPrice = cellTariff.ForeignPrice;\r\n }\r\n }\r\n\r\n if (priceChange) {\r\n this._TicketList.AdjustTotalAmount(true);\r\n }\r\n }\r\n }\r\n\r\n CheckDate(x: Cell) {\r\n if (x != null) {\r\n this.ActivateDate = x.Date;\r\n let formatedDate = this.ActivateDate.format(this.DatePattern);\r\n this._TicketList.SetFromDateStringFormatted(formatedDate);\r\n this._TicketList.SetFromDate(x.Date);\r\n this.CheckPriceChangeOnDateChange(x);\r\n this.DateDropdown.setValue(formatedDate);\r\n $('.prod_selection__summary-date').html(formatedDate);\r\n } else {\r\n this.DateDropdown.resetSelection();\r\n this.ActivateDate = null;\r\n }\r\n this.CheckSubmit();\r\n }\r\n\r\n CheckSubmit(): boolean {\r\n if (this.ActivateDate != null) {\r\n $('.prod_selection__prod-save').removeAttr('disabled');\r\n\r\n if (this.ContingentMode) {\r\n let dayEntry = this.AvailableDateList.find(x => moment(x.Date, 'YYYY-MM-DD').isSame(this.ActivateDate));\r\n if (dayEntry != null) {\r\n $('.prod_selection__prod-contingentCount').html(this._I18nHelper.GetTranslation(Translations.CountAvailable, dayEntry.Available));\r\n }\r\n }\r\n } else {\r\n $('.prod_selection__prod-contingentCount').html('');\r\n $('.prod_selection__prod-save').attr('disabled', 'disabled');\r\n }\r\n\r\n if (!$('.prod_selection__persontype-submit').hasClass('Loading')) {\r\n this.setSubmitButtonState();\r\n }\r\n return this.ActivateDate != null && this.QuantityOK;\r\n }\r\n\r\n setSubmitButtonState() {\r\n let checkMinMaxConstraintResult = new CheckMinMaxConstraintResult();\r\n\r\n let minMaxConstraintModule = AxLoad.GetModule<PackageMinMaxConstraint>('PackageMinMaxConstraint');\r\n\r\n if (minMaxConstraintModule != null) {\r\n checkMinMaxConstraintResult = minMaxConstraintModule.CheckMinMaxConstraint(this._TicketList.GetQuantity());\r\n } else {\r\n checkMinMaxConstraintResult.minMaxOk = true;\r\n }\r\n\r\n if (this.QuantityOK && this.ActivateDate != null && checkMinMaxConstraintResult.minMaxOk) {\r\n $('.prod_selection__persontype-submit').removeAttr('disabled');\r\n $('.prod_selection__summary').toggle(true);\r\n $('.prod_selection__persontype-submit').html(this._I18nHelper.GetTranslation(Translations.Next));\r\n } else {\r\n $('.prod_selection__persontype-submit').attr('disabled', 'disabled');\r\n $('.prod_selection__summary').toggle(false);\r\n\r\n if (!checkMinMaxConstraintResult.minMaxOk) {\r\n $('.prod_selection__persontype-submit').html(checkMinMaxConstraintResult.errorMessage);\r\n } else {\r\n $('.prod_selection__persontype-submit').html(this._I18nHelper.GetTranslation(Translations.Next));\r\n }\r\n }\r\n }\r\n\r\n abstract ToSummary(): void;\r\n}\r\n\r\nexport interface AxProdInitData extends InitData {\r\n StartOfWeek: number;\r\n Lang: string;\r\n StartDate: string;\r\n EndDate?: string;\r\n PostURL: string;\r\n DatePattern: string;\r\n DatePatternYear: string;\r\n CheckDateLink: string;\r\n DayRange: number;\r\n}\r\n\r\ninterface DateList {\r\n Date: string,\r\n Contingent: boolean,\r\n Available: number;\r\n Max: number;\r\n TariffList: PriceList[];\r\n}\r\n\r\ninterface PriceList {\r\n SubProductIdentifier: number; //PersonTypeNr, PackagePosNr\r\n Price: number;\r\n ForeignPrice: number;\r\n}", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { ProductMapper } from \"../../../Lib/Mapper/ProductMapper\";\r\nimport { AxLimeStone } from \"../../../Limestone/AxLimeStone\";\r\nimport { IAddToCartRequest } from \"../../../Models/Package/IAddToCartRequest\";\r\nimport { AxProdInitData, PreDateable } from \"../Abstraction/PreDateable\";\r\n\r\n@ModuleName(\"AxPackPredateable\")\r\nexport class AxPackPredateable extends PreDateable implements AxInit {\r\n private ProjNr: number;\r\n private TariffSheetNr: number;\r\n private PackageNr: number;\r\n\r\n\r\n constructor(private _ProductMapper = new ProductMapper(),\r\n private _AxLimestone = new AxLimeStone()) {\r\n super();\r\n }\r\n\r\n AxInit(initData: AxProdInitData): void {\r\n this.ProjNr = initData.ProjNr;\r\n this.TariffSheetNr = initData.ProductGroupIdentifier;\r\n this.PackageNr = initData.Id;\r\n\r\n this.Init(initData);\r\n\r\n $('.prod_selection__persontype-submit').click(e => {\r\n this._AxLimestone.LockButton(e.delegateTarget);\r\n this.ToSummary();\r\n });\r\n }\r\n\r\n ToSummary(): void {\r\n if (this.CheckSubmit()) {\r\n let requestObj: IAddToCartRequest = {\r\n Date: this.ActivateDate.format('YYYY-MM-DD'),\r\n ProjNr: this.ProjNr,\r\n PackTariffSheetNo: this.TariffSheetNr,\r\n PackageNr: this.PackageNr,\r\n PackagePositions: this._ProductMapper.GetPackagePositionList(this._TicketList.ProductList),\r\n };\r\n this._summaryRedirect.redirect(this.PostURL, requestObj, false);\r\n }\r\n }\r\n}\r\n", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { ProductMapper } from \"../../../Lib/Mapper/ProductMapper\";\r\nimport { AxLimeStone } from \"../../../Limestone/AxLimeStone\";\r\nimport { AxProdNonPredateableInit, NonPreDateable } from \"../Abstraction/NonPreDateable\";\r\nimport { IAddToCartRequest } from \"../../../Models/Tickets/IAddToCartRequest\";\r\n\r\n@ModuleName(\"AxProdNonPredateable\")\r\nexport class AxProdNonPredateable extends NonPreDateable implements AxInit {\r\n public ProjNr: number;\r\n public PoolNr: number;\r\n public TicketTypeNr: number;\r\n\r\n constructor(private _ProductMapper = new ProductMapper(),\r\n private _AxLimestone = new AxLimeStone()) { super(); }\r\n\r\n AxInit(initData: AxProdNonPredateableInit): void {\r\n this.ProjNr = initData.ProjNr;\r\n this.PoolNr = initData.ProductGroupIdentifier;\r\n this.TicketTypeNr = initData.Id;\r\n\r\n $('.prod_selection__persontype-submit').click(e => {\r\n this._AxLimestone.LockButton(e.delegateTarget);\r\n this.ToSummary();\r\n });\r\n\r\n this.Init(initData);\r\n }\r\n\r\n ToSummary(): void {\r\n if (this._TicketList.ProductList.filter(x => x.Quantity > 0).length > 0) {\r\n let requestObj: IAddToCartRequest = {\r\n Date: moment().format('YYYY-MM-DD'),\r\n ProjNr: this.ProjNr,\r\n PoolNr: this.PoolNr,\r\n TicketTypeId: this.TicketTypeNr,\r\n PersonTypes: this._ProductMapper.GetPersonTypeList(this._TicketList.ProductList),\r\n };\r\n\r\n this._summaryRedirect.redirect(this.PostURL, requestObj, false);\r\n }\r\n }\r\n}\r\n", "import Swal from \"sweetalert2\";\r\nimport { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { ProductMapper } from \"../../../Lib/Mapper/ProductMapper\";\r\nimport { AxLimeStone } from \"../../../Limestone/AxLimeStone\";\r\nimport { IAddToCartRequest } from \"../../../Models/Tickets/IAddToCartRequest\";\r\nimport { AxProdInitData, PreDateable } from \"../Abstraction/PreDateable\";\r\nimport { Translations } from \"../../../Lib/Helper/I18nHelper\";\r\n\r\n@ModuleName(\"AxProdPredateable\")\r\nexport class AxProdPredateable extends PreDateable implements AxInit {\r\n private ProjNr: number;\r\n private PoolNr: number;\r\n private TicketTypeNr: number;\r\n\r\n\r\n constructor(private _ProductMapper = new ProductMapper(),\r\n private _AxLimestone = new AxLimeStone()) {\r\n super();\r\n }\r\n\r\n AxInit(initData: AxProdInitData): void {\r\n this.ProjNr = initData.ProjNr;\r\n this.PoolNr = initData.ProductGroupIdentifier;\r\n this.TicketTypeNr = initData.Id;\r\n\r\n this.Init(initData);\r\n\r\n $('.prod_selection__persontype-submit').click(e => {\r\n this._AxLimestone.LockButton(e.delegateTarget);\r\n this.CheckSelectedDate();\r\n });\r\n }\r\n\r\n CheckSelectedDate() {\r\n const currentDate = new Date();\r\n const momentInstance = moment(currentDate);\r\n if (this.ActivateDate.format('YYYY-MM-DD') < momentInstance.format('YYYY-MM-DD')) {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.WrongDay),\r\n text: this._I18nHelper.GetTranslation(Translations.WrongSelectedDay),\r\n icon: 'warning',\r\n showCancelButton: false,\r\n confirmButtonText: this._I18nHelper.GetTranslation(Translations.AdminClose)\r\n }).then((result) => {\r\n if (result.isConfirmed) {\r\n window.location.reload();\r\n }\r\n });\r\n }\r\n else {\r\n this.ToSummary();\r\n }\r\n }\r\n\r\n ToSummary(): void {\r\n if (this.CheckSubmit()) {\r\n let requestObj: IAddToCartRequest = {\r\n Date: this.ActivateDate.format('YYYY-MM-DD'),\r\n ProjNr: this.ProjNr,\r\n PoolNr: this.PoolNr,\r\n TicketTypeId: this.TicketTypeNr,\r\n PersonTypes: this._ProductMapper.GetPersonTypeList(this._TicketList.ProductList),\r\n };\r\n this._summaryRedirect.redirect(this.PostURL, requestObj, false);\r\n }\r\n\r\n }\r\n}\r\n", "export class Product {\r\n constructor(id: number, name: string, price: number, originalPrice: number, foreignPrice: number, quantity: number, subProductIdentifier: number, timeSlotGroupKeys: number[], listElement: HTMLElement, min?: number, max?: number) {\r\n this.Id = id;\r\n this.Name = name;\r\n this.Price = price;\r\n this.OriginalPrice = originalPrice;\r\n this.ForeignPrice = foreignPrice;\r\n this.Quantity = quantity;\r\n this.SubProductIdentifier = subProductIdentifier;\r\n this.ListElement = listElement;\r\n this.TimeSlotGroupKeys = timeSlotGroupKeys;\r\n\r\n this.Min = min;\r\n this.Max = max;\r\n }\r\n\r\n Id: number;\r\n Name: string;\r\n Price: number;\r\n OriginalPrice: number;\r\n ForeignPrice: number;\r\n Quantity: number;\r\n\r\n //PersonType, PackagePosNr\r\n SubProductIdentifier: number;\r\n\r\n Min?: number;\r\n Max?: number;\r\n Sort?: number;\r\n\r\n TimeSlotGroupKeys: number[];\r\n\r\n ListElement: HTMLElement;\r\n}", "import { BehaviorSubject, Subject } from 'rxjs';\r\nimport { BestMatchHandler } from '../../Components/BestMatch/BestMatchHandler';\r\nimport { AxInit, ModuleName } from '../../Lib/AxSystem/AxInit';\r\nimport { AxCounter } from '../../Limestone/AxCounter/AxCounter';\r\nimport { AxLimeStone } from '../../Limestone/AxLimeStone';\r\nimport { Product } from '../../Models/Tickets/Product';\r\nimport tippy from 'tippy.js';\r\n\r\n@ModuleName(\"AxProdSelection\")\r\nexport class AxProdSelection implements AxInit {\r\n\r\n private CultureInfo: any;\r\n private Divisor: number;\r\n\r\n public ProductList: Product[];\r\n public ProductListTmp: Product[];\r\n public InteractionSubject: BehaviorSubject<Element> = new BehaviorSubject(null);\r\n public SubmitSubject: Subject<Element> = new Subject<Element>();\r\n\r\n public ProjNr: number;\r\n public ProductGroupIdentifier: number;\r\n public Id: number;\r\n\r\n public Total: string;\r\n\r\n public Counter: AxCounter[] = [];\r\n public PillObeserver: IntersectionObserver;\r\n\r\n public foreignCurrency: string;\r\n\r\n private bestMatchHandler: BestMatchHandler;\r\n private selectedDate: moment.Moment;\r\n\r\n constructor(private _AxLimestone = new AxLimeStone()) { }\r\n\r\n AxInit(initData: AxProdSelectionInit) { \r\n this.ProjNr = initData.ProjNr;\r\n this.ProductGroupIdentifier = initData.ProductGroupIdentifier;\r\n this.Id = initData.Id;\r\n this.Divisor = initData.NumberDivisor;\r\n\r\n this.foreignCurrency = initData.ForeignCurrency;\r\n\r\n this.bestMatchHandler = new BestMatchHandler(initData.GetBestMatch, this.Divisor, \"div.prod_selection__betterMatch_holder\", \"div.prod_selection__betterMatch_packageName_holder\",\r\n \"div.prod_selection__betterMatch_betterPrice_holder\", \"span.prod_selection__original_SinglePrice\", \"div.prod_selection__calculatedPrice\");\r\n\r\n this.SetProductList(initData.CultureInfo, initData.NumberDivisor, initData.ProductList);\r\n this.SetProductListTmp(this.ProductList, false);\r\n\r\n for (let prod of initData.ProductList) {\r\n let axCounter = new AxCounter();\r\n axCounter.Init({\r\n Value: prod.Quantity,\r\n Selector: `.prod__counter_${prod.Id}`,\r\n Max: prod.Max,\r\n Min: prod.Min,\r\n });\r\n axCounter.Subscribe((x) => {\r\n if (this.ProductListTmp != null) {\r\n let existingEntry = this.ProductListTmp.find(x => x.SubProductIdentifier == prod.SubProductIdentifier);\r\n existingEntry.Quantity = x;\r\n\r\n this.AdjustTotalAmount();\r\n }\r\n });\r\n this.Counter.push(axCounter);\r\n }\r\n\r\n this.PillObeserver = new IntersectionObserver(\r\n ([e]) => {\r\n e.target.toggleAttribute('stuck', e.intersectionRatio < 1)\r\n },\r\n { threshold: [1] }\r\n );\r\n\r\n this.PillObeserver.observe(document.querySelector('.ax-pill_menu'));\r\n\r\n $('.prod_selection__selection-submit').click(e => {\r\n this._AxLimestone.LockButton(e.delegateTarget);\r\n this.SubmitSubject.next(this.InteractionSubject.getValue());\r\n });\r\n };\r\n\r\n getSelectedDate() {\r\n return this.selectedDate;\r\n }\r\n\r\n SetSelectedDate(date: moment.Moment) {\r\n this.selectedDate = date;\r\n }\r\n\r\n SetProductListTmp(productList: Product[], informSubscriber: boolean) {\r\n for (let prod of productList) {\r\n let existingEntry = this.ProductListTmp.find(x => x.SubProductIdentifier == prod.SubProductIdentifier);\r\n\r\n if (typeof existingEntry != 'undefined') {\r\n prod.Id = existingEntry.Id;\r\n prod.ListElement = existingEntry.ListElement;\r\n prod.Quantity = existingEntry.Quantity;\r\n prod.Sort = existingEntry.Sort;\r\n } else {\r\n prod.Quantity = 0;\r\n }\r\n }\r\n \r\n this.ProductListTmp = productList;\r\n this.AdjustTotalAmount(informSubscriber);\r\n }\r\n\r\n GetTotalQuantity(): number {\r\n let quantity: number = 0;\r\n for (let prod of this.ProductListTmp) {\r\n quantity += prod.Quantity;\r\n }\r\n\r\n return quantity;\r\n }\r\n\r\n SetProductList(cultureInfo: any, divisor: number, productList: Product[]) {\r\n this.CultureInfo = cultureInfo;\r\n this.Divisor = divisor;\r\n this.ProductList = productList;\r\n\r\n for (let prod of this.ProductList) {\r\n prod.ListElement = $('.prod_selection__prod-list')[prod.Id];\r\n }\r\n\r\n $('.prod_selection__selection-confirm').click(x => {\r\n $('#product_selection__setting_overlay').fadeToggle('fast');\r\n this.Apply();\r\n });\r\n\r\n $('.product_selection__setting_overlay--toggle').click(x => {\r\n this.Reset();\r\n });\r\n\r\n this.Reset();\r\n }\r\n\r\n AdjustTotalAmount(informSubscriber: boolean = true) {\r\n let totalAmount: number = 0;\r\n let totalAmountFrc: number = 0;\r\n let prodSummary: string = '';\r\n let foreignCurrency: boolean = false;\r\n\r\n this.bestMatchHandler.GetBestMatchTicketsV4Date(this.Id, this.ProductGroupIdentifier, this.selectedDate, this.ProductListTmp).then((bestMatchResultList) => {\r\n\r\n for (let prod of this.ProductListTmp) {\r\n if (prod.Quantity > 0) {\r\n prodSummary += `${prod.Quantity} ${prod.Name}, `;\r\n\r\n let bestMatchResult = this.bestMatchHandler.FindBestMatch(prod.Id, bestMatchResultList);\r\n\r\n if (bestMatchResultList.length > 0) {\r\n totalAmount += this.bestMatchHandler.GetBestMatchProductPriceSum(prod.Quantity, prod.Price, bestMatchResult);\r\n } else {\r\n totalAmount += (prod.Quantity * this.GetPrice(prod.Price));\r\n }\r\n }\r\n\r\n $(prod.ListElement).find(`*[data-quantity-selection=${prod.Id}]`).html(prod.Quantity.toString());\r\n $(prod.ListElement).find(`*[data-quantity-input=${prod.Id}]`).val(prod.Quantity.toString());\r\n\r\n let price = $.number((prod.Quantity * this.GetPrice(prod.Price)), this.CultureInfo.currencyDecimalDigits, this.CultureInfo.currencyDecimalSeparator,\r\n this.CultureInfo.currencyGroupSeparator);\r\n\r\n $(prod.ListElement).find(`*[data-calculated-price=${prod.Id}]`).html(price.toString());\r\n\r\n if (prod.ForeignPrice != null) {\r\n let priceFrc = $.number((prod.Quantity * this.GetPrice(prod.ForeignPrice)), this.CultureInfo.currencyDecimalDigits, this.CultureInfo.currencyDecimalSeparator,\r\n this.CultureInfo.currencyGroupSeparator);\r\n\r\n $(prod.ListElement).find(`*[data-calculated-price-frc=${prod.Id}]`).html(`${this.foreignCurrency} ${priceFrc.toString()}`);\r\n foreignCurrency = true;\r\n totalAmountFrc += (prod.Quantity * this.GetPrice(prod.ForeignPrice));\r\n }\r\n }\r\n prodSummary = prodSummary.substring(0, prodSummary.length - 2);\r\n\r\n let totalPrice: string = this.GetPriceString(totalAmount);\r\n\r\n this.Total = totalPrice;\r\n\r\n $('.prod_selection__calculated-sum').html(totalPrice);\r\n $('.prod_selection__persontype-summary').html(prodSummary);\r\n\r\n if (foreignCurrency) {\r\n let totalPriceFrc: string = this.GetPriceString(totalAmountFrc);\r\n $('.prod_selection__calculated-sum-frc').html(`${this.foreignCurrency} ${totalPriceFrc}`);\r\n }\r\n\r\n if (informSubscriber) {\r\n this.InteractionSubject.next(this.InteractionSubject.getValue());\r\n }\r\n }).catch(function () { });\r\n }\r\n\r\n GetPriceString(totalAmount: number) {\r\n return $.number(totalAmount, this.CultureInfo.currencyDecimalDigits, this.CultureInfo.currencyDecimalSeparator, this.CultureInfo.currencyGroupSeparator)\r\n }\r\n\r\n Apply() {\r\n this.ProductList = [];\r\n for (let prod of this.ProductListTmp) {\r\n this.ProductList.push(new Product(prod.Id, prod.Name, prod.Price, prod.OriginalPrice, prod.ForeignPrice,\r\n prod.Quantity, prod.SubProductIdentifier, prod.TimeSlotGroupKeys, prod.ListElement));\r\n }\r\n }\r\n\r\n Reset() {\r\n this.ProductListTmp = [];\r\n for (let prod of this.ProductList) {\r\n this.ProductListTmp.push(new Product(prod.Id, prod.Name, prod.Price, prod.OriginalPrice, prod.ForeignPrice,\r\n prod.Quantity, prod.SubProductIdentifier, prod.TimeSlotGroupKeys, prod.ListElement));\r\n }\r\n this.AdjustTotalAmount();\r\n }\r\n\r\n GetPrice(price: number): number {\r\n return price / this.Divisor;\r\n }\r\n}\r\n\r\n\r\ninterface AxProdSelectionInit {\r\n CultureInfo: any;\r\n NumberDivisor: number;\r\n ProductList: Product[];\r\n ProjNr: number;\r\n ProductGroupIdentifier: number;\r\n Id: number;\r\n ForeignCurrency: string;\r\n GetBestMatch: boolean;\r\n}\r\n", "import { Subject } from \"rxjs\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\n\r\nimport tippy from \"tippy.js\";\r\nimport { parse } from \"node:path/posix\";\r\n\r\nexport class Options {\r\n StartOfWeek: number = 1;\r\n Lang: string = 'en';\r\n StartDate: moment.Moment;\r\n EndDate?: moment.Moment;\r\n DatePattern: string;\r\n Months: number = 1;\r\n RootElement: string = 'calendarWrapper--trinity';\r\n WeekdayLegendSelector?: string = '';\r\n};\r\n\r\nexport class InfoObject {\r\n Date: string;\r\n Price: number;\r\n AdditionalCellClass?: string = null;\r\n WeatherData?: any = null;\r\n TotalDiscountPercentage?: number = 0;\r\n PriceWithoutDiscount?: number = null;\r\n Currency?: string;\r\n ActiveClass?: string;\r\n\r\n OnClick?: Function;\r\n ParentScope: any;\r\n}\r\n\r\nexport class WeatherData {\r\n classNo: number;\r\n minTemp: number;\r\n maxTemp: number;\r\n}\r\n\r\nexport class AxCalendarTrinity {\r\n private Today: moment.Moment = moment();\r\n\r\n private CurrentMonth: number;\r\n private CurrentYear: number;\r\n\r\n private RootElement: HTMLElement;\r\n\r\n private Options: Options;\r\n\r\n public LoadingSubject: Subject<moment.Moment> = new Subject<moment.Moment>();\r\n\r\n constructor(private i18nHelper = new I18nHelper()) { }\r\n\r\n showCalendar(month?: number, year?: number, options?: Options) {\r\n if (options != null) {\r\n this.Options = options;\r\n }\r\n\r\n moment.lang(this.Options.Lang);\r\n moment.updateLocale(this.Options.Lang, {\r\n week: {\r\n dow: this.Options.StartOfWeek\r\n }\r\n });\r\n\r\n if (this.Options?.WeekdayLegendSelector != null && typeof this.Options.WeekdayLegendSelector != 'undefined') {\r\n let tmp: moment.Moment = moment('31-12-1993', \"YYYY-MM-DD\").startOf('week');\r\n\r\n let legend = document.querySelector(this.Options.WeekdayLegendSelector);\r\n\r\n if (legend != null) {\r\n legend.classList.add('axc__legend');\r\n\r\n for (let i = 0; i < 7; i++) {\r\n let elem = document.createElement('div');\r\n elem.classList.add('axc__row_inner');\r\n elem.innerHTML = tmp.format('dd');\r\n legend.appendChild(elem);\r\n\r\n tmp.add(1, 'd');\r\n }\r\n }\r\n }\r\n\r\n this.renderCalendar(month, year, this.Options.Months, false);\r\n }\r\n\r\n renderCalendar(month?: number, year?: number, months?: number, append?: boolean) {\r\n month = month || parseInt(moment().format('MM'));\r\n year = year || parseInt(moment().format('YYYY'));\r\n months = months || 1;\r\n append = append || false;\r\n\r\n let tbl: HTMLElement = document.getElementById(this.Options.RootElement);\r\n\r\n if (!append) {\r\n tbl.innerHTML = \"\";\r\n }\r\n\r\n this.Today = moment();\r\n this.Today.set({ hour: 0, minute: 0, second: 0, millisecond: 0 });\r\n let startdate = null;\r\n\r\n for (let h = 0; h < months; h++) {\r\n let dt: moment.Moment = moment(year + '-' + month + '-01', \"YYYY-MM-DD\");\r\n\r\n if (this.Options.EndDate < dt) {\r\n break;\r\n }\r\n\r\n this.CurrentMonth = month;\r\n this.CurrentYear = year;\r\n\r\n let dateStart: number = this.Options.StartOfWeek;\r\n\r\n\r\n let dateTemp: moment.Moment;\r\n\r\n let currentWeek: number = parseInt(dt.format('w'));\r\n\r\n if (currentWeek < parseInt(this.Today.format('w'))) {\r\n startdate = this.Today.startOf('week');\r\n }\r\n\r\n let monthHeader = document.createElement(\"div\");\r\n monthHeader.classList.add(\"axc__month-header\");\r\n\r\n if (dt.format(\"MM-YYYY\") == this.Today.format(\"MM-YYYY\")) {\r\n monthHeader.classList.add(\"ax-color-primary\");\r\n }\r\n\r\n monthHeader.innerHTML = dt.format(\"MMM YYYY\");\r\n monthHeader.setAttribute('data-name', dt.format(\"MMMM\"));\r\n monthHeader.id = `axc__month--${dt.format(\"MM\")}-${dt.format(\"YYYY\")}`;\r\n tbl.appendChild(monthHeader);\r\n\r\n let startOfWeekTemp: moment.Moment = dt.startOf('week');\r\n\r\n let cell: HTMLElement;\r\n\r\n let innerHead: HTMLElement = document.createElement('div');\r\n\r\n //Create Table Header with Day Names\r\n for (let j = (0 + dateStart); j < (7 + dateStart); j++) {\r\n\r\n innerHead.classList.add(\"axc__row_inner\");\r\n cell = document.createElement(\"div\");\r\n cell.classList.add(\"axc__cell-header\");\r\n let weekdayName = moment().isoWeekday(j).format('ddd').toUpperCase();\r\n let cellText = document.createTextNode(weekdayName);\r\n cell.appendChild(cellText);\r\n innerHead.appendChild(cell);\r\n }\r\n\r\n //Searching for the Correct Week for the this month?\r\n while (parseInt(startOfWeekTemp.format('DD')) >= 2 && parseInt(startOfWeekTemp.format('MM')) == this.CurrentMonth) {\r\n dateTemp = dt.add(-1, 'd');\r\n currentWeek = parseInt(dateTemp.format('w'));\r\n\r\n startOfWeekTemp = moment().isoWeekYear(parseInt(dateTemp.format('YYYY'))).isoWeek(currentWeek).startOf('week');\r\n }\r\n\r\n //// Also show last week if the week start is on the first\r\n //if (parseInt(startOfWeekTemp.format('DD')) == 1 && h == 0) {\r\n // dateTemp = dt.add(-1, 'd');\r\n // currentWeek = parseInt(dateTemp.format('w'));\r\n //}\r\n\r\n let startOfWeek = startOfWeekTemp;\r\n\r\n //Iterate 6 Weeks\r\n for (let i = 0; i < 6; i++) {\r\n\r\n //Iterate 7 Days\r\n for (let j = 0; j < 7; j++) {\r\n let displayDate: moment.Moment = startOfWeek;\r\n\r\n if (startOfWeek < startdate || this.Options.EndDate < displayDate) {\r\n startOfWeek.add(7, 'd');\r\n continue;\r\n }\r\n\r\n let innerDay: HTMLElement = document.createElement('div');\r\n innerDay.classList.add(\"axc__row_inner\");\r\n\r\n cell = document.createElement(\"div\");\r\n let dateHolder: HTMLElement = document.createElement(\"div\");\r\n\r\n dateHolder.classList.add(\"axc__cell_dateholder-inactive\");\r\n\r\n if ((i === 0 && parseInt(displayDate.format('M')) < month) || displayDate.format('YYYY-MM-DD') < this.Options.StartDate.format('YYYY-MM-DD')) {\r\n\r\n innerDay.classList.add(\"axc__cell-inactive\");\r\n\r\n if (displayDate.format('YYYY-MM-DD') === this.Today.format('YYYY-MM-DD')) {\r\n dateHolder.classList.add(\"axc__cell_dateholder-currentdate\");\r\n }\r\n\r\n if (h > 0 || append) {\r\n innerDay.classList.add(\"invisible\");\r\n }\r\n } else {\r\n innerDay.classList.add(\"axc__cell\");\r\n cell.classList.add(\"axc__cell_noEvent\");\r\n\r\n if (displayDate.format('YYYY-MM-DD') === this.Today.format('YYYY-MM-DD')) {\r\n dateHolder.classList.add(\"axc__cell_dateholder-currentdate\");\r\n dateHolder.classList.remove(\"axc__cell_dateholder-inactive\");\r\n } else {\r\n dateHolder.classList.add(\"axc__cell_dateholder\");\r\n dateHolder.classList.remove(\"axc__cell_dateholder-inactive\");\r\n }\r\n\r\n let nextYear: number = parseInt(displayDate.format('YYYY'));\r\n\r\n if ((nextYear > this.CurrentYear && parseInt(displayDate.format('M')) < month) || parseInt(displayDate.format('M')) > month) {\r\n innerDay.classList.add(\"axc__cell-after\");\r\n innerDay.classList.add(\"axc__cell-inactive\");\r\n if (months > 1 || append) {\r\n innerDay.classList.add(\"invisible\");\r\n }\r\n } else {\r\n cell.setAttribute(\"data-date\", displayDate.format('YYYY-MM-DD'));\r\n }\r\n }\r\n let dayNum = document.createElement(\"div\");\r\n dayNum.appendChild(document.createTextNode(displayDate.format('DD')));\r\n dateHolder.appendChild(dayNum);\r\n\r\n let dayName = document.createElement(\"div\");\r\n dayName.classList.add(\"axc__cell_dateholder--displayName\");\r\n const dayContent = document.createTextNode(displayDate.format('dd'));\r\n dayName.appendChild(dayContent);\r\n dateHolder.appendChild(dayName);\r\n\r\n cell.appendChild(dateHolder);\r\n innerDay.appendChild(cell);\r\n startOfWeek.add(1, 'd');\r\n tbl.appendChild(innerDay);\r\n }\r\n\r\n currentWeek++;\r\n\r\n if (parseInt(startOfWeek.format('MM')) > this.CurrentMonth || parseInt(startOfWeek.format('YYYY')) > this.CurrentYear) {\r\n break;\r\n }\r\n }\r\n\r\n for (let i = 0; i < 7; i++) {\r\n let inner = document.createElement('div');\r\n inner.classList.add(\"axc__row_inner\");\r\n\r\n let cellinner = document.createElement(\"div\");\r\n inner.classList.add(\"axc__cell-after\");\r\n inner.classList.add(\"axc__cell-inactive\");\r\n inner.classList.add(\"axc__cell-after-cellfix\");\r\n\r\n inner.appendChild(cellinner);\r\n tbl.appendChild(inner);\r\n }\r\n\r\n this.LoadingSubject.next(moment(year + '-' + month + '-01', \"YYYY-MM-DD\"));\r\n\r\n year = (this.CurrentMonth === 12) ? this.CurrentYear + 1 : this.CurrentYear;\r\n month = (this.CurrentMonth + 1) % 12;\r\n\r\n if (month == 0) {\r\n month = 12;\r\n }\r\n }\r\n\r\n this.RootElement = tbl;\r\n }\r\n\r\n next(append: boolean = false) {\r\n this.CurrentYear = (this.CurrentMonth === 12) ? this.CurrentYear + 1 : this.CurrentYear;\r\n this.CurrentMonth = (this.CurrentMonth + 1) % 12;\r\n\r\n if (this.CurrentMonth == 0) {\r\n this.CurrentMonth = 12;\r\n }\r\n\r\n this.renderCalendar(this.CurrentMonth, this.CurrentYear, 1, append);\r\n }\r\n\r\n previous(append: boolean = false) {\r\n this.CurrentYear = (this.CurrentMonth === 0) ? this.CurrentYear - 1 : this.CurrentYear;\r\n this.CurrentMonth = (this.CurrentMonth === 0) ? 11 : this.CurrentMonth - 1;\r\n this.renderCalendar(this.CurrentMonth, this.CurrentYear, 1, append);\r\n }\r\n\r\n blockCalendar() {\r\n $('.axc__row_inner').css(\"pointer-events\", \"none\");\r\n }\r\n\r\n unblockCalendar() {\r\n $('.axc__row_inner').css(\"pointer-events\", \"auto\");\r\n }\r\n\r\n toggleCalendarBlock(block: boolean) {\r\n if (block) {\r\n this.blockCalendar();\r\n } else {\r\n this.unblockCalendar();\r\n }\r\n }\r\n\r\n addInfo(infoObj: InfoObject) {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + infoObj.Date + '\"]');\r\n\r\n if (infoObj.AdditionalCellClass != null) {\r\n $(cell).addClass(infoObj.AdditionalCellClass);\r\n }\r\n\r\n if (cell.length > 0) {\r\n let elem = cell[0];\r\n $(cell).removeClass('axc__cell_noEvent');\r\n\r\n let infoHolderParent: HTMLElement = document.createElement('div');\r\n let infoHolderSecondLine: HTMLElement = document.createElement('div');\r\n let infoHolderThirdLine: HTMLElement = document.createElement('div');\r\n let infoHolderDiscount: HTMLElement = document.createElement('div');\r\n\r\n infoHolderSecondLine.classList.add('ngPriceHolderCalendar');\r\n\r\n if (infoObj.Currency != null && typeof infoObj.Currency != 'undefined') {\r\n let currencyInfo: HTMLElement = document.createElement('div');\r\n currencyInfo.classList.add('axc__cell_info-price');\r\n currencyInfo.appendChild(document.createTextNode(infoObj.Currency));\r\n infoHolderParent.appendChild(currencyInfo);\r\n }\r\n\r\n if (infoObj.WeatherData !== null && typeof infoObj.WeatherData != 'undefined' && typeof infoObj.WeatherData.WeatherImage != 'undefined' && infoObj.PriceWithoutDiscount !== null && infoObj.TotalDiscountPercentage != 0) {\r\n infoHolderSecondLine.appendChild(document.createTextNode(infoObj.Price.toString()));\r\n let priceDiscountPercentage: number = infoObj.TotalDiscountPercentage / -100;\r\n infoHolderDiscount.appendChild(document.createTextNode(priceDiscountPercentage + '\\u0025'));\r\n infoHolderDiscount.classList.add('axc_WeatherDiscount');\r\n infoHolderParent.appendChild(infoHolderDiscount);\r\n infoHolderParent.appendChild(infoHolderThirdLine);\r\n } else {\r\n infoHolderSecondLine.appendChild(document.createTextNode(infoObj.Price.toString()));\r\n }\r\n\r\n let availabilityMarker: HTMLElement = document.createElement('div');\r\n availabilityMarker.classList.add('axc_AvailabilityMarker');\r\n elem.appendChild(availabilityMarker);\r\n\r\n infoHolderParent.appendChild(infoHolderSecondLine);\r\n infoHolderParent.classList.add('axc__cell_info');\r\n\r\n elem.appendChild(infoHolderParent);\r\n\r\n if (infoObj.WeatherData !== null && infoObj.WeatherData != undefined && infoObj.WeatherData) {\r\n let weatherHolderParent = document.createElement('div');\r\n let weatherImg = document.createElement('div');\r\n weatherImg.classList.add('axc_weatherImg');\r\n weatherImg.classList.add('weatherIcon_' + infoObj.WeatherData.classNo);\r\n let weatherHolderTemperatures = document.createElement('div');\r\n let weatherHolderMinTemp = document.createElement('div');\r\n let weatherHolderMaxTemp = document.createElement('div');\r\n weatherHolderMaxTemp.appendChild(document.createTextNode(infoObj.WeatherData.maxTemp + '\\u00B0'));\r\n weatherHolderMinTemp.appendChild(document.createTextNode(infoObj.WeatherData.minTemp + '\\u00B0'));\r\n weatherHolderTemperatures.appendChild(weatherHolderMinTemp);\r\n weatherHolderTemperatures.appendChild(weatherHolderMaxTemp);\r\n weatherHolderTemperatures.classList.add('axc_cell_temperature');\r\n weatherHolderParent.appendChild(weatherHolderTemperatures);\r\n weatherHolderParent.appendChild(weatherImg);\r\n weatherHolderParent.classList.add('axc__cell_weather');\r\n elem.appendChild(weatherHolderParent);\r\n }\r\n\r\n let that = this;\r\n\r\n if (infoObj.OnClick != null) {\r\n elem.setAttribute('data-ac', infoObj.ActiveClass);\r\n elem.parentElement.addEventListener(\"click\", function () {\r\n if (this.classList.contains('axc__cell-clickable')) {\r\n $(that.RootElement).find('.axc__row_inner').removeClass(infoObj.ActiveClass);\r\n infoObj.OnClick(this.children[0], infoObj.ParentScope);\r\n this.classList.add(infoObj.ActiveClass);\r\n }\r\n }, false);\r\n elem.parentElement.classList.add('axc__cell-clickable');\r\n }\r\n }\r\n }\r\n\r\n ActivateDay(date: string): void {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + date + '\"]');\r\n if (cell.length > 0 && !cell[0].parentElement.classList.contains('axc__cell-clickable')) {\r\n cell[0].parentElement.classList.add('axc__cell-clickable');\r\n }\r\n }\r\n\r\n /// <summary>\r\n /// Deactivate Click Event for given Date\r\n /// </summary>\r\n /// <param name=\"date\">Date to be deactivate (YYYY-MM-DD)</param>\r\n /// <returns>If deactivate Date was currently active</returns>\r\n DeactivateDay(date: string): boolean {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + date + '\"]');\r\n if (cell.length > 0 && cell[0].parentElement.classList.contains('axc__cell-clickable')) {\r\n cell[0].parentElement.classList.remove('axc__cell-clickable');\r\n let activeClass = cell[0].getAttribute('data-ac');\r\n if (cell[0].parentElement.classList.contains(activeClass)) {\r\n cell[0].parentElement.classList.remove(activeClass);\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n addContingentInfo(date: string, contingentsFree: number, contingentsCountTotal: number, showContingentsAlertPercent: number, contingentsLeftText) {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + date + '\"]');\r\n let showContingentsAlertTrigger: number = contingentsCountTotal / 100 * showContingentsAlertPercent;\r\n\r\n if (contingentsFree < showContingentsAlertTrigger && cell.length > 0) {\r\n let infoHolderContingents = document.createElement('div');\r\n infoHolderContingents.classList.add('axc__cell_contingent_info');\r\n infoHolderContingents.classList.add('ax-contingent-alert');\r\n\r\n let contingentHoverAlert: HTMLElement = document.createElement('div');\r\n contingentHoverAlert.classList.add('ax__cell-contingent-alert-hover');\r\n contingentHoverAlert.appendChild(document.createTextNode(contingentsLeftText.replace(\"{0}\", contingentsFree)));\r\n\r\n cell[0].appendChild(infoHolderContingents);\r\n cell[0].appendChild(contingentHoverAlert);\r\n }\r\n }\r\n\r\n addCellClass(date: string, addClass: string) {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + date + '\"]');\r\n $(cell).addClass(addClass);\r\n }\r\n\r\n removeCellClass(date: string, removeClass: string) {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + date + '\"]');\r\n $(cell).removeClass(removeClass);\r\n }\r\n\r\n removeDiscountLabel(cell: NodeListOf<Element>) {\r\n [].filter.call(cell, (element: HTMLElement) => {\r\n const discountLabel: HTMLElement = element.querySelector('.axc_discount-label');\r\n\r\n if (discountLabel != null) {\r\n discountLabel.remove();\r\n }\r\n });\r\n }\r\n\r\n removeOriginalPriceTag(cell: NodeListOf<Element>) {\r\n [].filter.call(cell, (element: HTMLElement) => {\r\n const originalPriceTag: HTMLElement = element.querySelector('.axc__cell_info-price_org');\r\n\r\n if (originalPriceTag != null) {\r\n originalPriceTag.remove();\r\n }\r\n });\r\n }\r\n\r\n renderDiscountLabel(cell: NodeListOf<Element>, discountPercent?: number) {\r\n if (discountPercent == null || discountPercent === 0 || isNaN(discountPercent)) {\r\n this.removeDiscountLabel(cell);\r\n return;\r\n };\r\n\r\n let discountText = `${discountPercent > 0 ? '+' : ''}${discountPercent.toString()}\\u0025`;\r\n [].filter.call(cell, (element: HTMLElement) => {\r\n const discountLabel: HTMLElement = element.querySelector('.axc_discount-label');\r\n\r\n if (discountLabel != null) {\r\n discountLabel.innerHTML = discountText;\r\n discountLabel.classList.toggle('axc_discount-label--red', discountPercent > 0);\r\n return;\r\n }\r\n\r\n const infoHolderDiscount = document.createElement('div');\r\n infoHolderDiscount.appendChild(document.createTextNode(discountText));\r\n infoHolderDiscount.classList.add('axc_discount-label');\r\n infoHolderDiscount.classList.toggle('axc_discount-label--red', discountPercent > 0);\r\n\r\n element.append(infoHolderDiscount);\r\n });\r\n }\r\n\r\n renderOriginalPriceTag(cell: NodeListOf<Element>, price: string, priceWithoutDiscount: string) {\r\n [].filter.call(cell, (element: HTMLElement) => {\r\n if (priceWithoutDiscount == null || priceWithoutDiscount === '' || price === priceWithoutDiscount) {\r\n this.removeOriginalPriceTag(cell);\r\n return;\r\n };\r\n\r\n const discountLabel: HTMLElement = element.querySelector('.axc__cell_info-price_org');\r\n\r\n if (discountLabel != null) {\r\n discountLabel.innerHTML = priceWithoutDiscount;\r\n return;\r\n }\r\n\r\n const infoHolderDiscount = document.createElement('div');\r\n infoHolderDiscount.appendChild(document.createTextNode(priceWithoutDiscount));\r\n infoHolderDiscount.classList.add('axc__cell_info-price_org');\r\n\r\n element.querySelector('.axc__cell_info').append(infoHolderDiscount);\r\n });\r\n }\r\n\r\n updatePrice(date: string, price: string, priceWithoutDiscount?: string, discountPercent?: number) {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + date + '\"]');\r\n\r\n if (parseInt(price.replace(',', '').replace('.', '')) !== 0) {\r\n $(cell).find('.ngPriceHolderCalendar').html(price);\r\n $(cell).find('.axc__cell_info-price').show();\r\n }\r\n else {\r\n $(cell).find('.ngPriceHolderCalendar').html('');\r\n $(cell).find('.axc__cell_info-price').hide();\r\n }\r\n\r\n this.renderDiscountLabel(cell, discountPercent);\r\n this.renderOriginalPriceTag(cell, price, priceWithoutDiscount);\r\n }\r\n\r\n addHasTimeSlots(date: string, contingentNr: number) {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + date + '\"]');\r\n $(cell).data({ contingentNr: contingentNr });\r\n }\r\n\r\n addPackageInfo(date: string, packageNr: number, tariffSheetNr: number, validTimeSpan: number) {\r\n let cell: NodeListOf<Element> = this.RootElement.querySelectorAll('[data-date=\"' + date + '\"]');\r\n\r\n $(cell).data({ packageNr: packageNr });\r\n $(cell).data({ tariffSheetNr: tariffSheetNr });\r\n $(cell).data({ validTimeSpan: validTimeSpan });\r\n }\r\n\r\n disableWholeCalendar() {\r\n $('.axc__cell').addClass('axc__cell_noTimeSlot').attr('data-content', this.i18nHelper.GetTranslation(Translations.SoldOut));\r\n }\r\n\r\n highlightRange(startDate: string, endDate: string) {\r\n this.highlightRemove();\r\n let start: moment.Moment = moment(startDate, \"YYYY-MM-DD\");\r\n let end: moment.Moment = moment(endDate, \"YYYY-MM-DD\");\r\n\r\n let count: number = 0;\r\n let cell: NodeListOf<Element>;\r\n\r\n for (let m = moment(start); m.diff(end, 'days') <= 0; m.add(1, 'days')) {\r\n cell = this.RootElement.querySelectorAll('[data-date=\"' + m.format('YYYY-MM-DD') + '\"]');\r\n\r\n $(cell[0]).find(\".ax-contingent-alert\").addClass(\"axc__cell_contingent_info_active\");\r\n $(cell[0]).find(\".axc__cell_info\").addClass(\"axc__cell_contingent_info_active\");\r\n $(cell[0]).find(\".ax__cell-contingent-alert-hover\").addClass(\"ax__cell-contingent-alert-hover-active\");\r\n\r\n if (cell.length > 0) {\r\n cell[0].parentElement.classList.add('axc__cell-highlight');\r\n }\r\n if (count == 0) {\r\n cell[0].parentElement.classList.add('axc__cell-highlight-start');\r\n cell[0].parentElement.setAttribute('data-start', moment(startDate, 'YYYY-MM-DD').format(this.Options.DatePattern));\r\n }\r\n\r\n count++;\r\n }\r\n\r\n if (cell.length > 0) {\r\n cell[0].parentElement.classList.add('axc__cell-highlight-end');\r\n cell[0].parentElement.setAttribute('data-end', moment(endDate, 'YYYY-MM-DD').format(this.Options.DatePattern));\r\n }\r\n }\r\n\r\n highlightRemove() {\r\n let calRows: HTMLCollection = this.RootElement.children;\r\n for (let i = 0; i < calRows.length; i++) {\r\n let calCols: HTMLCollection = calRows[i].children;\r\n\r\n $(\".axc__cell_contingent_info\").removeClass(\"axc__cell_contingent_info_active\");\r\n $(\".axc__cell_info\").removeClass(\"axc__cell_contingent_info_active\");\r\n $(\".ax__cell-contingent-alert-hover\").removeClass(\"ax__cell-contingent-alert-hover-active\");\r\n\r\n\r\n for (let j = 0; j < calCols.length; j++) {\r\n calCols[j].classList.remove(\"axc__cell-highlight\");\r\n calCols[j].classList.remove(\"axc__cell-highlight-start\");\r\n calCols[j].classList.remove(\"axc__cell-highlight-end\");\r\n }\r\n }\r\n }\r\n};\r\n", "import { Subject } from \"rxjs\";\r\nimport { RandomHelper } from \"../../Lib/Helper/RandomHelper\";\r\n\r\nexport class AxScrollspy {\r\n private Selector: string;\r\n private Offsets: Map<string, number>;\r\n\r\n private Offset: number;\r\n\r\n private Listener: any;\r\n private Guid: string;\r\n private Skip: number;\r\n\r\n private LastTarget: ScrollSubject;\r\n\r\n private ScrollSubject: Subject<ScrollSubject>;\r\n\r\n constructor(selector: string, offset?: number, skip?: number) {\r\n let randomHelper = new RandomHelper();\r\n this.Guid = randomHelper.GetGuid();\r\n this.Offset = offset || 0;\r\n this.ScrollSubject = new Subject<ScrollSubject>();\r\n this.Selector = selector;\r\n this.Skip = skip || 0;\r\n\r\n this.update();\r\n this.Listener = AxScrollSpyListener.Listener.bind(this);\r\n\r\n window.addEventListener(\"scroll\", this.Listener);\r\n }\r\n\r\n update() {\r\n let sections = $(this.Selector);\r\n this.Offsets = new Map<string, number>();\r\n\r\n sections.each((i, e) => {\r\n this.Offsets.set(e.id, e.offsetTop);\r\n });\r\n }\r\n\r\n destroy() {\r\n window.removeEventListener(\"scroll\", this.Listener);\r\n }\r\n\r\n getSubject() {\r\n return this.ScrollSubject;\r\n }\r\n\r\n getCurrentTarget() {\r\n return this.LastTarget;\r\n }\r\n\r\n next() {\r\n let currentOffsetTarget: number = this.LastTarget?.Offset ?? 0;\r\n let nextTargetOffset: number = 0;\r\n let count = 0;\r\n\r\n this.Offsets.forEach((i, key, map) => {\r\n if (count >= this.Skip) {\r\n let tmpOffset = map.get(key);\r\n if (tmpOffset > currentOffsetTarget && (nextTargetOffset == 0 || tmpOffset < nextTargetOffset)) {\r\n nextTargetOffset = tmpOffset;\r\n }\r\n }\r\n count++;\r\n });\r\n\r\n window.scrollTo({\r\n top: nextTargetOffset - this.Offset,\r\n left: 0,\r\n behavior: 'smooth'\r\n });\r\n }\r\n\r\n previous() {\r\n let currentOffsetTarget: number = (document.documentElement.scrollTop || document.body.scrollTop) + this.Offset;\r\n let nextTargetOffset: number = 0;\r\n\r\n this.Offsets.forEach((i, key, map) => {\r\n let tmpOffset = map.get(key);\r\n if (tmpOffset < currentOffsetTarget && (nextTargetOffset == 0 || tmpOffset > nextTargetOffset)) {\r\n nextTargetOffset = tmpOffset;\r\n }\r\n });\r\n\r\n window.scrollTo({\r\n top: nextTargetOffset - this.Offset,\r\n left: 0,\r\n behavior: 'smooth'\r\n });\r\n }\r\n}\r\n\r\nconst AxScrollSpyListener = {\r\n Listener() {\r\n let scrollPosition = (document.documentElement.scrollTop || document.body.scrollTop) + this.Offset;\r\n let lastIndex = '';\r\n\r\n this.Offsets.forEach((i, key, map) => {\r\n //console.log(`${key} -> ${map.get(key)} on ${scrollPosition} == ${map.get(key) <= scrollPosition}`);\r\n if (map.get(key) <= scrollPosition) {\r\n lastIndex = key;\r\n }\r\n });\r\n\r\n if (lastIndex != '' && (typeof (this.LastTarget) == 'undefined' || this.LastTarget.Id != lastIndex)) {\r\n this.LastTarget = new ScrollSubject(this.Guid, this.Selector, lastIndex, this.Offsets.get(lastIndex), $(`#${lastIndex}`)[0]);\r\n this.ScrollSubject.next(this.LastTarget);\r\n } else if (typeof (this.LastTarget) != 'undefined' && this.LastTarget.Id != '' && lastIndex == '') {\r\n this.LastTarget = new ScrollSubject(this.Guid, this.Selector, lastIndex, 0, null);\r\n this.ScrollSubject.next(this.LastTarget);\r\n }\r\n }\r\n};\r\n\r\nexport class ScrollSubject {\r\n constructor(guid: string, selector: string, id: string, offset: number, target: HTMLElement) {\r\n this.Guid = guid;\r\n this.Selector = selector;\r\n this.Target = target;\r\n this.Id = id;\r\n this.Offset = offset;\r\n }\r\n\r\n Guid: string;\r\n Target: HTMLElement;\r\n Selector: string;\r\n Id: string;\r\n Offset: number;\r\n}\r\n\r\n//(function () {\r\n// 'use strict';\r\n\r\n// var section = document.querySelectorAll(\".section\");\r\n// var sections = {};\r\n// var i = 0;\r\n\r\n// Array.prototype.forEach.call(section, function (e) {\r\n// sections[e.id] = e.offsetTop;\r\n// });\r\n\r\n// window.onscroll = function () {\r\n// var scrollPosition = document.documentElement.scrollTop || document.body.scrollTop;\r\n\r\n// for (i in sections) {\r\n// if (sections[i] <= scrollPosition) {\r\n// document.querySelector('.active').setAttribute('class', ' ');\r\n// document.querySelector('a[href*=' + i + ']').setAttribute('class', 'active');\r\n// }\r\n// }\r\n// };\r\n//})();", "import { AxCalendarTrinity } from '../../../Components/AxCalendar/AxCalendar';\r\nimport { I18nHelper, Translations } from \"../../../Lib/Helper/I18nHelper\";\r\nimport { AxProdSelection } from '../axProdSelection';\r\nimport { Product } from '../../../Models/Tickets/Product';\r\nimport { AxScrollspy, ScrollSubject } from '../../../Components/AxScrollspy/AxScrollspy';\r\nimport { ProgressBar, ProgressBarMode } from '../../Global/Progressbar';\r\nimport { AxLoad } from '../../../Lib/AxSystem/AxLoad';\r\nimport { CheckMinMaxConstraintResult, PackageMinMaxConstraint } from \"../../Packages/PackageMinMaxConstraint\";\r\nimport tippy from 'tippy.js';\r\n\r\nexport abstract class SubCCalendar {\r\n private DatePattern: string;\r\n\r\n private StartMonth;\r\n private StartYear;\r\n\r\n protected Calendar: AxCalendarTrinity;\r\n protected ProductList: ProductDay[] = [];\r\n protected ProductSelection: AxProdSelection;\r\n protected LoadingTickets: boolean;\r\n protected NextLoadRequested: boolean;\r\n protected Currency: string;\r\n\r\n private hasTimeSlots: boolean;\r\n\r\n private ScrollSpy: AxScrollspy;\r\n\r\n constructor(private _I18nHelper = new I18nHelper(),\r\n private _Progressbar = new ProgressBar()\r\n ) { }\r\n\r\n abstract LoadTickets(month: number, year: number): void;\r\n\r\n Init(initData: CalendarDataInit) {\r\n this._Progressbar.Init({\r\n Mode: initData.hasTimeSlots ? ProgressBarMode.Suballotment : ProgressBarMode.Default,\r\n Progress: 0\r\n });\r\n $('#product_selection__setting_overlay').show();\r\n\r\n this.DatePattern = initData.DatePatternYear;\r\n this.StartMonth = initData.Month;\r\n this.StartYear = initData.Year;\r\n\r\n this.Currency = initData.Currency;\r\n this.hasTimeSlots = initData.hasTimeSlots;\r\n\r\n this.Calendar = new AxCalendarTrinity();\r\n this.ProductSelection = AxLoad.GetModule<AxProdSelection>(\"AxProdSelection\");\r\n\r\n this.ScrollSpy = new AxScrollspy('.axc__month-header', 56, 1);\r\n this.ScrollSpy.getSubject().subscribe(x => this.ScrollSpyListener(x));\r\n\r\n this.Calendar.LoadingSubject.subscribe(x => {\r\n this.LoadTickets(parseInt(x.format('MM')), parseInt(x.format('YYYY')));\r\n this.ScrollSpy.update();\r\n });\r\n\r\n $('#calendarWrapper-header--next').click(x => {\r\n let $targets = $('.axc__month-header');\r\n if (this.ScrollSpy.getCurrentTarget() == null || ($targets.length >= 2 && $targets[$targets.length - 2].id == this.ScrollSpy.getCurrentTarget().Id)) {\r\n this.Calendar.next(true);\r\n }\r\n this.ScrollSpy.next();\r\n });\r\n $('#calendarWrapper-header--previous').click(x => { this.ScrollSpy.previous() });\r\n\r\n this.Calendar.showCalendar(initData.Month, initData.Year, {\r\n StartOfWeek: initData.StartOfWeek,\r\n Lang: initData.Lang,\r\n StartDate: moment(),\r\n DatePattern: initData.DatePattern,\r\n Months: 2,\r\n RootElement: 'calendarWrapper--trinity',\r\n WeekdayLegendSelector: '.calendarWrapper--trinity-legend',\r\n EndDate: moment(initData.EndDate, \"YYYY-MM-DD\")\r\n });\r\n\r\n this.ProductSelection.InteractionSubject.subscribe(x => {\r\n this.ActivateDay(x, this);\r\n this.UpdatePrice(false);\r\n });\r\n\r\n window.addEventListener(\"scroll\", ev => {\r\n if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {\r\n if (!this.LoadingTickets) {\r\n this.Calendar.next(true);\r\n } else {\r\n this.NextLoadRequested = true;\r\n }\r\n }\r\n });\r\n\r\n if ($('#ticket_quantity').length > 0) {\r\n const instance = tippy(document.querySelector('#ticket_quantity'), {\r\n content: this._I18nHelper.GetTranslation(Translations.SelectAtLeastOneTicket),\r\n placement: 'right',\r\n trigger: 'manual',\r\n interactive: true,\r\n theme: 'material',\r\n });\r\n instance.hide();\r\n $('#calendarWrapper--trinity').click(() => {\r\n const hasQuantity = this.ProductSelection.GetTotalQuantity() > 0;\r\n\r\n if (!hasQuantity) {\r\n $('#ticket_quantity').addClass('ax-border-radius ticket_quantity-border-ticketv4');\r\n instance.show();\r\n }\r\n else {\r\n () => instance.hide();\r\n () => instance.destroy();\r\n $('#ticket_quantity').removeClass('ax-border-radius ticket_quantity-border-ticketv4');\r\n }\r\n });\r\n }\r\n }\r\n\r\n ScrollSpyListener(subject: ScrollSubject) {\r\n if (subject.Target != null) {\r\n $('#calendarWrapper-header--monthname').html($(subject.Target).data('name'));\r\n } else {\r\n let dt: moment.Moment = moment(`${this.StartYear}-${this.StartMonth}-01`, \"YYYY-MM-DD\");\r\n $('#calendarWrapper-header--monthname').html(dt.format('MMMM'));\r\n }\r\n }\r\n\r\n SwitchDate(month: number, year: number) {\r\n this.Calendar.showCalendar(month, year);\r\n this.LoadTickets(month, year);\r\n }\r\n\r\n ActivateDaySub(elem: Element, parentScope: SubCCalendar) {\r\n parentScope.ProductSelection.InteractionSubject.next(elem);\r\n }\r\n\r\n UpdatePrice(IsFirstLoad: boolean) {\r\n let totalQuantity = 0;\r\n\r\n if (typeof this.ProductList != 'undefined') {\r\n for (let prodList of this.ProductList) {\r\n let totalAmount: number = 0;\r\n let totalAmountWithoutDiscount: number = 0;\r\n for (let prod of prodList.Products) {\r\n let currentProd = this.ProductSelection.ProductListTmp.find(x => x.SubProductIdentifier == prod.SubProductIdentifier);\r\n let frontendViewProd = this.ProductSelection.ProductList.find(x => x.SubProductIdentifier == prod.SubProductIdentifier);\r\n if (currentProd == null || frontendViewProd == null) continue;\r\n\r\n prod.Quantity = currentProd.Quantity;\r\n totalQuantity += prod.Quantity;\r\n if (prod.Quantity > 0) {\r\n totalAmount += (prod.Quantity * this.ProductSelection.GetPrice(prod.Price));\r\n totalAmountWithoutDiscount += (prod.Quantity *\r\n this.ProductSelection.GetPrice(prod.OriginalPrice));\r\n }\r\n }\r\n let price = this.ProductSelection.GetPriceString(totalAmount);\r\n let priceWithoutDiscount = this.ProductSelection.GetPriceString(totalAmountWithoutDiscount);\r\n\r\n if (IsFirstLoad) {\r\n this.Calendar.removeCellClass(prodList.Date, 'allotment__notificiation--info');\r\n }\r\n\r\n this.Calendar.removeCellClass(prodList.Date, 'allotment__notificiation--off');\r\n\r\n if (!this.CheckProductQuantity(prodList)) {\r\n this.Calendar.addCellClass(prodList.Date, 'allotment__notificiation--off');\r\n let activeDay = this.Calendar.DeactivateDay(prodList.Date);\r\n if (activeDay) {\r\n this.DeactivateCurrentDay();\r\n }\r\n }\r\n else {\r\n this.Calendar.ActivateDay(prodList.Date);\r\n if (prodList.TimeSlotInfo.filter(x => x.AvailableSlots <= x.WarningThreshold).length > 0) {\r\n if (IsFirstLoad) {\r\n this.Calendar.addCellClass(prodList.Date, 'allotment__notificiation--info');\r\n }\r\n\r\n } else if (prodList.TimeSlotInfo.filter(x => x.AvailableSlots <= x.LimitedThreshold).length > 0) {\r\n if (IsFirstLoad) {\r\n this.Calendar.addCellClass(prodList.Date, 'allotment__notificiation--info');\r\n }\r\n this.Calendar.ActivateDay(prodList.Date);\r\n }\r\n }\r\n\r\n let priceDiscountPercentage = -1 * Math.round((1 - (totalAmount / totalAmountWithoutDiscount)) * 100);\r\n this.Calendar.updatePrice(prodList.Date, price, priceWithoutDiscount, priceDiscountPercentage);\r\n }\r\n\r\n this.Calendar.toggleCalendarBlock(totalQuantity === 0);\r\n this.UpdateButton(this.ProductSelection.GetTotalQuantity(), this.ProductSelection.getSelectedDate());\r\n }\r\n }\r\n\r\n CheckProductQuantity(product: ProductDay) {\r\n let confList: TimeSlotKeyTotalQuantity[] = [];\r\n\r\n for (let prod of product.Products.filter(x => x.TimeSlotGroupKeys != null)) {\r\n for (let groupKey of prod.TimeSlotGroupKeys) {\r\n let existingEntry = confList.find(x => x.timeSlotGroupKey === groupKey);\r\n if (existingEntry == null) {\r\n confList.push({\r\n timeSlotGroupKey: groupKey,\r\n totalQuantity: prod.Quantity\r\n });\r\n } else {\r\n existingEntry.totalQuantity += prod.Quantity;\r\n }\r\n }\r\n }\r\n\r\n if (this.hasTimeSlots && confList.length === 0) {\r\n return false;\r\n }\r\n\r\n for (let cont of confList) {\r\n let timeSlotInfo = product.TimeSlotInfo.filter(x => x.TimeSlotGroupKey === cont.timeSlotGroupKey);\r\n\r\n if (timeSlotInfo.filter(x => (x.AvailableSlots - cont.totalQuantity) >= 0).length === 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n DeactivateCurrentDay() {\r\n $('.product_selection__setting_date--placeholder').removeClass('d-none');\r\n $('.product_selection__setting_date').addClass('d-none').html('');\r\n $('.prod_selection__summary').fadeOut('fast');\r\n $('.prod_selection__selection-submit').attr('disabled', 'disabled');\r\n this.ProductSelection.InteractionSubject.next(null);\r\n }\r\n\r\n UpdateButton(quantity: number, date: moment.Moment) {\r\n let checkMinMaxConstraintResult = new CheckMinMaxConstraintResult();\r\n\r\n let minMaxConstraintModule = AxLoad.GetModule<PackageMinMaxConstraint>('PackageMinMaxConstraint');\r\n checkMinMaxConstraintResult.minMaxOk = true;\r\n\r\n if (minMaxConstraintModule != null) {\r\n checkMinMaxConstraintResult = minMaxConstraintModule.CheckMinMaxConstraint(quantity);\r\n };\r\n\r\n if (quantity > 0 && checkMinMaxConstraintResult.minMaxOk) {\r\n if (typeof date == 'undefined') {\r\n $('.prod_selection__selection-submit').text(this._I18nHelper.GetTranslation(Translations.SelectDate));\r\n $('.prod_selection__selection-submit').attr('disabled', 'disabled');\r\n } else {\r\n $('.prod_selection__selection-submit').text(this._I18nHelper.GetTranslation(Translations.Continue));\r\n $('.prod_selection__selection-submit').removeAttr('disabled');\r\n }\r\n\r\n $('#ticket_calendar').removeClass('ticketv4-opacity-5');\r\n $('#ticket_calendar').addClass('ticketv4-opacity-0');\r\n $('#ticket_quantity').removeClass('ax-border-radius ticket_quantity-border-ticketv4');\r\n } else if (quantity > 0 && !checkMinMaxConstraintResult.minMaxOk) {\r\n $('.prod_selection__selection-submit').attr('disabled', 'disabled');\r\n $('.prod_selection__selection-submit').html(checkMinMaxConstraintResult.errorMessage);\r\n\r\n } else {\r\n $('.prod_selection__selection-submit').attr('disabled', 'disabled');\r\n $('.prod_selection__selection-submit').text(this._I18nHelper.GetTranslation(Translations.SelectTicket));\r\n $('#ticket_calendar').removeClass('ticketv4-opacity-0');\r\n $('#ticket_calendar').addClass('ticketv4-opacity-5');\r\n document.getElementById(\"calendarWrapper--trinity\").style.cursor = \"not-allowed\";\r\n }\r\n\r\n }\r\n\r\n ActivateDay(elem: Element, parentScope: SubCCalendar) {\r\n if (elem != null) {\r\n let summaryText: string;\r\n let date: moment.Moment = moment($(elem).data('date'), \"YYYY-MM-DD\");\r\n\r\n this.ProductSelection.SetSelectedDate(date);\r\n\r\n let productDay: ProductDay = parentScope.ProductList.find(x => x.Date == $(elem).data('date'));\r\n let totalQuantity: number = parentScope.ProductSelection.GetTotalQuantity();\r\n\r\n if (productDay.TimeSlotInfo.length === 0 || this.CheckProductQuantity(productDay)) {\r\n parentScope.ProductSelection.SetProductListTmp(productDay.Products, false);\r\n\r\n summaryText = totalQuantity.toString();\r\n\r\n if (totalQuantity == 1) {\r\n summaryText += ` ${parentScope._I18nHelper.GetTranslation(Translations.Ticket)}`;\r\n } else {\r\n summaryText += ` ${parentScope._I18nHelper.GetTranslation(Translations.Tickets)}`;\r\n }\r\n\r\n $('.prod_selection__date--input').val($(elem).data('date'));\r\n $('.prod_selection__summary-date').html(date.format(parentScope.DatePattern));\r\n $('.prod_selection__summary-subtotal').html(summaryText);\r\n $('.prod_selection__summary-subtotal--price').html(parentScope.ProductSelection.Total);\r\n\r\n $('.product_selection__setting_date--placeholder').addClass('d-none');\r\n $('.product_selection__setting_date').removeClass('d-none').html(date.format(parentScope.DatePattern));\r\n $('.prod_selection__summary').fadeIn('fast');\r\n if ($('#infobtn').hasClass('ax-info-btn-mobile')) {\r\n $('#infobtn').removeClass('ax-info-btn-mobile');\r\n }\r\n $('#infobtn').addClass('ax-info-btn-mobile');\r\n }\r\n }\r\n }\r\n}\r\n\r\nclass TimeSlotKeyTotalQuantity {\r\n timeSlotGroupKey: number;\r\n totalQuantity: number;\r\n}\r\n\r\nexport interface CalendarData {\r\n DatePattern: string;\r\n DatePatternYear: string;\r\n StartOfWeek: number;\r\n EndDate?: string;\r\n Lang: string;\r\n\r\n ProjNr: number;\r\n}\r\n\r\nexport interface CalendarDataInit extends CalendarData {\r\n Year: number;\r\n Month: number;\r\n Currency: string;\r\n hasTimeSlots: boolean;\r\n}\r\n\r\nexport interface TimeSlotInfo {\r\n TimeSlotGroupKey: number;\r\n AvailableSlots: number;\r\n LimitedThreshold: number;\r\n WarningThreshold: number;\r\n MaxSlots: number;\r\n}\r\n\r\nclass ProductDay {\r\n Date: string;\r\n Products: Product[];\r\n TimeSlotInfo: TimeSlotInfo[];\r\n}\r\n", "import { InfoObject, WeatherData } from '../../../Components/AxCalendar/AxCalendar';\r\nimport { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { CalendarDataInit, SubCCalendar, TimeSlotInfo } from '../Abstraction/SubCCalendar';\r\n\r\n@ModuleName(\"AxProdSelectionCalendar\")\r\nexport class AxProdSelectionCalendar extends SubCCalendar implements AxInit {\r\n\r\n private ProjNr: number;\r\n private PoolNr: number;\r\n private TicketTypeNr: number;\r\n\r\n private Lang: string;\r\n private PersonTypes: any;\r\n\r\n constructor() { super(); }\r\n\r\n AxInit(initData: CalendarDataTicket) {\r\n this.ProjNr = initData.ProjNr;\r\n this.PoolNr = initData.PoolNr;\r\n this.TicketTypeNr = initData.TicketTypeNr;\r\n\r\n this.Lang = initData.Lang;\r\n this.PersonTypes = initData.PersonTypes;\r\n\r\n this.Init(initData);\r\n\r\n this.ProductSelection.SubmitSubject.subscribe(x => {\r\n $('.prod_selection__form').submit();\r\n });\r\n };\r\n\r\n LoadTickets(month: number, year: number) {\r\n //let that = this;\r\n this.LoadingTickets = true;\r\n\r\n //AxessViewer.ajaxRequest('/api/TicketsV4TimeSlotApi/GetTimeSlotsForCalendar', {\r\n AxessViewer.ajaxRequest('/api/TicketsV4TimeSlotApi/GetReservationTimeSlotsForCalendar', {\r\n 'ProjNr': this.ProjNr,\r\n 'ProductGroupIdentifier': this.PoolNr,\r\n 'Id': this.TicketTypeNr,\r\n 'Month': month,\r\n 'Year': year,\r\n 'CiUppercase': this.Lang,\r\n 'SubTypeIdentifiers': this.PersonTypes,\r\n 'Type': 0\r\n }, (resp) => {\r\n let dt: moment.Moment = moment(year + '-' + month + '-01', \"YYYY-MM-DD\");\r\n let dtEnd: moment.Moment = moment(dt).endOf('month');\r\n\r\n for (var m = moment(dt); m.diff(dtEnd, 'days') <= 0 && dt.format('MM') == m.format('MM'); m.add(1, 'days')) {\r\n let day = resp.find(x => x.ValidFrom == m.format(\"YYYY-MM-DD\"));\r\n let cont: TimeSlotInfo[] = [];\r\n let contNum: number = 0;\r\n if (day != null && typeof day != 'undefined' && typeof day.TimeSlotInfo != 'undefined' && day.TimeSlotInfo?.length > 0) {\r\n cont.push(day.TimeSlotInfo);\r\n contNum = day.TimeSlotInfo[0].AvailableSlots;\r\n }\r\n let weatherData: WeatherData = null;\r\n\r\n if (day != null && typeof day != 'undefined' && day.WeatherData != null) {\r\n weatherData = {\r\n classNo: day.WeatherData.ClassNo,\r\n minTemp: day.WeatherData.MinTemp,\r\n maxTemp: day.WeatherData.MaxTemp\r\n };\r\n }\r\n\r\n if (day != null && (contNum > 0 || day.TimeSlotInfo?.length === 0)) {\r\n\r\n let infoObject: InfoObject = {\r\n Date: day.ValidFrom,\r\n Price: day.Tariff,\r\n AdditionalCellClass: '',\r\n OnClick: this.ActivateDaySub,\r\n ParentScope: this,\r\n ActiveClass: 'axc__row_inner--active',\r\n Currency: this.Currency,\r\n WeatherData: weatherData\r\n };\r\n this.Calendar.addInfo(infoObject);\r\n this.ProductList.push({\r\n Date: day.ValidFrom,\r\n Products: day.Products,\r\n TimeSlotInfo: day.TimeSlotInfo\r\n });\r\n } else {\r\n let infoObject: InfoObject = { Date: m.format(\"YYYY-MM-DD\"), Price: 0, ParentScope: this };\r\n this.Calendar.addInfo(infoObject);\r\n this.Calendar.addCellClass(m.format(\"YYYY-MM-DD\"), 'allotment__notificiation--off');\r\n }\r\n }\r\n this.UpdatePrice(true);\r\n this.LoadingTickets = false;\r\n\r\n if (this.NextLoadRequested) {\r\n this.NextLoadRequested = false;\r\n this.Calendar.next(true);\r\n }\r\n }, {\r\n type: 'POST'\r\n });\r\n }\r\n}\r\n\r\nexport interface CalendarDataTicket extends CalendarDataInit {\r\n PoolNr: number;\r\n TicketTypeNr: number;\r\n PersonTypes: any;\r\n}\r\n", "export class AxSlide {\r\n private El: Element;\r\n private Sliders: AxSliderInternal[] = [];\r\n\r\n public Init(initData: Element) {\r\n this.El = initData;\r\n\r\n this.El.Slider.each((i, e) => {\r\n this.Sliders.push(new AxSliderInternal($(e).find(this.El.HolderSelector), this.El.ElemSelector));\r\n });\r\n }\r\n}\r\n\r\nclass AxSliderInternal {\r\n\r\n private Holder: JQuery<HTMLElement>;\r\n private SliderElem: JQuery<HTMLElement>;\r\n\r\n private Touchstartx: number;\r\n private Touchmovex: number;\r\n private Movex: number;\r\n private SliderWidth: number;\r\n private MaxSize: number;\r\n\r\n constructor(holder: JQuery<HTMLElement>, elemSelector: string) {\r\n this.Touchstartx = 0;\r\n this.Touchmovex = 0;\r\n this.Movex = 0;\r\n\r\n this.Holder = holder;\r\n this.SliderWidth = holder.width();\r\n this.SliderElem = this.Holder.find(elemSelector);\r\n\r\n\r\n this.BindUIEvents();\r\n }\r\n\r\n private BindUIEvents() {\r\n this.Holder.on(\"touchstart\", (event) => {\r\n this.Start(event);\r\n });\r\n\r\n this.Holder.on(\"touchmove\", (event) => {\r\n this.Move(event);\r\n });\r\n\r\n this.Holder.on(\"touchend\", (event) => {\r\n this.End(event);\r\n });\r\n\r\n }\r\n\r\n private GetMaxSize() {\r\n let maxSize: number = 0;\r\n\r\n this.SliderElem.each((i, x) => {\r\n maxSize += $(x).outerWidth();\r\n });\r\n return maxSize - this.SliderWidth;\r\n }\r\n\r\n private Start(event) {\r\n this.Touchstartx = event.originalEvent.touches[0].pageX;\r\n this.MaxSize = this.GetMaxSize();\r\n $('.animate').removeClass('animate');\r\n }\r\n\r\n private Move(event) {\r\n this.Touchmovex = event.originalEvent.touches[0].pageX;\r\n let currTrans = parseInt((this.Holder.css(\"transform\").split(\",\")[4] ?? \"0\").trim()) * -1;\r\n this.Movex = currTrans + this.Touchstartx - this.Touchmovex;\r\n if (this.Movex < this.MaxSize + 20) {\r\n this.Holder.css('transform', 'translateX(-' + this.Movex + 'px)');\r\n }\r\n }\r\n\r\n private End(event) {\r\n if (this.Movex > this.MaxSize) {\r\n this.Holder.css('transform', 'translateX(-' + this.MaxSize + 'px)');\r\n }\r\n }\r\n}\r\n\r\nclass Element {\r\n Slider: JQuery<HTMLElement>;\r\n\r\n HolderSelector: string;\r\n ElemSelector: string;\r\n}", "export class TimeSlotKey implements ITimeSlotKey {\r\n constructor(timeSlotGroupKey: number, timeSlotKey1: string, timeSlotKey2: number) {\r\n this.timeSlotGroupKey = timeSlotGroupKey;\r\n this.timeSlotKey1 = timeSlotKey1?.toString();\r\n this.timeSlotKey2 = timeSlotKey2;\r\n }\r\n\r\n timeSlotGroupKey: number;\r\n timeSlotKey1: string;\r\n timeSlotKey2: number;\r\n\r\n equal = (other: ITimeSlotKey): boolean => (\r\n other?.timeSlotGroupKey === this.timeSlotGroupKey\r\n && other?.timeSlotKey1 === this.timeSlotKey1\r\n && other?.timeSlotKey2 === this.timeSlotKey2\r\n );\r\n}\r\n\r\nexport interface ITimeSlotKey {\r\n timeSlotGroupKey: number;\r\n timeSlotKey1: string;\r\n timeSlotKey2: number;\r\n\r\n equal(other: ITimeSlotKey): boolean;\r\n}", "\r\nexport class ConfigHelper {\r\n\r\n // getBoolConfigValue\r\n static async getBoolConfigValueAsync(configId: number): Promise<boolean> {\r\n return await this.getConfigValueAsync<boolean>(configId, ConfigDataType.Bool);\r\n }\r\n\r\n static getBoolConfigValue(configId: number, callback: (value: any | null) => void) {\r\n this.getConfigValue(configId, ConfigDataType.Bool, (result) => {\r\n callback(result);\r\n });\r\n }\r\n\r\n // getStringConfigValue\r\n static async getStringConfigValueAsync(configId: number): Promise<string> {\r\n return await this.getConfigValueAsync<string>(configId, ConfigDataType.String);\r\n }\r\n\r\n // getNumberConfigValue\r\n static async getNumberConfigValueAsync(configId: number): Promise<number> {\r\n return await this.getConfigValueAsync<number>(configId, ConfigDataType.Int);\r\n }\r\n\r\n // getConfigValue\r\n static getConfigValue(configId: number, configDataType: ConfigDataType, callback: (value: any | null) => void) {\r\n let data = {\r\n configId: configId,\r\n ConfigDataType: configDataType\r\n };\r\n try {\r\n AxessViewer.ajaxRequest('/api/ConfigurationApi/GetConfigById', data, (resp) => {\r\n\r\n if (resp.Value == null) {\r\n callback(null);\r\n }\r\n\r\n callback(resp.Value);\r\n }, {\r\n type: 'POST',\r\n async: false\r\n });\r\n } catch (e) {\r\n console.error(e);\r\n callback(null);\r\n }\r\n }\r\n\r\n // getConfigValue\r\n static async getConfigValueAsync<T>(configId: number, configDataType: ConfigDataType): Promise<T> {\r\n let resultPromise = new Promise<T>(async (resolve, reject) => {\r\n\r\n let data = {\r\n configId: configId,\r\n ConfigDataType: configDataType\r\n };\r\n\r\n AxessViewer.ajaxRequest('/api/ConfigurationApi/GetConfigById', data, (resp) => {\r\n\r\n if (resp.Value == null) {\r\n reject();\r\n }\r\n\r\n resolve(resp.Value);\r\n }, {\r\n type: 'POST'\r\n });\r\n });\r\n\r\n return resultPromise;\r\n }\r\n}\r\n\r\nexport enum ConfigDataType {\r\n String = 1,\r\n Int = 2,\r\n Bool = 3,\r\n DateTime = 4\r\n}\r\n\r\n// if you want to use this helper, \r\n// you need to add entry with the correct id like in ConfigDefinition.cs to the enum\r\nexport enum ConfigDefinition {\r\n SubContingentLockAllEarlier = 188,\r\n RentalDataTextInput = 202,\r\n StoreCurrencyWebUseIsoSymbol = 7,\r\n RentalIsAllowedActivated = 468\r\n}", "\r\n\r\nexport class DateHelper {\r\n public static readonly soapDateTimePattern: string = 'YYYY-MM-DD HH:mm:ss';\r\n public static readonly soapDatePattern: string = 'YYYY-MM-DD';\r\n\r\n static soapDateTimeToMoment(soapDate: string): moment.Moment {\r\n let momentDate = moment(soapDate, this.soapDateTimePattern);\r\n return momentDate;\r\n }\r\n\r\n static soapDateToMoment(soapDate: string): moment.Moment {\r\n let momentDate = moment(soapDate, this.soapDatePattern);\r\n return momentDate;\r\n }\r\n\r\n\r\n}", "import { AxSlide } from \"../../../Components/AxSlide/AxSlide\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { I18nHelper, Translations } from \"../../../Lib/Helper/I18nHelper\";\r\nimport { AxLimeStone } from \"../../../Limestone/AxLimeStone\";\r\nimport { AxTab } from \"../../../Limestone/AxPortlet/AxTab\";\r\nimport { ITimeSlot, TimeSlotEntry } from \"../../../Models/Reservation/TimeSlot\";\r\nimport { TimeSlotKey } from \"../../../Models/Reservation/TimeSlotKey\";\r\nimport { ProgressBar, ProgressBarMode } from \"../../Global/Progressbar\";\r\nimport { AxProdSelection } from \"../AxProdSelection\";\r\nimport { SummaryRedirect } from \"../../../Lib/Helper/AxProdSelection/SummaryRedirect\";\r\nimport { TimeSlotDay } from \"../../../Models/Reservation/TimeSlotDay\";\r\nimport { ConfigHelper, ConfigDefinition } from \"../../../Lib/Helper/Config/ConfigHelper\";\r\nimport { CheckMinMaxConstraintResult, PackageMinMaxConstraint } from \"../../Packages/PackageMinMaxConstraint\";\r\nimport { sum } from \"mathjs\";\r\nimport { DateHelper } from \"../../../Lib/Helper/DateHelper\";\r\n\r\nexport abstract class AxBooking {\r\n protected productSelection: AxProdSelection;\r\n protected selectedDate: string;\r\n protected postURL: string;\r\n protected selectedTimeSlots: ITimeSlot[] = [];\r\n\r\n private selectedDateCI: string;\r\n private datePattern: string;\r\n private timeSlotList: TimeSlotEntry[];\r\n private timeSlotDayList: TimeSlotDay[] = [];\r\n private timeSlotGroupKeyList: number[] = [];\r\n private isFirstLoad: boolean = true;\r\n private hideEarlierTimeSlots: boolean;\r\n\r\n constructor(private i18nHelper = new I18nHelper(),\r\n protected _summaryRedirect = new SummaryRedirect(),\r\n private progressbar = new ProgressBar(),\r\n private _AxLimeStone = new AxLimeStone(),\r\n private _Slide = new AxSlide(),\r\n private _AxTab = new AxTab()) {\r\n }\r\n\r\n abstract AddToCart(): void;\r\n\r\n Init(initData: AxProdBookingInit): void {\r\n let that = this;\r\n this.selectedDateCI = initData.dateCI;\r\n this.selectedDate = initData.date;\r\n this.postURL = initData.postURL;\r\n this.datePattern = initData.datePattern;\r\n\r\n this.progressbar.Init({\r\n Mode: ProgressBarMode.Suballotment,\r\n Progress: 1\r\n });\r\n\r\n this.initTimeSlotList(initData);\r\n\r\n ConfigHelper.getBoolConfigValueAsync(ConfigDefinition.SubContingentLockAllEarlier)\r\n .then(x => {\r\n this.hideEarlierTimeSlots = x;\r\n\r\n if (this.hideEarlierTimeSlots) {\r\n const allTabs = $('.tv4_contingent__selection-portlet .ax-tabs li');\r\n allTabs.addClass('timeslot-tab-unselecteble');\r\n this.inactivateInvalidSlots(0);\r\n }\r\n });\r\n\r\n\r\n this.productSelection = AxLoad.GetModule<AxProdSelection>(\"AxProdSelection\");\r\n\r\n this.productSelection.InteractionSubject.subscribe(x => {\r\n this.CheckContingents(this.isFirstLoad);\r\n this.isFirstLoad = false;\r\n this.ToggleDisableSubmit();\r\n });\r\n\r\n this.productSelection.SubmitSubject.subscribe(x => {\r\n this.AddToCart();\r\n });\r\n\r\n\r\n $('.product_selection__setting_date--placeholder').addClass('d-none');\r\n $('.product_selection__setting_date').removeClass('d-none').html(this.selectedDateCI);\r\n\r\n $('.product_selection__allotment_lang button').click(e => {\r\n that.ActivateLanguage($(e.currentTarget).data('langid'));\r\n });\r\n\r\n this.ActivateLanguage($('.product_selection__allotment_lang button')?.first()?.data('langid') ?? $('.product_selection__allotment_selection')?.first()?.data('langid') ?? 0);\r\n $('.prod_selection__selection-submit').html(this.i18nHelper.GetTranslation(Translations.Reserve));\r\n\r\n $('.product_selection__allotment_selection button.ax-chip').click(e => {\r\n that.SelectionContingent(e.currentTarget);\r\n });\r\n\r\n\r\n $('#tv4_side__selection-timing--toggle').click(e => {\r\n this.ToggleTimings();\r\n });\r\n\r\n this.initMultiTabEvents();\r\n this.initMultiDayEvents();\r\n }\r\n\r\n initMultiTabEvents() {\r\n if ($('.tv4_contingent__selection-portlet .ax-tabs').length > 0) {\r\n\r\n this._AxTab.Init('.tv4_contingent__selection-portlet .ax-tabs');\r\n $('.prod_selection__selection-submit-goNext').click(e => {\r\n this.NextTab();\r\n });\r\n\r\n $('.prod_selection__selection-next-submit').click(e => {\r\n this.NextTab();\r\n });\r\n }\r\n\r\n let $activeTab = $('.tv4_contingent__selection-portlet .ax-tabs li.active');\r\n\r\n if ($activeTab.length > 0) {\r\n $('.prod_selection__selection-submit-goNext').removeClass('d-none');\r\n $('.prod_selection__selection-submit').addClass('d-none');\r\n }\r\n else {\r\n $('.prod_selection__selection-submit').removeClass('d-none');\r\n $('.prod_selection__selection-submit-goNext').addClass('d-none');\r\n }\r\n }\r\n\r\n initMultiDayEvents() {\r\n //Only Multicontingent stuff\r\n if ($('.tv4_contingent__selection-header').length > 0) {\r\n $('.product_selection__allotment_selection').on('click', 'button.prev', (e) => {\r\n const $target = $(e.delegateTarget).find('.product_selection__list_content > div');\r\n const targetWidth = $target.width();\r\n let currTrans = parseInt(($target.css(\"transform\").split(\",\")[4] ?? \"0\").trim()) * -1;\r\n\r\n if (currTrans - targetWidth < 0) {\r\n currTrans = 0;\r\n } else {\r\n currTrans = currTrans - targetWidth;\r\n }\r\n\r\n $target.css('transform', `translateX(${currTrans * -1}px)`);\r\n });\r\n\r\n $('.product_selection__allotment_selection').on('click', 'button.next', (e) => {\r\n const $target = $(e.delegateTarget).find('.product_selection__list_content > div');\r\n const targetWidth = $target.width();\r\n const scrollAbleWidth = $target.find('.tv4_contingent__timeSlotGrid')[0].scrollWidth;\r\n\r\n let currTrans = parseInt(($target.css(\"transform\").split(\",\")[4] ?? \"0\").trim()) * -1;\r\n\r\n if (currTrans + targetWidth > scrollAbleWidth - targetWidth) {\r\n currTrans = scrollAbleWidth - targetWidth;\r\n } else {\r\n currTrans = currTrans + targetWidth;\r\n }\r\n\r\n $target.css('transform', `translateX(${currTrans * -1}px)`);\r\n });\r\n\r\n const resizeObserver = new ResizeObserver(resizeEntries => {\r\n for (let entry of resizeEntries) {\r\n $(entry.target).children().each((i, e) => {\r\n if (Math.ceil(entry.contentBoxSize[0].inlineSize) < $(e).find('.tv4_contingent__timeSlotGrid')[0].scrollWidth) {\r\n $(e).find('.product_selection__list_slide').removeClass('d-none');\r\n } else {\r\n $(e).find('.product_selection__list_slide').addClass('d-none');\r\n }\r\n });\r\n }\r\n });\r\n resizeObserver.observe(document.querySelector('.tv4_contingent__selection'));\r\n\r\n $(`.product_selection__timeSlot_switch`).change(x => {\r\n const $target = $(x.currentTarget);\r\n const timeSlotGroupKey = parseInt($target.attr('data-target'));\r\n\r\n if ($target.prop('checked')) {\r\n const selectedIndex = this.selectedTimeSlots.findIndex(x => x.timeSlotKey.timeSlotGroupKey == timeSlotGroupKey);\r\n\r\n if (selectedIndex != -1) {\r\n const tmpSlot = this.selectedTimeSlots[selectedIndex];\r\n this.SelectNearestTimeSlots(tmpSlot);\r\n this.productSelection.InteractionSubject.next(null);\r\n }\r\n } else {\r\n $(`.product_selection__timeSlot_danger[data-target=\"${timeSlotGroupKey}\"]`).addClass('d-none');\r\n }\r\n });\r\n\r\n this._Slide.Init({\r\n Slider: $('.product_selection__allotment_selection'),\r\n HolderSelector: '.product_selection__list_content > div',\r\n ElemSelector: '.tv4_contingent__selection-list > div'\r\n });\r\n this._AxLimeStone.Alert('.product_selection__timeSlot_danger');\r\n }\r\n }\r\n\r\n ActivateLanguage(langID: number): void {\r\n $(`.product_selection__allotment_lang button`).removeClass('ax-chip--active');\r\n $(`.product_selection__allotment_lang button[data-langid=${langID}]`).addClass('ax-chip--active');\r\n\r\n $('.product_selection__allotment_selection').addClass('d-none');\r\n $(`.product_selection__allotment_selection[data-langid=${langID}]`).removeClass('d-none');\r\n }\r\n\r\n NextTab(): void {\r\n const $activeTab = $('.tv4_contingent__selection-portlet .ax-tabs li.active');\r\n\r\n if (this.hideEarlierTimeSlots) {\r\n $activeTab.addClass('timeslot-tab-checked');\r\n }\r\n\r\n $('.prod_selection__summary-next').fadeOut('fast');\r\n if ($activeTab.next('li').is(':last-child')) {\r\n $('.prod_selection__selection-submit-goNext').addClass('d-none');\r\n $('.prod_selection__selection-submit').removeClass('d-none');\r\n }\r\n this._AxTab.ActivateTab($activeTab.next().attr('data-target'));\r\n }\r\n\r\n CheckContingents(isFirstLoad: boolean) {\r\n let sumQuantity: number = 0;\r\n for (let prod of this.productSelection.ProductListTmp.filter(x => x.TimeSlotGroupKeys != null && x.TimeSlotGroupKeys.length > 0)) {\r\n sumQuantity += prod.Quantity;\r\n }\r\n\r\n for (let slot of this.timeSlotList) {\r\n const $tmpButton: JQuery<Element> = $(slot.elem);\r\n const free: number = slot.availableSlots;\r\n\r\n let newStatus: string = null;\r\n const oldStatus: string = $tmpButton.attr('data-contingentstatus');\r\n\r\n $tmpButton.removeClass(`ax-fill-${oldStatus}-500`);\r\n $tmpButton.removeClass(`ax-outline-${oldStatus}-500`);\r\n\r\n if (!isFirstLoad) {\r\n newStatus = oldStatus;\r\n } else if (free <= slot.warningThreshold || free <= slot.limitedThreshold) {\r\n newStatus = 'orange';\r\n } else {\r\n newStatus = 'green';\r\n }\r\n\r\n $tmpButton.attr('data-contingentstatus', newStatus);\r\n const childSpan = $tmpButton.find(\".subConti_span\");\r\n const childIcon = $tmpButton.find(\".subConti_spanDiv\").find('.las');\r\n if (free > 0 && free >= sumQuantity) {\r\n $tmpButton.removeClass('line-through');\r\n if (this.selectedTimeSlots.filter(x => x.timeSlotKey.equal(slot.timeSlotKey)).length >\r\n 0) {\r\n $tmpButton.addClass(`ax-fill-${newStatus}-500`);\r\n } else {\r\n $tmpButton.addClass(`ax-outline-${newStatus}-500`);\r\n }\r\n\r\n if (childSpan.length > 0) {\r\n let availabilityText = slot.total > 0 ? `${free}/${slot.total}` : free.toString();\r\n\r\n availabilityText += ' ' + this.i18nHelper.GetTranslation(Translations.Free);\r\n childSpan.text(availabilityText);\r\n }\r\n $tmpButton.find(\".subConti_name\").removeClass('line-through');\r\n childIcon.removeClass('la-calendar-times');\r\n childIcon.addClass('la-calendar-check');\r\n } else {\r\n $tmpButton.find(\".subConti_name\").addClass('line-through');\r\n childSpan.text(`${this.i18nHelper.GetTranslation(Translations.SoldOut)}`);\r\n childIcon.removeClass('la-calendar-check');\r\n childIcon.addClass('la-calendar-times');\r\n }\r\n\r\n if (free < sumQuantity && this.selectedTimeSlots.filter(x => x.timeSlotKey.equal(slot.timeSlotKey)).length > 0) {\r\n this.DeactivateContingent(slot.timeSlotKey);\r\n }\r\n }\r\n }\r\n\r\n CheckSuballotmentQuantity(timeSlotKey: TimeSlotKey) {\r\n let sumQuantity: number = 0;\r\n for (let prod of this.productSelection.ProductListTmp.filter(x => x.TimeSlotGroupKeys != null && x.TimeSlotGroupKeys.length > 0)) {\r\n sumQuantity += prod.Quantity;\r\n }\r\n\r\n const slot = this.GetTimeSlot(timeSlotKey);\r\n return slot.availableSlots >= sumQuantity;\r\n }\r\n\r\n DeactivateContingent(timeSlotKey: TimeSlotKey) {\r\n const index: number = this.selectedTimeSlots.findIndex(x => x.timeSlotKey.equal(timeSlotKey));\r\n if (index > -1) {\r\n this.selectedTimeSlots.splice(index, 1);\r\n }\r\n\r\n $(`.product_selection__allotment_selection button[data-timeSlotGroupKey=\"${timeSlotKey.timeSlotGroupKey}\"][data-timeSlotKey1=\"${timeSlotKey.timeSlotKey1}\"][data-timeSlotKey2=\"${timeSlotKey.timeSlotKey2}\"]`).each((i, tmpButton) => {\r\n const $tmpButton: JQuery<Element> = $(tmpButton);\r\n const tmpColor: string = $tmpButton.attr('data-contingentstatus');\r\n $tmpButton.removeClass(`ax-fill-${tmpColor}-500`);\r\n });\r\n\r\n this.PrintSelectedContingents();\r\n }\r\n\r\n SelectionContingent(e: Element, triggerChecks: boolean = true): void {\r\n const $elem: JQuery<Element> = $(e);\r\n const color: string = $elem.attr('data-contingentstatus');\r\n const timeSlotGroupKey: number = parseInt($elem.attr('data-timeSlotGroupKey'));\r\n const timeSlotKey1: string = $elem.attr('data-timeSlotKey1');\r\n const timeSlotKey2: number = parseInt($elem.attr('data-timeSlotKey2'));\r\n\r\n const timeSlotKey: TimeSlotKey = new TimeSlotKey(timeSlotGroupKey, timeSlotKey1, timeSlotKey2);\r\n\r\n if (this.CheckSuballotmentQuantity(timeSlotKey)) {\r\n const currentTimeSlot = this.GetTimeSlot(timeSlotKey);\r\n\r\n for (let timeSlot of this.selectedTimeSlots.filter(x => x.timeSlotKey.timeSlotGroupKey == timeSlotGroupKey && x.day.isSame(currentTimeSlot.day))) {\r\n const $tmpButton = $(`.product_selection__allotment_selection button[data-configno=\"${timeSlot.timeSlotKey.timeSlotGroupKey}\"][data-timeSlotKey1=\"${timeSlot.timeSlotKey.timeSlotKey1}\"][data-timeSlotKey2=\"${timeSlot.timeSlotKey.timeSlotKey2}\"]`);\r\n const tmpColor: string = $tmpButton.attr('data-contingentstatus');\r\n $tmpButton.removeClass(`ax-fill-${tmpColor}-500`).addClass(`ax-outline-${tmpColor}-500`);\r\n }\r\n\r\n const index: number = this.selectedTimeSlots.findIndex(x => x.timeSlotKey.timeSlotGroupKey == timeSlotGroupKey && x.day.isSame(currentTimeSlot.day));\r\n if (index > -1) {\r\n this.selectedTimeSlots.splice(index, 1);\r\n }\r\n\r\n this.selectedTimeSlots.push({\r\n timeSlotKey: timeSlotKey,\r\n day: currentTimeSlot.day,\r\n time: currentTimeSlot.time\r\n });\r\n\r\n this.PrintSelectedContingents();\r\n $elem.removeClass(`ax-outline-${color}-500`).addClass(`ax-fill-${color}-500`);\r\n\r\n if (triggerChecks) {\r\n if ($(`.product_selection__timeSlot_switch[data-target=\"${timeSlotGroupKey}\"]`).prop('checked')) {\r\n this.SelectNearestTimeSlots(currentTimeSlot);\r\n }\r\n this.productSelection.InteractionSubject.next(e);\r\n }\r\n }\r\n\r\n //this.ResetHideEarlierSlots();\r\n const selectedSoapTime: string = $elem.attr('data-slot-startTime');\r\n this.HideEarlierSlots(selectedSoapTime);\r\n }\r\n\r\n // UnHideEarlierSlots\r\n ResetHideEarlierSlots() {\r\n $('.earlier-timeSlot-inactive').removeClass('earlier-timeSlot-inactive');\r\n $('.earlier-timeSlot-header-inactive').removeClass('earlier-timeSlot-header-inactive');\r\n }\r\n\r\n // HideEarlierSlots\r\n async HideEarlierSlots(selectedSoapTime: string) {\r\n if (!this.hideEarlierTimeSlots) {\r\n return;\r\n }\r\n\r\n const activeTabSortNrAttr = $('.tv4_contingent__selection-portlet .ax-tabs li.active').attr('data-sortnr');\r\n const activeTabSortNr = parseInt(activeTabSortNrAttr);\r\n\r\n const allTabs = $('.tv4_contingent__selection-portlet .ax-tabs li');\r\n\r\n if (allTabs.length <= 1) {\r\n return;\r\n }\r\n\r\n const allSorts = new Array<number>();\r\n\r\n const selectedMoment = DateHelper.soapDateTimeToMoment(selectedSoapTime);\r\n\r\n const selectedHour = selectedMoment.hour();\r\n\r\n for (let i = 0; i < allTabs.length; i++) {\r\n const sortNr = $(allTabs[i]).attr('data-sortnr');\r\n allSorts.push(parseInt(sortNr));\r\n }\r\n\r\n const inactiveSorts = allSorts.filter(x => x != activeTabSortNr);\r\n\r\n for (let sort of inactiveSorts) {\r\n\r\n const inactiveTab = $(`[data-sortnr=\"${sort}\"]`);\r\n\r\n // if the tab is after the active tab\r\n if (parseInt(inactiveTab.attr('data-sortnr')) > activeTabSortNr) {\r\n\r\n const dataTarget = $(inactiveTab).attr('data-target');\r\n\r\n const tsHolder = $(`.product_selection__allotment_tab_content[data-target=\"${dataTarget}\"]`);\r\n\r\n const allotmentTimeContainer = tsHolder.find('.product_selection__allotment_time-container');\r\n\r\n for (let i = 0; i < allotmentTimeContainer.length; i++) {\r\n const hourInHeader = parseInt($(allotmentTimeContainer[i]).attr('data-hour'));\r\n const soapDateInHeader = $(allotmentTimeContainer[i]).attr('data-soap-date');\r\n const momentDateInHeader = DateHelper.soapDateToMoment(soapDateInHeader);\r\n\r\n if (momentDateInHeader.isSame(selectedMoment, 'day') && hourInHeader < selectedHour) {\r\n $(allotmentTimeContainer[i]).addClass('earlier-timeSlot-header-inactive');\r\n }\r\n }\r\n\r\n const chips = tsHolder.find('.ax-chip');\r\n\r\n for (let i = 0; i < chips.length; i++) {\r\n const chipSoapTime = $(chips[i]).attr('data-slot-startTime');\r\n const chipMoment = DateHelper.soapDateTimeToMoment(chipSoapTime);\r\n\r\n if (chipMoment.isSame(selectedMoment, 'day') && chipMoment.diff(selectedMoment) <= 0) {\r\n const thisChip = $(chips[i]);\r\n $(thisChip).addClass('earlier-timeSlot-inactive');\r\n } else {\r\n const thisChip = $(chips[i]);\r\n $(thisChip).removeClass('earlier-timeSlot-inactive');\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.inactivateInvalidSlots(activeTabSortNr);\r\n }\r\n\r\n // inactivate timesSlots where no valid slot afterwards is available\r\n inactivateInvalidSlots(startIndex: number) {\r\n\r\n let that = this;\r\n\r\n const allTabs = $('.tv4_contingent__selection-portlet .ax-tabs li');\r\n\r\n let allSorts = new Array<number>();\r\n\r\n for (let i = 0; i < allTabs.length; i++) {\r\n const sortNr = $(allTabs[i]).attr('data-sortnr');\r\n allSorts.push(parseInt(sortNr));\r\n }\r\n\r\n allSorts = allSorts.sort((a, b) => a - b);\r\n\r\n for (let sortIndex = startIndex; sortIndex < (allSorts.length - 1); sortIndex++) {\r\n\r\n const activeTab = $(`[data-sortnr=\"${allSorts[sortIndex]}\"]`);\r\n const dataTargetActiveTab = $(activeTab).attr('data-target');\r\n const tsHolderActive = $(`.product_selection__allotment_tab_content[data-target=\"${dataTargetActiveTab}\"]`);\r\n const activeTabChips = tsHolderActive.find('.ax-chip');\r\n\r\n const nextTab = $(`[data-sortnr=\"${allSorts[sortIndex] + 1}\"]`);\r\n const dataTargetNext = $(nextTab).attr('data-target');\r\n const tsHolderNext = $(`.product_selection__allotment_tab_content[data-target=\"${dataTargetNext}\"]`);\r\n const nextTabsChips = tsHolderNext.find('.ax-chip');\r\n\r\n for (let i = 0; i < activeTabChips.length; i++) {\r\n const chipSoapTime = $(activeTabChips[i]).attr('data-slot-startTime');\r\n const activeChipMoment = DateHelper.soapDateTimeToMoment(chipSoapTime);\r\n\r\n let laterExists = that.checkIfLaterSlotExists(nextTabsChips, activeChipMoment);\r\n\r\n if (!laterExists) {\r\n const thisChip = $(activeTabChips[i]);\r\n $(thisChip).addClass('earlier-timeSlot-inactive');\r\n }\r\n }\r\n }\r\n }\r\n\r\n // checkIfLaterSlotExists\r\n checkIfLaterSlotExists(nextTabsChips: any, activeChipMoment: moment.Moment): boolean {\r\n for (let j = 0; j < nextTabsChips.length; j++) {\r\n\r\n const nextTabChipSoapTime = $(nextTabsChips[j]).attr('data-slot-startTime');\r\n const nextTabChipMoment = DateHelper.soapDateTimeToMoment(nextTabChipSoapTime);\r\n\r\n if (nextTabChipMoment.isAfter(activeChipMoment)) {\r\n\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n SelectNearestTimeSlots(timeSlot: ITimeSlot) {\r\n const time = timeSlot.time;\r\n let nearestTimeSlot: TimeSlotEntry;\r\n\r\n let alwaysSame = true;\r\n\r\n for (let slotDay of this.timeSlotDayList.filter(x => x.timeSlotGroupKey == timeSlot.timeSlotKey.timeSlotGroupKey && !x.day.isSame(timeSlot.day))) {\r\n let currentOffset = 9999;\r\n\r\n for (let tmpSlot of this.timeSlotList.filter(x => x.timeSlotKey.timeSlotGroupKey == slotDay.timeSlotGroupKey && x.day.isSame(slotDay.day))) {\r\n let offset = time - tmpSlot.time;\r\n if (offset < 0) { offset = offset * -1; }\r\n\r\n if (offset < currentOffset && this.CheckSuballotmentQuantity(tmpSlot.timeSlotKey)) {\r\n nearestTimeSlot = tmpSlot;\r\n currentOffset = offset;\r\n\r\n if (offset == 0) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (currentOffset != 0) {\r\n alwaysSame = false;\r\n }\r\n this.SelectionContingent(nearestTimeSlot.elem, false);\r\n }\r\n $(`.product_selection__timeSlot_danger[data-target=\"${timeSlot.timeSlotKey.timeSlotGroupKey}\"]`).toggleClass('d-none', alwaysSame);\r\n }\r\n\r\n PrintSelectedContingents() {\r\n const $template = $('.product_selection__setting_timeSlot--entry');\r\n $(`.product_selection__setting_timeSlot`).html('');\r\n $('.product_selection__setting_timeSlot--placeholder').removeClass('d-none');\r\n\r\n\r\n for (let timeSlotDay of this.timeSlotDayList) {\r\n const configNo = timeSlotDay.timeSlotGroupKey;\r\n const multiDay: boolean = this.timeSlotDayList.filter(x => x.timeSlotGroupKey == configNo).length > 1;\r\n\r\n const selectedSlot = this.selectedTimeSlots.filter(x => x.timeSlotKey.timeSlotGroupKey == configNo && x.day.isSame(timeSlotDay.day));\r\n\r\n if (selectedSlot.length > 0) {\r\n $(`#tv4_side__selection-tab > div[data-target=\"${configNo}\"] .product_selection__setting_timeSlot--placeholder`).addClass('d-none');\r\n const timeSlot = this.GetTimeSlot(selectedSlot[0].timeSlotKey);\r\n\r\n let label = '';\r\n if (multiDay) {\r\n label += `${timeSlot.day.format(this.datePattern)}, `;\r\n }\r\n label += $(timeSlot.elem).find('.subConti_name').html();\r\n\r\n const $entry = $template.clone();\r\n $entry.removeClass('d-none product_selection__setting_timeSlot--entry').html(label);\r\n $(`#tv4_side__selection-tab > div[data-target=\"${configNo}\"] .product_selection__setting_timeSlot`).append($entry);\r\n }\r\n }\r\n }\r\n\r\n\r\n ToggleTimings() {\r\n $('#tv4_side__selection-timing').slideToggle('fast');\r\n\r\n $('#tv4_side__selection-timing--toggle i').toggleClass('las la-angle-down');\r\n $('#tv4_side__selection-timing--toggle i').toggleClass('las la-angle-up');\r\n }\r\n\r\n ToggleDisableSubmit() {\r\n let quantityFound = this.productSelection.GetTotalQuantity() > 0;\r\n\r\n if (!quantityFound) {\r\n $('.prod_selection__summary').fadeOut('fast');\r\n $('.prod_selection__selection-submit').attr('disabled', 'disabled');\r\n return;\r\n }\r\n\r\n let activeTab = $('.tv4_contingent__selection-portlet .ax-tabs li.active');\r\n\r\n if (activeTab.length > 0) {\r\n if (!activeTab.is(':last-child')) {\r\n\r\n let configActiveTab = parseInt(activeTab.attr('data-target'));\r\n if (this.selectedTimeSlots.filter(x => x.timeSlotKey.timeSlotGroupKey == configActiveTab).length == this.timeSlotDayList.filter(x => x.timeSlotGroupKey == configActiveTab).length) {\r\n $('.prod_selection__summary-next').fadeIn('fast');\r\n $('.prod_selection__selection-submit-goNext').removeAttr('disabled');\r\n\r\n if (this.selectedTimeSlots.length == this.timeSlotDayList.length) {\r\n $('.prod_selection__selection-submit-goNext').addClass('d-none');\r\n } else {\r\n $('.prod_selection__selection-submit-goNext').removeClass('d-none');\r\n }\r\n }\r\n\r\n if (this.hideEarlierTimeSlots) {\r\n $('.prod_selection__selection-submit-goNext').removeClass('d-none');\r\n $('.prod_selection__selection-submit').addClass('d-none');\r\n $('.prod_selection__summary-next').fadeIn('fast');\r\n }\r\n\r\n } else {\r\n $('.prod_selection__summary-next').fadeOut('fast');\r\n $('.prod_selection__selection-submit-goNext').attr('disabled', 'disabled');\r\n $('.prod_selection__selection-submit-goNext').addClass('d-none');\r\n }\r\n }\r\n else {\r\n $('.prod_selection__selection-submit-goNext').addClass('d-none');\r\n }\r\n\r\n if (this.selectedTimeSlots.length !== this.timeSlotDayList.length) {\r\n $('.prod_selection__selection-submit').attr('disabled', 'disabled');\r\n return;\r\n }\r\n\r\n let minMaxConstraintModule = AxLoad.GetModule<PackageMinMaxConstraint>('PackageMinMaxConstraint');\r\n\r\n if (minMaxConstraintModule != null) {\r\n let checkMinMaxConstraintResult = minMaxConstraintModule.CheckMinMaxConstraint(this.productSelection.GetTotalQuantity());\r\n\r\n if (checkMinMaxConstraintResult.minMaxOk) {\r\n if (activeTab.is(':last-child') || activeTab.length === 0) {\r\n $('.prod_selection__selection-submit').removeClass('d-none');\r\n $('.prod_selection__selection-submit').removeAttr('disabled');\r\n }\r\n //$('.prod_selection__selection-submit').html(this.i18nHelper.GetTranslation(Translations.Next));\r\n\r\n } else {\r\n $('.prod_selection__selection-submit').attr('disabled', 'disabled');\r\n $('.prod_selection__selection-submit').html(checkMinMaxConstraintResult.errorMessage);\r\n }\r\n } else {\r\n if (activeTab.is(':last-child') || activeTab.length === 0) {\r\n $('.prod_selection__selection-submit').removeClass('d-none');\r\n $('.prod_selection__selection-submit').removeAttr('disabled');\r\n }\r\n }\r\n\r\n this.LoadSummary(quantityFound);\r\n }\r\n\r\n LoadSummary(quantityOk: boolean): void {\r\n if (quantityOk) {\r\n this.productSelection.Apply();\r\n\r\n let quantity: number = 0;\r\n let summaryText: string;\r\n let dateText: string = `${this.selectedDateCI}`;\r\n\r\n if (this.selectedTimeSlots.length == 1) {\r\n const tmpSlot = this.GetTimeSlot(this.selectedTimeSlots[0].timeSlotKey);\r\n dateText += `, ${tmpSlot.elem.innerHTML}`;\r\n }\r\n\r\n for (let prod of this.productSelection.ProductList) {\r\n quantity += prod.Quantity;\r\n }\r\n summaryText = quantity.toString();\r\n\r\n if (quantity == 1) {\r\n summaryText += ` ${this.i18nHelper.GetTranslation(Translations.Ticket)}`;\r\n } else {\r\n summaryText += ` ${this.i18nHelper.GetTranslation(Translations.Tickets)}`;\r\n }\r\n\r\n const $activeLang = $('.product_selection__allotment_lang button.ax-chip--active');\r\n if ($activeLang.length > 0) {\r\n dateText += $activeLang.html() + ' ';\r\n }\r\n\r\n $('.prod_selection__summary-date').html(dateText);\r\n $('.prod_selection__summary-subtotal').html(summaryText);\r\n $('.prod_selection__summary-subtotal--price').html(this.productSelection.Total);\r\n\r\n $('.prod_selection__summary').fadeIn('fast');\r\n } else {\r\n $('.prod_selection__summary').fadeOut('fast');\r\n }\r\n }\r\n\r\n GetProductSum(): number {\r\n let sumQuantity: number = 0;\r\n for (let prod of this.productSelection.ProductListTmp) {\r\n sumQuantity += prod.Quantity;\r\n }\r\n return sumQuantity;\r\n }\r\n\r\n\r\n GetTimeSlot(timeSlotKey: TimeSlotKey): TimeSlotEntry {\r\n return this.timeSlotList.find(x => x.timeSlotKey.equal(timeSlotKey));\r\n }\r\n\r\n initTimeSlotList(init: AxProdBookingInit) {\r\n this.timeSlotList = [];\r\n for (let slot of init.timeSlots) {\r\n slot.timeSlotKey = new TimeSlotKey(slot.timeSlotKey.timeSlotGroupKey,\r\n slot.timeSlotKey.timeSlotKey1,\r\n slot.timeSlotKey.timeSlotKey2);\r\n this.timeSlotList.push(slot);\r\n }\r\n\r\n for (let slot of this.timeSlotList) {\r\n slot.day = moment(slot.date, 'YYYY-MM-DD');\r\n\r\n let tmpDay: TimeSlotDay = {\r\n day: slot.day,\r\n timeSlotGroupKey: slot.timeSlotKey.timeSlotGroupKey\r\n };\r\n if (this.timeSlotDayList.findIndex(x => x.timeSlotGroupKey == tmpDay.timeSlotGroupKey && x.day.isSame(slot.day)) == -1) {\r\n this.timeSlotDayList.push(tmpDay);\r\n }\r\n\r\n if (this.timeSlotGroupKeyList.findIndex(x => x == tmpDay.timeSlotGroupKey) == -1) {\r\n this.timeSlotGroupKeyList.push(tmpDay.timeSlotGroupKey);\r\n }\r\n }\r\n\r\n\r\n for (let slot of this.timeSlotList) {\r\n let tmpButton = $(`.product_selection__allotment_selection .product_selection__allotment_time-container button[data-timeSlotGroupKey=\"${slot.timeSlotKey.timeSlotGroupKey}\"][data-timeSlotKey1=\"${slot.timeSlotKey.timeSlotKey1}\"][data-timeSlotKey2=\"${slot.timeSlotKey.timeSlotKey2}\"]`);\r\n slot.elem = tmpButton[0];\r\n }\r\n }\r\n}\r\n\r\nexport interface AxProdBookingInit {\r\n dateCI: string;\r\n date: string;\r\n timeSlots?: TimeSlotEntry[];\r\n postURL: string;\r\n datePattern: string;\r\n}\r\n", "import { TimeSlotKey } from \"./TimeSlotKey\";\r\n\r\nexport class TimeSlotKeyDto implements ITimeSlotKeyDto {\r\n constructor(timeSlotKey: TimeSlotKey) {\r\n this.timeSlotGroupKey = timeSlotKey.timeSlotGroupKey;\r\n this.timeSlotKey1 = timeSlotKey.timeSlotKey1;\r\n this.timeSlotKey2 = timeSlotKey.timeSlotKey2;\r\n }\r\n\r\n timeSlotGroupKey: number;\r\n timeSlotKey1: string;\r\n timeSlotKey2: number;\r\n}\r\n\r\nexport interface ITimeSlotKeyDto {\r\n timeSlotGroupKey: number;\r\n timeSlotKey1: string;\r\n timeSlotKey2: number;\r\n}", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { AxProdBookingInit } from \"../Abstraction/AxBooking\";\r\nimport { AxBooking } from \"../Abstraction/AxBooking\";\r\nimport { IAddToCartRequest } from \"../../../Models/Tickets/IAddToCartRequest\";\r\nimport { TimeSlotKeyDto } from \"../../../Models/Reservation/TimeSlotKeyDto\";\r\n\r\n@ModuleName(\"AxProdBooking\")\r\nexport class AxProdBooking extends AxBooking implements AxInit {\r\n constructor() { super(); }\r\n\r\n AxInit(initData: AxProdBookingInit): void {\r\n this.Init(initData);\r\n }\r\n\r\n AddToCart(): void {\r\n let requestObj: IAddToCartRequest = {\r\n Date: this.selectedDate,\r\n ProjNr: this.productSelection.ProjNr,\r\n PoolNr: this.productSelection.ProductGroupIdentifier,\r\n TicketTypeId: this.productSelection.Id,\r\n PersonTypes: [],\r\n TimeSlotKeys: []\r\n };\r\n\r\n for (let timeSlot of this.selectedTimeSlots) {\r\n requestObj.TimeSlotKeys.push(new TimeSlotKeyDto(timeSlot.timeSlotKey));\r\n }\r\n\r\n for (let prod of this.productSelection.ProductList) {\r\n if (prod.Quantity > 0) {\r\n requestObj.PersonTypes.push({\r\n PersonTypeId: prod.SubProductIdentifier,\r\n Quantity: prod.Quantity\r\n });\r\n }\r\n }\r\n\r\n this._summaryRedirect.redirect(this.postURL, requestObj, true);\r\n }\r\n}\r\n", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { ProgressBar, ProgressBarMode } from \"../Global/Progressbar\";\r\nimport Swal from \"sweetalert2\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\n\r\n@ModuleName(\"AxProdSummary\")\r\nexport class AxProdSummary implements AxInit {\r\n private InitData: AxSummaryInitData;\r\n\r\n constructor(private _Progressbar = new ProgressBar(),\r\n private _AxLimestone = new AxLimeStone(),\r\n private _I18nHelper = new I18nHelper()\r\n ) { }\r\n\r\n AxInit(init: AxSummaryInitData): void {\r\n this.InitData = init;\r\n\r\n let progress: number = init.ProgressBarMode == ProgressBarMode.Suballotment ? 2 : 1;\r\n\r\n this._Progressbar.Init({\r\n Mode: init.ProgressBarMode,\r\n Progress: progress\r\n });\r\n $('.product_selection__image').lazyload();\r\n\r\n $('.tv4_prod-selection__addToCart-submit').click(e => {\r\n this._AxLimestone.LockButton(e.delegateTarget);\r\n this.CheckSelectedDate();\r\n });\r\n\r\n $('.tv4_side__selection-timing--toggle').click(e => {\r\n this.ToggleTimings(e.delegateTarget);\r\n });\r\n }\r\n\r\n ToggleTimings(delegatedTarget: HTMLElement) {\r\n let $e = $(delegatedTarget);\r\n $e.next().slideToggle('fast');\r\n $e.find('i').toggleClass('las la-angle-down').toggleClass('las la-angle-up');\r\n }\r\n\r\n CheckSelectedDate() {\r\n const currentDate = new Date();\r\n const momentInstance = moment(currentDate);\r\n if (this.InitData.PostData.Date < momentInstance.format('YYYY-MM-DD')) {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.WrongDay),\r\n text: this._I18nHelper.GetTranslation(Translations.WrongSelectedDay),\r\n icon: 'warning',\r\n showCancelButton: false,\r\n confirmButtonText: this._I18nHelper.GetTranslation(Translations.AdminClose)\r\n }).then((result) => {\r\n if (result.isConfirmed) {\r\n window.location.reload();\r\n }\r\n });\r\n }\r\n else {\r\n this.AddToCart(\"Tickets\");\r\n }\r\n }\r\n\r\n AddToCart(continueShoppingPath: string) {\r\n AxessViewer.loadPartialView(this.InitData.PostURL, this.InitData.PostData, (result) => {\r\n\r\n AxLoad.LoadModule('AxFireShoppingCartModal', {\r\n result: result,\r\n continueShoppingPath: continueShoppingPath,\r\n btn: '.tv4_prod-selection__addToCart-submit',\r\n ResetQuantity: false,\r\n queryAddition: this.InitData.ProgressBarMode == ProgressBarMode.Suballotment ? '?ref=pit' : '?ref=pi'\r\n });\r\n }, {\r\n silent: true,\r\n skipShoppingCartReload: false,\r\n addCulturInfo: false\r\n });\r\n }\r\n}\r\n\r\n\r\ninterface AxSummaryInitData {\r\n ProgressBarMode: ProgressBarMode;\r\n PostData: any;\r\n PostURL: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"AxTopBar\")\r\nexport class AxTopBar implements AxInit {\r\n private _InnerMenuOpen: boolean = false;\r\n private HeroObserver: IntersectionObserver;\r\n\r\n AxInit(slimHeader: boolean): void {\r\n if (!slimHeader) {\r\n $(document).ready(x => {\r\n if ($('.ax-hero').length > 0) {\r\n this.CheckTopOffset();\r\n\r\n this.HeroObserver = new IntersectionObserver(\r\n ([e]) => {\r\n document.querySelector('.ax-header').classList.toggle('ax-header--transparent', e.intersectionRatio > 0)\r\n },\r\n { threshold: [0], rootMargin: '-96px 0px 0px 0px' }\r\n );\r\n\r\n if ($('.ax-header').hasClass('ax-header--transparent')) {\r\n this.HeroObserver.observe(document.querySelector('.ax-hero'));\r\n }\r\n } else if ($('.ax-header').length > 0) {\r\n document.querySelector('.ax-header').classList.toggle('ax-header--transparent', false);\r\n }\r\n });\r\n\r\n window.addEventListener(\"scroll\", x => { this.CheckTopOffset() });\r\n }\r\n\r\n $('a[data-ax-toggler], a[data-topbar-toggler]').each((i, e) => {\r\n let $target = $(\"#\" + $(e).data('ax-toggler'));\r\n $target.addClass('ax-toggler');\r\n });\r\n\r\n\r\n $('a[data-ax-toggler=\"topbar_mobile-menu-language\"]').on('click touchstart', function (x) {\r\n $('#body_overlay').toggleClass('d-none');\r\n });\r\n\r\n $('a[data-topbar-toggler]').on('click touchstart', e => {\r\n e.preventDefault();\r\n let $initiator = $(e.currentTarget);\r\n let targetID = $initiator.data('topbar-toggler');\r\n let $target = $(\"#\" + targetID);\r\n\r\n $('a[data-topbar-toggler]').each((i, e) => {\r\n let difTarget = $(e).data('topbar-toggler');\r\n\r\n if (difTarget != targetID) {\r\n $(\"#\" + difTarget).removeClass('ax-slide-y');\r\n }\r\n });\r\n\r\n this._InnerMenuOpen = false;\r\n\r\n $target.find('a[data-ax-toggler]').each((i, x) => {\r\n let $innerToggler = $(\"#\" + $(x).data('ax-toggler'));\r\n let direction = $(x).data('direction');\r\n\r\n if ($innerToggler.hasClass('ax-slide-x') || $innerToggler.hasClass('ax-slide-y')) {\r\n this.ToggleElem($innerToggler, direction);\r\n this._InnerMenuOpen = true;\r\n }\r\n });\r\n if (!this._InnerMenuOpen) {\r\n $('body').toggleClass(\"position-fixed vw-100 ax-menu-open\");\r\n\r\n this.ToggleHeaderMenu($target);\r\n\r\n let $targetBurger = $(\"#\" + $(e.currentTarget).data('burger'));\r\n $($targetBurger).toggleClass('open');\r\n }\r\n });\r\n\r\n $('a[data-ax-toggler]').on('click touchstart', e => {\r\n e.preventDefault();\r\n\r\n let $target = $(\"#\" + $(e.currentTarget).data('ax-toggler'));\r\n let direction = $(e.currentTarget).data('direction');\r\n\r\n this.ToggleElem($target, direction);\r\n });\r\n\r\n $('.ax-nav_sub_mobile-menu').on('click', 'a[data-toggler]', e => {\r\n let subMenuTarget = $(e.currentTarget).attr('data-toggler');\r\n $(e.currentTarget).children('i').toggleClass('la-plus').toggleClass('la-minus');\r\n $('#' + subMenuTarget).slideToggle();\r\n });\r\n }\r\n\r\n CheckTopOffset(): void {\r\n if (document.body.scrollTop > $('.ax-header').height() || document.documentElement.scrollTop > $('.ax-header').height()) {\r\n $('body').addClass('ax-body--top');\r\n } else {\r\n $('body').removeClass('ax-body--top');\r\n }\r\n }\r\n\r\n ToggleElem($target, direction) {\r\n if (direction == 'left') {\r\n $target.toggleClass('ax-slide-right');\r\n $target.toggleClass('ax-slide-x');\r\n }\r\n\r\n if (direction == 'right') {\r\n $target.toggleClass('ax-slide-left');\r\n $target.toggleClass('ax-slide-x');\r\n }\r\n\r\n if (direction == 'top') {\r\n $target.toggleClass('ax-slide-up');\r\n $target.toggleClass('ax-slide-y');\r\n }\r\n\r\n if (direction == 'bottom') {\r\n $target.toggleClass('ax-slide-down');\r\n $target.toggleClass('ax-slide-y');\r\n }\r\n }\r\n\r\n ToggleHeaderMenu($target: JQuery<HTMLElement>): void {\r\n $target.toggleClass('ax-slide-up');\r\n $target.toggleClass('ax-slide-y');\r\n }\r\n}", "export abstract class AxMain {\r\n abstract readonly providers: any;\r\n abstract readonly declarations: any;\r\n abstract readonly utility: any;\r\n\r\n constructor() {\r\n this.Init();\r\n }\r\n\r\n Init() {\r\n if (typeof (this.providers) != 'undefined') {\r\n this.exportProviders();\r\n }\r\n if (typeof (this.declarations) != 'undefined') {\r\n this.exportDeclarations();\r\n }\r\n if (typeof (this.utility) != 'undefined') {\r\n this.exportUtility();\r\n }\r\n }\r\n\r\n exportDeclarations() {\r\n for (let i: number = 0; i < this.providers.length; i++) {\r\n const prov = this.providers[i];\r\n prov.availableProviders = [];\r\n\r\n if (prov.hasOwnProperty('availableProviders')) {\r\n for (let j = 0; j < this.declarations.length; j++) {\r\n const currentDec = this.declarations[j];\r\n const name = this.getModuleName(currentDec);\r\n prov.availableProviders[name] = currentDec;\r\n }\r\n }\r\n }\r\n }\r\n\r\n exportProviders(): void {\r\n this.exportDependencies(this.providers);\r\n }\r\n\r\n exportUtility() {\r\n let dep = this.utility;\r\n this.exportDependencies(dep);\r\n\r\n for (let i: number = 0; i < dep.length; i++) {\r\n const utilMod = dep[i];\r\n\r\n if (typeof utilMod.prototype.AxInit != 'undefined') {\r\n $(document).ready(() => {\r\n //let module = Object.create(utilMod.prototype);\r\n //module.constructor();\r\n let module = new utilMod;\r\n module.AxInit();\r\n });\r\n }\r\n }\r\n }\r\n\r\n exportDependencies(dep: any[]) {\r\n for (let i: number = 0; i < dep.length; i++) {\r\n const name = this.getModuleName(dep[i]);\r\n window[name] = dep[i];\r\n }\r\n }\r\n\r\n getModuleName(dep: any) {\r\n let tmpName = dep.name;\r\n\r\n if (typeof dep.prototype.moduleAliasName != 'undefined' && dep.prototype.moduleAliasName != '') {\r\n tmpName = dep.prototype.moduleAliasName;\r\n }\r\n const name = tmpName;\r\n return name;\r\n }\r\n}\r\n", "import { InfoObject, WeatherData } from '../../../Components/AxCalendar/AxCalendar';\r\nimport { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { CalendarDataInit, SubCCalendar } from '../Abstraction/SubCCalendar';\r\n\r\n@ModuleName(\"AxPackSelectionCalendar\")\r\nexport class AxPackSelectionCalendar extends SubCCalendar implements AxInit {\r\n private ProjNr: number;\r\n private TariffSheetNr: number;\r\n private PackageNr: number;\r\n private PackageProducts: any;\r\n\r\n private Lang: string;\r\n\r\n constructor() { super(); }\r\n\r\n AxInit(initData: CalendarDataTicket) {\r\n this.ProjNr = initData.ProjNr;\r\n this.TariffSheetNr = initData.TariffSheetNr;\r\n this.PackageNr = initData.PackageNr;\r\n this.PackageProducts = initData.PackageProducts;\r\n\r\n this.Lang = initData.Lang;\r\n\r\n this.Init(initData);\r\n\r\n this.ProductSelection.SubmitSubject.subscribe(x => {\r\n $('.prod_selection__form').submit();\r\n });\r\n };\r\n\r\n LoadTickets(month: number, year: number) {\r\n let that = this;\r\n this.LoadingTickets = true;\r\n\r\n AxessViewer.ajaxRequest('/api/TicketsV4TimeSlotApi/GetReservationTimeSlotsForCalendar', {\r\n 'ProjNr': this.ProjNr,\r\n 'ProductGroupIdentifier': this.TariffSheetNr,\r\n 'Id': this.PackageNr,\r\n 'Month': month,\r\n 'Year': year,\r\n 'CiUppercase': this.Lang,\r\n 'SubTypeIdentifiers': this.PackageProducts,\r\n 'Type': 1\r\n }, (resp) => {\r\n for (let i = 0; i < resp.length; i++) {\r\n if (resp[i].TimeSlotInfo != null && resp[i].TimeSlotInfo.length > 0) {\r\n let weatherData: WeatherData = null;\r\n\r\n if (resp[i].WeatherData != null) {\r\n weatherData = {\r\n classNo: resp[i].WeatherData.ClassNo,\r\n minTemp: resp[i].WeatherData.MinTemp,\r\n maxTemp: resp[i].WeatherData.MaxTemp\r\n };\r\n }\r\n\r\n let infoObject: InfoObject = {\r\n Date: resp[i].ValidFrom,\r\n Price: resp[i].Tariff,\r\n AdditionalCellClass: '',\r\n OnClick: that.ActivateDaySub,\r\n ParentScope: that,\r\n ActiveClass: 'axc__row_inner--active',\r\n Currency: this.Currency,\r\n WeatherData: weatherData\r\n };\r\n that.Calendar.addInfo(infoObject);\r\n\r\n that.ProductList.push({\r\n Date: resp[i].ValidFrom,\r\n Products: resp[i].Products,\r\n TimeSlotInfo: resp[i].TimeSlotInfo\r\n });\r\n } else {\r\n let infoObject: InfoObject = { Date: resp[i].ValidFrom, Price: 0, ParentScope: that };\r\n that.Calendar.addInfo(infoObject);\r\n that.Calendar.addCellClass(resp[i].ValidFrom, 'allotment__notificiation--off');\r\n }\r\n }\r\n that.UpdatePrice(true);\r\n that.LoadingTickets = false;\r\n\r\n if (that.NextLoadRequested) {\r\n that.NextLoadRequested = false;\r\n that.Calendar.next(true);\r\n }\r\n }, {\r\n type: 'POST'\r\n });\r\n }\r\n\r\n}\r\n\r\nexport interface CalendarDataTicket extends CalendarDataInit {\r\n TariffSheetNr: number;\r\n PackageNr: number;\r\n PackageProducts: any;\r\n}\r\n", "import Swal from \"sweetalert2\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"B2bMode\")\r\nexport class B2bMode {\r\n constructor(private _AxLimestone = new AxLimeStone(), private _i18nHelper = new I18nHelper) {\r\n this.Init();\r\n }\r\n\r\n Init(): void {\r\n if ($(\"#BtnB2bLogin\").length > 0) {\r\n $(\"#BtnB2bLogin\").click(e => {\r\n this._AxLimestone.LockButton(e.delegateTarget);\r\n this.B2bLogin();\r\n });\r\n }\r\n else {\r\n $(\"#BtnB2bLoadHistory\").click(e => {\r\n this._AxLimestone.LockButton(e.delegateTarget);\r\n this.B2bLoadHistory();\r\n });\r\n this.InitB2BDwnLdBtns();\r\n }\r\n }\r\n\r\n B2bLogin() {\r\n let url = $(\"#Form_B2B_WTP_Login\").data(\"action\") as string;\r\n let errTitle = this._i18nHelper.GetTranslation(Translations.Error);\r\n let that = this;\r\n $.ajax({\r\n url: url,\r\n data: {\r\n \"LoginId\": $(\"#B2bLoginId\").val(),\r\n \"Username\": $(\"#B2bUsername\").val(),\r\n \"Password\": $(\"#B2bPassword\").val()\r\n },\r\n method: \"POST\",\r\n success: function (result) {\r\n if (result.ErrorCode == 0) {\r\n if (result.AciveLimits) {\r\n location.href = url.replace(/\\/Login/, \"/Limits\");\r\n }\r\n else {\r\n location.href = url.replace(/\\/B2B\\/Login/, \"/Home\");\r\n }\r\n return false;\r\n }\r\n\r\n Swal.fire({\r\n title: errTitle,\r\n text: result.ErrorMessage,\r\n icon: \"error\",\r\n position: \"top\",\r\n customClass: {\r\n closeButton: \"ax-btn ax-btn-secondary\"\r\n },\r\n showCancelButton: false\r\n });\r\n that._AxLimestone.UnlockAllButtons();\r\n },\r\n error: function () {\r\n that._AxLimestone.UnlockAllButtons();\r\n }\r\n });\r\n\r\n }\r\n\r\n B2bLoad(url: any, callback: Function) {\r\n let errTitle = this._i18nHelper.GetTranslation(Translations.Error);\r\n $.ajax({\r\n url: url,\r\n data: $(this).serialize(),\r\n dataType: 'binary',\r\n xhrFields: {\r\n 'responseType': 'blob'\r\n },\r\n success: function (data, status, xhr) {\r\n //$('#loader').hide();\r\n // if(data.type.indexOf('text/html') != -1){//If instead of a file you get an error page\r\n // var reader = new FileReader();\r\n // reader.readAsText(data);\r\n // reader.onload = function() {alert(reader.result);};\r\n // return;\r\n // }\r\n let link = document.createElement('a'), filename = 'File.pdf';\r\n\r\n if (xhr.getResponseHeader('Content-Disposition')) { //filename \r\n filename = xhr.getResponseHeader('Content-Disposition');\r\n filename = decodeURIComponent(filename.match(/filename\\*?=([^']*'')?([^;]*)/)[2]);\r\n }\r\n\r\n link.href = URL.createObjectURL(data);\r\n link.download = filename;\r\n link.click();\r\n callback();\r\n },\r\n error: function (xhr, ajaxOptions, thrownError) {\r\n Swal.fire({\r\n title: errTitle,\r\n text: 'Got unknown answer from the Server.',\r\n icon: 'error'\r\n });\r\n callback();\r\n }\r\n });\r\n }\r\n\r\n InitB2BDwnLdBtns() {\r\n $(\"#SalesHistoryListTbl td.b2b-download a[data-url]\").click(e => {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n let target = $(e.currentTarget);\r\n let laEl = target.find('i');\r\n\r\n if (laEl.hasClass(\"b2bDownloadAni\")) {\r\n return;\r\n }\r\n\r\n let isInvoice = laEl.hasClass(\"la-file-invoice\");\r\n\r\n laEl.removeClass(isInvoice ? \"la-file-invoice\" : \"la-ticket-alt\").addClass(\"la-download b2bDownloadAni\");\r\n this.B2bLoad($(e.currentTarget).data(\"url\"),\r\n function () {\r\n laEl.addClass(isInvoice ? \"la-file-invoice\" : \"la-ticket-alt\").removeClass(\"la-download b2bDownloadAni\");\r\n });\r\n });\r\n }\r\n\r\n B2bLoadHistory() {\r\n //let InitB2BDwnLdBtns = this.InitB2BDwnLdBtns;\r\n let that = this;\r\n AxessViewer.loadPartialView('/B2B/History',\r\n {\r\n 'StartDate': $(\"#B2bSalesHistFilterStartDate\").val(),\r\n 'EndDate': $(\"#B2bSalesHistFilterEndDate\").val()\r\n }, function (result) {\r\n $('#b2bSalesHistoryListContainer').html(result);\r\n that.InitB2BDwnLdBtns();\r\n that._AxLimestone.UnlockAllButtons();\r\n },\r\n {\r\n dataType: 'html'\r\n });\r\n }\r\n}", "import swal from 'sweetalert2';\r\nimport tippy from 'tippy.js';\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { ProductTypeConstant } from \"../../Lib/Constants/ProductTypeConstant\";\r\nimport { ArrayHelper } from \"../../Lib/Helper/ArrayHelper\";\r\nimport { CookieHelper } from \"../../Lib/Helper/CookieHelper\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { AxAlert } from \"../../Limestone/AxAlert/AxAlert\";\r\nimport { AxButton } from \"../../Limestone/AxButton/AxButton\";\r\nimport { ProgressBar, ProgressBarMode } from \"../Global/Progressbar\";\r\nimport { AxCounter } from '../../Limestone/AxCounter/AxCounter';\r\nimport { debounceTime } from 'rxjs';\r\nimport { AxReloadable } from '../../Lib/AxSystem/AxReloadable';\r\n\r\n// Declare functions\r\ndeclare function checkShoppingCartPartialViewResult(result: any): void;\r\ndeclare function block(elementId: string): void;\r\n\r\n@ModuleName(\"ShoppingCart\")\r\nexport class ShoppingCart implements AxInit, AxReloadable {\r\n private initData: ShoppingCartInit;\r\n private instanceInfo: any;\r\n constructor(\r\n protected _Progressbar = new ProgressBar(),\r\n protected _i18nHelper = new I18nHelper(),\r\n protected _arrayHelper = new ArrayHelper(),\r\n protected _axButton = new AxButton(),\r\n protected _requestHelper = new RequestHelper(),\r\n protected _cookieHelper = new CookieHelper(),\r\n protected _dateInitData = new BirthDateInitData(),\r\n ) { }\r\n\r\n AxInit(init: ShoppingCartInit): void {\r\n this.initData = init;\r\n\r\n $('#cart_holder').on('click', '.tv4_side__selection-timing--toggle', (e) => {\r\n this.toggleTimings(e.currentTarget);\r\n });\r\n\r\n new AxAlert('.cart__alert');\r\n let progress: number = init.progressBarMode == ProgressBarMode.Suballotment ? 3 : 2;\r\n\r\n this._Progressbar.Init({\r\n Mode: init.progressBarMode,\r\n Progress: progress\r\n });\r\n\r\n this.printErrors(init.errorList);\r\n document.addEventListener(\"visibilitychange\", this.handleVisibilityChange);\r\n this.registerEventsPersonHolder();\r\n\r\n\r\n $('#cart_holder').on('change', '.PayAtPickup', (e) => {\r\n this.handlePayAtPickupChange(e.currentTarget.checked);\r\n });\r\n\r\n $(document)\r\n .on('keydown', 'input[data-license-plate]', (e) => {\r\n const pattern: RegExp = /^[a-zA-Z0-9äëïöüÄËÃÖÜ]$/g;\r\n const regExp = new RegExp(pattern);\r\n if (e.ctrlKey || e.altKey || typeof e.key !== 'string' || e.key.length !== 1) {\r\n return;\r\n }\r\n if (!regExp.test(e.key) && e.key !== 'Backspace') {\r\n e.preventDefault();\r\n }\r\n })\r\n .on('keyup', 'input[data-license-plate]', (e) => {\r\n $(e.target).val(($(e.target).val()).toUpperCase());\r\n });\r\n\r\n this.CheckIfWaiverIsRequired();\r\n $('#cart_holder').on('click', '[data-shoppingcart=\"proceed\"]', (e) => {\r\n //---------- terrible outdated code, don't extend, refactor -----------------\r\n let openpassMissing = false;\r\n $('.cart-pos').each(function (index, elem) {\r\n let id = $(elem).attr('id').replace('position_', '');\r\n\r\n let hiddenInputProductType = $('input#productType_' + id);\r\n if ($(hiddenInputProductType).val() == '' + ProductTypeConstant.OPENPASS && $('.openPass-input-' + id).val() == '') {\r\n openpassMissing = true;\r\n }\r\n });\r\n\r\n if (openpassMissing) {\r\n swal.fire({\r\n title: this._i18nHelper.GetTranslation(Translations.Error),\r\n html: this._i18nHelper.GetTranslation(Translations.WtpPleaseInsert),\r\n icon: 'error',\r\n customClass: {\r\n closeButton: 'btn btn-secondary',\r\n confirmButton: 'btn btn-primary',\r\n },\r\n confirmButtonText: this._i18nHelper.GetTranslation(Translations.Ok),\r\n });\r\n return;\r\n }\r\n\r\n if ($('.legitimationDisclaimer:checkbox:not(:checked)').length != 0) {\r\n e.preventDefault();\r\n swal.fire({\r\n title: this._i18nHelper.GetTranslation(Translations.Error),\r\n html: this._i18nHelper.GetTranslation(Translations.LegitimationCheckError),\r\n icon: 'error',\r\n customClass: {\r\n closeButton: 'btn btn-secondary',\r\n confirmButton: 'btn btn-primary',\r\n },\r\n confirmButtonText: this._i18nHelper.GetTranslation(Translations.Ok),\r\n });\r\n return;\r\n }\r\n\r\n\r\n let validationError = false;\r\n $('.cart__addArticleSelect').each((i, e) => {\r\n if ($(e).val() == 0 || $(e).val() == \"\") {\r\n swal.fire({\r\n title: this._i18nHelper.GetTranslation(Translations.Error),\r\n html: this._i18nHelper.GetTranslation(Translations.ProductSelectionRequired),\r\n icon: 'error',\r\n customClass: {\r\n closeButton: 'btn btn-secondary',\r\n confirmButton: 'btn btn-primary',\r\n },\r\n confirmButtonText: this._i18nHelper.GetTranslation(Translations.Ok),\r\n });\r\n $(e).addClass('invalid');\r\n validationError = true;\r\n }\r\n });\r\n\r\n $('input[data-license-plate]').each((i, e) => {\r\n $(e).val($(e).val().toString().replace(/[^A-Z0-9ÄËÃÖÜ]/g, ''));\r\n });\r\n\r\n if (validationError) {\r\n return;\r\n }\r\n //-----------------------------------------------------------------\r\n $('#checkout_form').trigger('submit');\r\n });\r\n\r\n this.initQuantityCounters();\r\n }\r\n\r\n initQuantityCounters() {\r\n const counters = $('[data-counter-cartEntryID]');\r\n counters.each((i, counter) => {\r\n\r\n const relatedTicketsString = counter.getAttribute('data-counter-related-tickets');\r\n const cartEntryId = counter.getAttribute('data-counter-cartEntryID');\r\n const totalCartEntries = relatedTicketsString?.split('+') ?? [];\r\n\r\n let axCounter = new AxCounter();\r\n axCounter.Init({\r\n Value: totalCartEntries.length,\r\n Selector: counter,\r\n Max: this.initData.maxItems || 10,\r\n Min: 1,\r\n });\r\n axCounter.getSubscription()\r\n .pipe(\r\n debounceTime(1000),\r\n )\r\n .subscribe(currentCount => {\r\n if (totalCartEntries.length > currentCount) {\r\n const itemsToDelete = totalCartEntries.slice(currentCount - totalCartEntries.length);\r\n this.deleteGropuedItems(cartEntryId, itemsToDelete);\r\n } else if (totalCartEntries.length < currentCount) {\r\n this.createGropuedItems(cartEntryId, (currentCount - totalCartEntries.length))\r\n }\r\n });\r\n });\r\n }\r\n\r\n AxReload(init: any) {\r\n this.initQuantityCounters();\r\n }\r\n\r\n initPersonalisation() {\r\n $('.positionPersonalisation_birthday').each((i, e) => {\r\n let cartEntryId = $(e).attr('data-for-entry');\r\n let datePatternId = $(`#datePatternId_${cartEntryId}`).val();\r\n let dateInitData = {\r\n birthdayPattern: datePatternId.toString(),\r\n outputTarget: `input[type=\"hidden\"]#DateOfBirthCi_${cartEntryId}`,\r\n parentId: `#needPersonId_${cartEntryId}`,\r\n setBirthDate: $(`#DateOfBirthCi_${cartEntryId}`).val(),\r\n };\r\n AxLoad.LoadModule('AxBirthDateInputTriple', dateInitData);\r\n });\r\n }\r\n\r\n registerEventsPersonHolder() {\r\n $('#cart_holder').on('blur', '.person-form input[type=text], .person-form input[type=hidden], .person-form .ax-dropdown__trigger', (e) => {\r\n\r\n let cartEntryIDToUpdatePerson = $(e.currentTarget).attr('data-for-entry');\r\n\r\n $('#personalisation_' + cartEntryIDToUpdatePerson + ' .ce-person__firstname').removeClass('invalid');\r\n $('#personalisation_' + cartEntryIDToUpdatePerson + ' .ce-person__lastname').removeClass('invalid');\r\n $('#personalisation_' + cartEntryIDToUpdatePerson + ' .ce-person__dateofbirth').removeClass('invalid');\r\n\r\n let firstName = ($('#personalisation_' + cartEntryIDToUpdatePerson + ' .ce-person__firstname').val() as string).trim();\r\n let lastName = ($('#personalisation_' + cartEntryIDToUpdatePerson + ' .ce-person__lastname').val() as string).trim();\r\n\r\n let dateOfBirth = ($('#personalisation_' + cartEntryIDToUpdatePerson + ' .ce-person__dateofbirth').val() as string).trim();\r\n\r\n this.updateEntryPerson(firstName, lastName, dateOfBirth, cartEntryIDToUpdatePerson);\r\n });\r\n }\r\n\r\n updateEntryPerson(firstName: string, lastName: string, dateOfBirth: string, cartEntryId: string) {\r\n if (firstName != '' && lastName != '' && dateOfBirth != '') {\r\n let data = {\r\n cartEntryID: cartEntryId,\r\n Firstname: firstName,\r\n Lastname: lastName,\r\n DateOfBirth: dateOfBirth\r\n };\r\n AxessViewer.loadPartialView('/ShoppingCart/UpdateEntryPerson', data, resp => { }, {\r\n silent: true\r\n });\r\n\r\n } else {\r\n if (firstName == '') {\r\n $('#personalisation_' + cartEntryId + ' .ce-person__firstname').addClass('invalid');\r\n }\r\n if (lastName == '') {\r\n $('#personalisation_' + cartEntryId + ' .ce-person__lastname').addClass('invalid');\r\n }\r\n if (dateOfBirth == '') {\r\n $('#personalisation_' + cartEntryId + ' .ce-person__dateofbirth').addClass('invalid');\r\n }\r\n }\r\n }\r\n\r\n StateInit(state: ShoppingCartState): void {\r\n this.displayPayAtPickupPrices(state.checkboxState);\r\n }\r\n\r\n handleVisibilityChange() {\r\n const prefix: string = \"legitimation_\";\r\n const fileInputs: NodeListOf<HTMLInputElement> = document.querySelectorAll('input[type=\"file\"]');\r\n const exists: boolean = Array.from(fileInputs).some(input => input.id.startsWith(prefix));\r\n const userAgent = window.navigator.userAgent;\r\n let isSafari = /iPhone|iPad|iPod/i.test(userAgent) && /Safari/i.test(userAgent) && !/Chrome/i.test(userAgent);\r\n\r\n if (!document.hidden) {\r\n if (exists && isSafari) {\r\n setTimeout(function () {\r\n location.reload();\r\n }, 2000);\r\n }\r\n else {\r\n location.reload();\r\n }\r\n }\r\n }\r\n\r\n displayPayAtPickupPrices(isChecked) {\r\n if (isChecked) {\r\n $('.PayAtPickupPrices').show();\r\n $('.control-alert').show();\r\n } else {\r\n $('.PayAtPickupPrices').hide();\r\n $('.control-alert').hide();\r\n }\r\n }\r\n\r\n handlePayAtPickupChange(isChecked) {\r\n this._cookieHelper.setCookie('payAtPickup', isChecked, 1);\r\n this.displayPayAtPickupPrices(isChecked);\r\n }\r\n\r\n toggleTimings(target: HTMLElement) {\r\n let $e = $(target);\r\n $e.next().slideToggle('fast');\r\n $e.find('i').toggleClass('las la-angle-down').toggleClass('las la-angle-up');\r\n }\r\n\r\n printErrors(errorList: ResponseModel[]) {\r\n if (errorList == null || errorList.length === 0) {\r\n return;\r\n }\r\n\r\n errorList.forEach((e) => {\r\n this.addNewMessage(`[data-error-cart-entry-id=\"${e.id}\"]`, e.id, e.errorNr, e.errorMsg);\r\n });\r\n }\r\n\r\n CheckIfWaiverIsRequired() {\r\n if (this.initData.WaiverIsEnabled) {\r\n this.handleWaiverEnabled();\r\n } else {\r\n this.showProceedButton();\r\n }\r\n }\r\n\r\n handleWaiverEnabled() {\r\n if (this.initData.OneRISKProcessRequired) {\r\n this.handleOneRiskProcessRequired();\r\n } else {\r\n this.handleOneRiskNotRequired();\r\n }\r\n }\r\n\r\n handleOneRiskProcessRequired() {\r\n if ($('.waiver__tripple').length > 0) {\r\n this.checkAllOneRiskProcessesCompleted();\r\n } else {\r\n this.showProceedButton();\r\n }\r\n }\r\n\r\n handleOneRiskNotRequired() {\r\n if ($('.waiver__tripple').length > 0) {\r\n swal.fire({\r\n title: this._i18nHelper.GetTranslation(Translations.Warning),\r\n html: this._i18nHelper.GetTranslation(Translations.OneRISKNecessityMessage),\r\n icon: 'warning',\r\n customClass: {\r\n closeButton: 'btn btn-secondary',\r\n confirmButton: 'btn btn-primary',\r\n },\r\n confirmButtonText: this._i18nHelper.GetTranslation(Translations.Ok),\r\n }).then((result) => {\r\n if (result.isConfirmed) {\r\n this.showProceedButton();\r\n }\r\n });\r\n } else {\r\n this.showProceedButton();\r\n }\r\n }\r\n\r\n checkAllOneRiskProcessesCompleted() {\r\n let allTrue = true;\r\n\r\n $('.waiver__tripple').each((i, e) => {\r\n let oneRiskprocessCompleted = $(e).attr('one-risk-completed');\r\n\r\n if (oneRiskprocessCompleted !== 'true') {\r\n allTrue = false;\r\n return false;\r\n }\r\n });\r\n\r\n if (allTrue) {\r\n this.showProceedButton();\r\n } else {\r\n this.hideProceedButtonWithTooltip();\r\n }\r\n }\r\n\r\n hideProceedButtonWithTooltip() {\r\n $('[data-shoppingcart=\"proceed\"]').replaceWith(\r\n $('<span>')\r\n .addClass('ax-btn ax-btn ax-btn-secondary flex-1 flex-lg-grow-0')\r\n .attr('data-shoppingcart', 'waiverIsRequired')\r\n .html(this._i18nHelper.GetTranslation(Translations.OneRISKProcessIsRequiredBeforeProceed) + '<i class=\"la la-exclamation-circle\"></i>')\r\n );\r\n this.instanceInfo = tippy(document.querySelector('.waiver__inactive'), {\r\n content: this._i18nHelper.GetTranslation(Translations.OneRISKProcessIsRequiredBeforeProceed),\r\n placement: 'bottom',\r\n interactive: true,\r\n trigger: 'manual',\r\n theme: 'material',\r\n });\r\n this.instanceInfo.show();\r\n $('.waiver__inactive').addClass('waiver-border ax-border-radius');\r\n this._axButton.StopLoading($('.proceedToCheckoutBtn')[0]);\r\n }\r\n\r\n showProceedButton() {\r\n $('[data-shoppingcart=\"proceed\"]').replaceWith(\r\n $('<button>')\r\n .addClass('ax-btn ax-btn-primary flex-1 flex-lg-grow-0')\r\n .attr('data-shoppingcart', 'proceed')\r\n .html(this._i18nHelper.GetTranslation(Translations.ProceedToCheckout))\r\n );\r\n }\r\n\r\n // Add (<div data-cart-entry-id=\"cartEntryId\" data-error-code=\"code\"> + <span> message </span> </div>) to the containerSelector.\r\n addNewMessage(containerSelector, cartEntryId, code, message) {\r\n const div$ = $('<div>', { class: 'validation-warning col-lg-12 pl-4' }).attr('data-cart-entry-id', `${cartEntryId}`).attr('data-error-code', `${code}`);\r\n const span$ = $('<span>', { class: 'error-holder ax-ml-1' }).html(message);\r\n\r\n $(`${containerSelector}`).append(div$.append(span$));\r\n $(`${containerSelector}`).removeClass('d-none');\r\n };\r\n\r\n deleteGropuedItems(cartEntryId: string, itemsToDelete: string[]) {\r\n block('#cart_holder');\r\n const relatedTickets = itemsToDelete.reduce((acc, x) => acc += Boolean(x) ? '&relatedTickets=' + x : '', '');\r\n const data = $(\"#checkout_form\").serialize() + \"&targetPositionId=\" + cartEntryId + relatedTickets;\r\n AxessViewer.loadPartialView('/ShoppingCart/RemoveFromCart', data, checkShoppingCartPartialViewResult);\r\n }\r\n\r\n createGropuedItems(cartEntryId: string, itemsToAdd: number) {\r\n block('#cart_holder');\r\n const data = $(\"#checkout_form\").serialize() + \"&cartEntryId=\" + cartEntryId + \"&numberOfItemsToAdd=\" + itemsToAdd;\r\n AxessViewer.loadPartialView('/ShoppingCart/AddGroupedTicketToCart', data, checkShoppingCartPartialViewResult);\r\n }\r\n\r\n}\r\n\r\ndocument.addEventListener(\"DOMContentLoaded\", () => {\r\n const shoppingCart = new ShoppingCart();\r\n const cookieHelper = new CookieHelper();\r\n\r\n let payAtPickupState = true;\r\n const payAtPickupCookie = cookieHelper.getCookie('payAtPickup');\r\n\r\n if (payAtPickupCookie !== null) {\r\n payAtPickupState = payAtPickupCookie === 'true';\r\n } else {\r\n cookieHelper.setCookie('payAtPickup', 'true', 1);\r\n }\r\n\r\n $('.PayAtPickup').prop('checked', payAtPickupState);\r\n shoppingCart.displayPayAtPickupPrices(payAtPickupState);\r\n});\r\n\r\nclass ShoppingCartInit {\r\n processIndicatorActive?: boolean;\r\n progressBarMode?: ProgressBarMode;\r\n customerSignedIn?: boolean;\r\n OneRISKProcessRequired?: boolean;\r\n WaiverIsEnabled?: boolean;\r\n errorList: ResponseModel[];\r\n maxItems: number;\r\n}\r\n\r\nclass ShoppingCartState {\r\n checkboxState?: boolean;\r\n}\r\n\r\nclass BirthDateInitData {\r\n birthdayPattern: string;\r\n parentId: string;\r\n outputTarget: string;\r\n setDay: string;\r\n setMonth: string;\r\n setYear: string;\r\n setBirthDate: string;\r\n}\r\n\r\nclass ResponseModel {\r\n errorTitle: string;\r\n success: boolean;\r\n errorNr: number;\r\n errorMsg: string;\r\n id: number;\r\n}", "export enum ProductTypeConstant {\r\n Undefined = 0,\r\n Barcode = 1,\r\n WTPTicket = 2,\r\n Voucher = 3,\r\n SWISSPASS = 4,\r\n BarcodeVoucher = 5,\r\n OPENPASS = 6,\r\n DTA_TICKET = 7\r\n}", "export class ArrayHelper {\r\n onlyUnique(value, index, self) {\r\n return self.indexOf(value) === index;\r\n }\r\n}", "export class CookieHelper {\r\n setCookie(name: string, value: string | number | boolean, days: number) {\r\n let expires = \"\";\r\n if (days) {\r\n let date = new Date();\r\n date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));\r\n expires = \"; expires=\" + date.toUTCString();\r\n }\r\n document.cookie = name + \"=\" + (value.toString() || \"\") + expires + \"; path=/\";\r\n }\r\n\r\n getCookie(name) {\r\n let nameEQ = name + \"=\";\r\n let ca = document.cookie.split(';');\r\n for (let i = 0; i < ca.length; i++) {\r\n let c = ca[i];\r\n while (c.charAt(0) == ' ') c = c.substring(1, c.length);\r\n if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);\r\n }\r\n return null;\r\n }\r\n\r\n eraseCookie(name: string) {\r\n document.cookie = name + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { IAddToCartRequest } from \"../../../Models/Package/IAddToCartRequest\";\r\nimport { AxProdBookingInit } from \"../Abstraction/AxBooking\";\r\nimport { AxBooking } from \"../Abstraction/AxBooking\";\r\nimport { TimeSlotKeyDto } from \"../../../Models/Reservation/TimeSlotKeyDto\";\r\n\r\n@ModuleName(\"AxPackBooking\")\r\nexport class AxPackBooking extends AxBooking implements AxInit{\r\n constructor() { super(); }\r\n\r\n AxInit(initData: AxProdBookingInit): void {\r\n this.Init(initData);\r\n }\r\n\r\n AddToCart(): void {\r\n let requestObj: IAddToCartRequest = {\r\n Date: this.selectedDate,\r\n ProjNr: this.productSelection.ProjNr,\r\n PackTariffSheetNo: this.productSelection.ProductGroupIdentifier,\r\n PackageNr: this.productSelection.Id,\r\n PackagePositions: [],\r\n TimeSlotKeys: []\r\n };\r\n \r\n for (let timeSlot of this.selectedTimeSlots) {\r\n requestObj.TimeSlotKeys.push(new TimeSlotKeyDto(timeSlot.timeSlotKey));\r\n }\r\n\r\n for (let prod of this.productSelection.ProductList) {\r\n if (prod.Quantity > 0) {\r\n requestObj.PackagePositions.push({\r\n PackSort: prod.Sort,\r\n Quantity: prod.Quantity,\r\n PackPos: prod.SubProductIdentifier\r\n });\r\n }\r\n }\r\n\r\n this._summaryRedirect.redirect(this.postURL, requestObj, true);\r\n }\r\n}", "import { fromEvent, Observable } from 'rxjs';\r\nimport { AxDatePicker, Cell, Mode } from '../../Components/AxDatepicker/AxDatepicker';\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { RequestHelper } from '../../Lib/Helper/RequestHelper';\r\nimport { AxProgressBar, Step } from \"../../Limestone/AxProgressBar/AxProgressBar\";\r\nimport { ProgressBar, ProgressBarMode } from \"../Global/Progressbar\";\r\nimport Swal, { SweetAlertOptions } from 'sweetalert2';\r\nimport { AxAlertBanner as AxMessage } from \"../../Limestone/AxMessage/AxAlertBanner\";\r\nimport { I18nHelper, Translations } from '../../Lib/Helper/I18nHelper';\r\nimport { TimeSlotKey } from \"../../Models/Reservation/TimeSlotKey\";\r\nimport { AxDropdown, IAxDropdownOptions } from \"@axess/limestone\";\r\n\r\n\r\n@ModuleName(\"TimeSlots\")\r\nexport class TimeSlots implements AxInit {\r\n private InitData: TimeSlotInitData;\r\n\r\n public ProjectNr: number;\r\n public PosNr: number;\r\n public SerialNr: number;\r\n\r\n protected DatePicker: AxDatePicker;\r\n protected DatePickerMobile: AxDatePicker;\r\n protected DatePattern: string;\r\n\r\n protected DateDropdown: AxDropdown = new AxDropdown();\r\n protected selectedTimeSlots: TimeSlotKey[] = [];\r\n\r\n protected btnSubmit = document.getElementById('goNext') as HTMLButtonElement;\r\n\r\n protected AxMessage: AxMessage = new AxMessage();\r\n\r\n constructor(private _Progressbar = new ProgressBar(),\r\n private _AxProgressBar = new AxProgressBar,\r\n protected _RequestHelper = new RequestHelper(),\r\n private _i18nHelper = new I18nHelper) { }\r\n\r\n\r\n AxInit(init: TimeSlotInitData): void {\r\n this.InitData = init;\r\n this.DatePicker = new AxDatePicker();\r\n this.DatePickerMobile = new AxDatePicker();\r\n let sts: Step[] = this._Progressbar.GetReservationSteps();\r\n\r\n $(document).on(\"click\", \"button.ax-chip\", (e) => {\r\n this.SelectionContingent(e.currentTarget);\r\n });\r\n\r\n this.btnSubmit.disabled = true;\r\n\r\n this.btnSubmit.addEventListener('click', (e: Event) => this.SaveData());\r\n\r\n this.DatePattern = this.InitData.DatePatternYear;\r\n \r\n this.DateDropdown.init(`#date_out`,\r\n {\r\n searchBar: false,\r\n multiSelect: false\r\n });\r\n\r\n this.DatePicker.Init({\r\n StartOfWeek: this.InitData.StartOfWeek,\r\n Lang: this.InitData.Lang,\r\n StartDate: moment(this.InitData.StartDate, \"YYYY-MM-DD\"),\r\n Target: '#tariff_date',\r\n Mode: Mode.Inline,\r\n EndDate: moment(this.InitData.EndDate, \"YYYY-MM-DD\"),\r\n BlockedDates: null,\r\n AvailableDates: null\r\n });\r\n\r\n this.DatePickerMobile.Init({\r\n StartOfWeek: this.InitData.StartOfWeek,\r\n Lang: this.InitData.Lang,\r\n StartDate: moment(this.InitData.StartDate, \"YYYY-MM-DD\"),\r\n Target: '#tariff_date_mobile',\r\n Mode: Mode.Endless,\r\n EndDate: moment(this.InitData.EndDate, \"YYYY-MM-DD\")\r\n });\r\n\r\n this.DatePicker.ActivationSubject.subscribe(x => this.CheckDate(x));\r\n this.DatePickerMobile.ActivationSubject.subscribe(x => this.CheckDate(x));\r\n\r\n let ddlDate$: Observable<MouseEvent>;\r\n\r\n ddlDate$ = fromEvent<MouseEvent>(document.getElementById(\"date_out\"), 'click');\r\n \r\n ddlDate$\r\n .subscribe((sp) => {\r\n let $calendar = $(\"#testni_div\");\r\n $calendar.toggleClass('d-none');\r\n\r\n let $calendar2 = $(\"#testni_div2\");\r\n $calendar2.toggleClass('d-none');\r\n });\r\n }\r\n\r\n CheckDate(x: Cell) {\r\n if (x != null) {\r\n let $calendar = $(\"#testni_div\");\r\n $calendar.addClass('d-none');\r\n\r\n let $calendar2 = $(\"#testni_div2\");\r\n $calendar2.addClass('d-none');\r\n\r\n\r\n\r\n this.ClearSelectedContigents();\r\n\r\n\r\n let formatedDate = x.Date.format(this.DatePattern);\r\n let $slot_div = $('.product_selection__allotment_selection');\r\n $slot_div.addClass('ax-loading');\r\n\r\n this.DateDropdown.setValue(formatedDate);\r\n\r\n AxessViewer.loadPartialView('/Reservations/_LoadContigents', { projNr: this.InitData.ProjNr, posNr: this.InitData.PosNr, serialNr: this.InitData.SerialNr, date: formatedDate }, (resp) => {\r\n $slot_div.html(resp.view);\r\n $slot_div.removeClass('ax-loading');\r\n }, {});\r\n }\r\n }\r\n\r\n SelectionContingent(e: Element): void {\r\n let $elem: JQuery<Element> = $(e);\r\n let color: string = 'green';\r\n\r\n const timeSlotGroupKey: number = parseInt($elem.data('timeslotgroupkey'));\r\n const timeSlotKey1 = $elem.data('timeslotkey1');\r\n const timeSlotKey2: number = parseInt($elem.data('timeslotkey2'));\r\n\r\n const timeSlotKey: TimeSlotKey = new TimeSlotKey(timeSlotGroupKey, timeSlotKey1, timeSlotKey2);\r\n\r\n for (let timeSlot of this.selectedTimeSlots.filter(x => x.timeSlotGroupKey === timeSlotGroupKey)) {\r\n let $tmpButton = $(`.product_selection__allotment_selection button[data-timeSlotGroupKey=\"${timeSlot.timeSlotGroupKey}\"][data-timeSlotKey1=\"${timeSlot.timeSlotKey1}\"][data-timeSlotKey2=\"${timeSlot.timeSlotKey2}\"]`);\r\n let tmpColor: string = $tmpButton.attr('data-contingentstatus');\r\n $tmpButton.removeClass(`ax-fill-${tmpColor}-500`).addClass(`ax-outline-${tmpColor}-500`);\r\n }\r\n\r\n let index: number = this.selectedTimeSlots.findIndex(x => x.timeSlotGroupKey === timeSlotGroupKey);\r\n if (index > -1) {\r\n this.selectedTimeSlots.splice(index, 1);\r\n }\r\n\r\n this.selectedTimeSlots.push(timeSlotKey);\r\n $elem.removeClass(`ax-outline-${color}-500`).addClass(`ax-fill-${color}-500`);\r\n this.CheckSelection();\r\n }\r\n\r\n deactivateContingent(timeSlotKey: TimeSlotKey) {\r\n let index: number = this.selectedTimeSlots.findIndex(x => x.equal(timeSlotKey));\r\n if (index > -1) {\r\n this.selectedTimeSlots.splice(index, 1);\r\n }\r\n\r\n $(`.product_selection__allotment_selection button[data-timeSlotGroupKey=\"${timeSlotKey.timeSlotGroupKey}\"][data-timeSlotKey1=\"${timeSlotKey.timeSlotKey1}\"][data-timeSlotKey2=\"${timeSlotKey.timeSlotKey2}\"]`).each((i, tmpButton) => {\r\n let $tmpButton: JQuery<Element> = $(tmpButton);\r\n let tmpColor: string = $tmpButton.attr('data-contingentstatus');\r\n $tmpButton.removeClass(`ax-fill-${tmpColor}-500`);\r\n });\r\n }\r\n\r\n CheckSelection() {\r\n let contains = true;\r\n let that = this;\r\n\r\n if (that.selectedTimeSlots.length > 0) {\r\n contains = true;\r\n }\r\n else {\r\n contains = false;\r\n }\r\n\r\n if (contains) {\r\n this.btnSubmit.disabled = false;\r\n } else {\r\n this.btnSubmit.disabled = true;\r\n }\r\n }\r\n\r\n ClearSelectedContigents(): void {\r\n this.selectedTimeSlots = [];\r\n }\r\n\r\n SaveData(): void {\r\n let tmp = [];\r\n\r\n for (let timeSlot of this.selectedTimeSlots) {\r\n tmp.push({\r\n timeSlotGroupKey: timeSlot.timeSlotGroupKey,\r\n timeSlotKey1: timeSlot.timeSlotKey1.toString(),\r\n timeSlotKey2: timeSlot.timeSlotKey2\r\n });\r\n }\r\n\r\n if (this.selectedTimeSlots.length === 1) {\r\n Swal.fire({\r\n title: this._i18nHelper.GetTranslation(Translations.AreYouSure),\r\n text: this._i18nHelper.GetTranslation(Translations.OneWayReservation),\r\n\r\n showCancelButton: true,\r\n\r\n confirmButtonText: this._i18nHelper.GetTranslation(Translations.ConfirmReservation)\r\n } as SweetAlertOptions).then((result) => {\r\n if (result.value) {\r\n\r\n let data = {\r\n projNr: this.InitData.ProjNr,\r\n posNr: this.InitData.PosNr,\r\n serialNr: this.InitData.SerialNr,\r\n timeSlots: tmp,\r\n timeSlotToDelete: this.InitData.DateToDelete\r\n }\r\n\r\n AxessViewer.loadPartialView('/Reservations/SaveReservation', data, (resp) => {\r\n this._RequestHelper.postToUrl('Reserved', { projNr: this.InitData.ProjNr, posNr: this.InitData.PosNr, serialNr: this.InitData.SerialNr, message: resp.message, message_type: resp.success }, {});\r\n }, { silent: true });\r\n }\r\n });\r\n }\r\n else {\r\n AxessViewer.loadPartialView('/Reservations/SaveReservation',\r\n {\r\n projNr: this.InitData.ProjNr,\r\n posNr: this.InitData.PosNr,\r\n serialNr: this.InitData.SerialNr,\r\n timeSlots: tmp,\r\n timeSlotToDelete: this.InitData.DateToDelete\r\n }, (resp) => {\r\n this._RequestHelper.postToUrl('Reserved', { projNr: this.InitData.ProjNr, posNr: this.InitData.PosNr, serialNr: this.InitData.SerialNr, message: resp.message, message_type: resp.success }, {});\r\n }, { silent: true });\r\n }\r\n }\r\n}\r\n\r\n\r\ninterface TimeSlotInitData {\r\n ProgressBarMode: ProgressBarMode;\r\n Progress: number;\r\n DatePatternYear: string;\r\n StartOfWeek: number;\r\n Lang: string;\r\n StartDate: string;\r\n EndDate?: string;\r\n ProjNr: number;\r\n PosNr: number;\r\n SerialNr: number;\r\n DateToDelete: string;\r\n}\r\n", "export class AxAlertBanner {\r\n\r\n\r\n public ShowMessage(elementName: string, message: string, success: boolean, additionalClasses: string = \"\"): void {\r\n let $elem = $('#' + elementName);\r\n\r\n if (success) {\r\n $elem.html(\"<div class='ax-alert alert-dismissible ax-alert--inline ax-alert--success ax-pr-5 \" + additionalClasses + \"'>\" + message +\r\n \"<button type='button' class='close pr-2' data-dismiss='alert' aria-label='Close'>\" +\r\n \"<span aria-hidden='true' ><i class='las la-times ax-alert-close'></i> </span> \" +\r\n \"</button>\" +\r\n \"</div>\");\r\n }\r\n else {\r\n $elem.html(\"<div class='ax-alert alert-dismissible ax-alert--inline ax-alert--danger ax-pr-5 \" + additionalClasses + \"'>\" + message +\r\n \"<button type ='button'class='close' data-dismiss='alert' aria-label='Close'> \" +\r\n \"<span aria-hidden='true'> <i class='las la-times ax-alert-close'> </i></span> \" +\r\n \"</button > \" +\r\n \"</div>\");\r\n }\r\n this.attachCloseEvent($elem);\r\n $elem.show();\r\n }\r\n\r\n public ShowWarningMessage(elementName: string, message: string, iconClass: string, additionalClasses: string = \"\"): void {\r\n let $elem = $('#' + elementName);\r\n\r\n $elem.html(\"<div class='ax-alert alert-dismissible ax-alert--inline ax-alert--warning ax-pr-5 \" + additionalClasses + \"'>\" +\r\n \"<span aria-hidden='true'> <i class='\" + iconClass + \" ax-pr-2'></i></span>\" + message +\r\n \"<button type='button' class='close' data-dismiss='alert' aria-label='Close'>\" +\r\n \"<span aria-hidden='true' ><i class='las la-times ax-alert-close'></i> </span> \" +\r\n \"</button>\" +\r\n \"</div>\");\r\n\r\n this.attachCloseEvent($elem);\r\n $elem.show();\r\n }\r\n\r\n private attachCloseEvent($elem: JQuery<HTMLElement>) {\r\n $elem.on('click',\r\n '.close',\r\n (x) => {\r\n $(x.delegateTarget).remove();\r\n });\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { RequestHelper } from '../../Lib/Helper/RequestHelper';\r\nimport { AxProgressBar, Step } from \"../../Limestone/AxProgressBar/AxProgressBar\";\r\nimport { ProgressBar, ProgressBarMode } from \"../Global/Progressbar\";\r\nimport Swal, { SweetAlertOptions } from 'sweetalert2';\r\nimport { AxAlertBanner as AxAlertBanner } from \"../../Limestone/AxMessage/AxAlertBanner\";\r\nimport { I18nHelper, Translations } from '../../Lib/Helper/I18nHelper';\r\n\r\n\r\n@ModuleName(\"Reserved\")\r\nexport class Reserved implements AxInit {\r\n private InitData: ReservedInitData;\r\n\r\n public ProjectNr: number;\r\n public PosNr: number;\r\n public SerialNr: number;\r\n\r\n protected btnSubmit = document.getElementById('goNext') as HTMLButtonElement;\r\n protected AlertBanner: AxAlertBanner = new AxAlertBanner();\r\n\r\n constructor(private _Progressbar = new ProgressBar(),\r\n private _AxProgressBar = new AxProgressBar,\r\n protected _RequestHelper = new RequestHelper(),\r\n private _i18nHelper = new I18nHelper) { }\r\n\r\n AxInit(init: ReservedInitData): void {\r\n let that = this;\r\n this.InitData = init;\r\n let count: number = 0;\r\n\r\n //let alertAdditionalClasses = \"ax-alert-banner--success\";\r\n\r\n if (this.InitData.Message != null && this.InitData.Message.length > 0) {\r\n this.AlertBanner.ShowMessage('alert_ax', this.InitData.Message, JSON.parse(this.InitData.MessageType.toString().toLowerCase()));\r\n }\r\n\r\n this.AlertBanner.ShowWarningMessage('reserveAdvanceAlert', this.InitData.ReserveInAdvanceMessage, 'las la-info-circle');\r\n\r\n let sts: Step[] = this._Progressbar.GetReservationSteps();\r\n\r\n\r\n $(document).on(\"click\", \"a.delete_me\", function (e) {\r\n that.DeleteTimeSlot(e.currentTarget);\r\n });\r\n\r\n this.btnSubmit.disabled = true;\r\n\r\n for (let step of sts) {\r\n if (count != -1) {\r\n if (count < this.InitData.Progress) {\r\n step.type = 'done';\r\n } else if (count == this.InitData.Progress) {\r\n step.type = 'active';\r\n } else if (count > this.InitData.Progress) {\r\n step.type = 'inactive';\r\n }\r\n }\r\n count++;\r\n }\r\n\r\n this._AxProgressBar.Init({\r\n target: \".reservation__progressbar\",\r\n steps: sts\r\n });\r\n }\r\n\r\n DeleteTimeSlot(e: Element): void {\r\n let that = this;\r\n let element: JQuery<Element> = $(e);\r\n let date: string = element.attr('data-date');\r\n\r\n let real_date = new Date(date);\r\n\r\n Swal.fire({\r\n title: this._i18nHelper.GetTranslation(Translations.AreYouSure),\r\n text: this._i18nHelper.GetTranslation(Translations.DeleteReservationPopup) + ' ' + real_date.toLocaleDateString(),\r\n\r\n showCancelButton: true,\r\n\r\n confirmButtonText: this._i18nHelper.GetTranslation(Translations.DeleteConfirmationPopup)\r\n } as SweetAlertOptions).then((result) => {\r\n if (result.value) {\r\n AxessViewer.loadPartialView('/Reservations/RemoveReservation', { projNr: this.InitData.ProjNr, posNr: this.InitData.PosNr, serialNr: this.InitData.SerialNr, date: date }, function (resp) {\r\n\r\n if (resp.success) {\r\n that.AlertBanner.ShowMessage('alert_ax', resp.message, true);\r\n that.ReloadSlots();\r\n }\r\n else {\r\n that.AlertBanner.ShowMessage('alert_ax', resp.message, false);\r\n }\r\n\r\n }, { silent: true });\r\n }\r\n });\r\n }\r\n\r\n ReloadSlots(): void {\r\n\r\n AxessViewer.loadPartialView('/Reservations/_ReloadReservations', {\r\n ticket: { ProjNr: this.InitData.ProjNr, PosNr: this.InitData.PosNr, SerialNr: this.InitData.SerialNr }\r\n }, (resp) => {\r\n $('#slots_counter').html(resp.view);\r\n }, {});\r\n }\r\n\r\n\r\n}\r\n\r\n\r\nexport interface ReservedInitData {\r\n ProgressBarMode: ProgressBarMode;\r\n Progress: number;\r\n ProjNr: number;\r\n PosNr: number;\r\n SerialNr: number;\r\n MessageType: string;\r\n Message: string;\r\n ReserveInAdvanceMessage: string;\r\n}\r\n", "import { ComponentFunction } from \"@glidejs/glide\";\r\nimport Glide from \"@glidejs/glide\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"CategoryFilter\")\r\nexport class CategoryFilter implements AxInit {\r\n\r\n private SubGroupIds: Int32Array;\r\n\r\n AxInit(init: Int32Array): void {\r\n this.SubGroupIds = init;\r\n\r\n if (this.SubGroupIds == null || this.SubGroupIds.length === 0) {\r\n return;\r\n }\r\n\r\n window.addEventListener(\"scroll\", x => { this.CheckTopOffset() });\r\n\r\n let glide = new Glide('#intro',\r\n {\r\n type: 'slider',\r\n rewind: false,\r\n bound: true,\r\n gap: 0,\r\n perView: 4,\r\n breakpoints: {\r\n 800: {\r\n perView: 2\r\n },\r\n 480: {\r\n perView: 1\r\n }\r\n },\r\n classes: {\r\n activeSlide: 'ax-glide__sub_cat_slide--active',\r\n disabledArrow: 'glide__arrow--disabled'\r\n },\r\n });\r\n\r\n //glide.mount();\r\n\r\n glide.on('run.before', e => {\r\n e.steps = e.direction === '>' ? -glide.settings.perView : glide.settings.perView\r\n })\r\n\r\n glide.mount({\r\n 'DisableControls': this.updateGlideFunc\r\n });\r\n\r\n $('#btn_reset_groups').click(x => {\r\n this.ResetFilter();\r\n\r\n this.RemoveActiveClass();\r\n x.target.classList.add(\"ax-btn-subGroups-active\");\r\n });\r\n\r\n $('.btn_filter_group').click(x => {\r\n const groupId = (x.target as HTMLButtonElement).getAttribute('data-groupId');\r\n this.FilterByGroupId(groupId);\r\n\r\n this.RemoveActiveClass();\r\n\r\n document.getElementById(\"btn_reset_groups\").classList.remove(\"ax-btn-subGroups-active\");\r\n\r\n x.target.classList.add(\"ax-btn-subGroups-active\");\r\n });\r\n }\r\n\r\n private updateGlideFunc: ComponentFunction = (glide: Glide.Static, Components: any, Events: any) => {\r\n\r\n const PREV_CONTROL_SELECTOR = \"[data-glide-dir='<']\";\r\n const NEXT_CONTROL_SELECTOR = \"[data-glide-dir='>']\";\r\n const component = {\r\n buildAfter() {\r\n this.prevBtn = Components.Html.root.querySelector(PREV_CONTROL_SELECTOR);\r\n this.nextBtn = Components.Html.root.querySelector(NEXT_CONTROL_SELECTOR);\r\n },\r\n handleDisable() {\r\n const perView = glide.settings.perView;\r\n const slidesCount = Components.Html.slides.length;\r\n\r\n this.prevBtn.disabled = (glide.index <= 0);\r\n this.nextBtn.disabled = (glide.index >= slidesCount - perView);\r\n },\r\n mount() {\r\n }\r\n };\r\n\r\n Events.on(\"build.after\", function () {\r\n component.buildAfter();\r\n component.handleDisable();\r\n });\r\n Events.on(\"run.after\", function () {\r\n component.handleDisable();\r\n });\r\n return component;\r\n }\r\n\r\n CheckTopOffset(): void {\r\n\r\n let headerHeight = $('#ax-category-header').height();\r\n\r\n if (document.body.scrollTop > $('.ax-header').height() + headerHeight || document.documentElement.scrollTop > $('.ax-header').height() + headerHeight) {\r\n $('#ax-subcat-menu-holder').addClass('ax-subCat-glider-fixed-top');\r\n $('#ax-subCat-slider-frame').removeClass('ax-subCat-slider-frame-big');\r\n $('#ax-subCat-slider-frame').addClass('ax-subCat-slider-frame-small');\r\n\r\n } else {\r\n $('#ax-subcat-menu-holder').removeClass('ax-subCat-glider-fixed-top');\r\n $('#ax-subCat-slider-frame').addClass('ax-subCat-slider-frame-big');\r\n $('#ax-subCat-slider-frame').removeClass('ax-subCat-slider-frame-small');\r\n\r\n\r\n \r\n }\r\n }\r\n\r\n FilterByGroupId(groupId: string) {\r\n this.ResetFilter();\r\n\r\n let elements = document.getElementsByClassName(\"ax-category-cat-holder\");\r\n\r\n for (let i = 0; i < elements.length; i++) {\r\n let tempId = elements[i].getAttribute('data-groupId');\r\n\r\n if (tempId != groupId) {\r\n $(elements[i]).hide();\r\n }\r\n }\r\n }\r\n\r\n RemoveActiveClass() {\r\n let elements = document.getElementsByClassName(\"btn_filter_group\");\r\n\r\n for (let i = 0; i < elements.length; i++) {\r\n elements[i].classList.remove(\"ax-btn-subGroups-active\");\r\n }\r\n }\r\n\r\n ResetFilter() {\r\n let elements = document.getElementsByClassName(\"ax-category-cat-holder\");\r\n\r\n for (let i = 0; i < elements.length; i++) {\r\n let tempId = elements[i].getAttribute('data-groupId');\r\n\r\n $(elements[i]).show();\r\n }\r\n }\r\n}\r\n\r\ninterface GliderMovement {\r\n direction: string;\r\n steps: string;\r\n}", "import { MenuAim, Options } from \"es6-menu-aim\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"SubmenuAim\")\r\nexport class SubmenuAim implements AxInit {\r\n private menuAim: MenuAim;\r\n\r\n AxInit(init: any): void {\r\n let menu_root = document.getElementById('ax-navbar_sub');\r\n }\r\n}\r\n\r\nexport enum MenuDirection {\r\n left = \"left\",\r\n right = \"right\",\r\n below = \"below\",\r\n above = \"above\",\r\n}", "import PhotoSwipe from \"photoswipe\";\r\nimport PhotoSwipeUI_Default from \"photoswipe/dist/photoswipe-ui-default\";\r\nimport Swal from \"sweetalert2\";\r\nimport { Asset } from \"../../Interfaces/Assets/Asset\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AssetHelper } from \"../../Lib/Helper/AssetHelper\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { CartEntryCustomerQuestion, CustomerQuestion } from \"../../Models/CustomerQuestion/CustomerQuestion\";\r\nimport { RetailItem, RetailItemVariant } from \"../../Models/Retail/RetailItem\";\r\nimport { retailHelper } from \"../../Lib/Helper/Retail/RetailHelper\";\r\nimport { ProductDetails } from \"../Admin/ProductDetails/ProductDetails\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { AxDropdown, IAxDropdownOptions } from \"@axess/limestone\";\r\n\r\n@ModuleName(\"RetailDetail\")\r\nexport class RetailDetail implements AxInit {\r\n private photoSwipe: PhotoSwipe<PhotoSwipe.Options> = null;\r\n private swiperAssets: PhotoSwipe.Item[];\r\n\r\n private initData: RetailDetailInitData;\r\n private questions: CustomerQuestion[];\r\n\r\n private selectedRetailItem: number;\r\n private allVariants: RetailItemVariant[] = [];\r\n\r\n private selectedQuantity: number = 1;\r\n private quantitySelection: AxDropdown = new AxDropdown();\r\n\r\n constructor(private _assetHelper = new AssetHelper(),\r\n private _axLimestone = new AxLimeStone(),\r\n private _i18nHelper = new I18nHelper(),\r\n private _retailHelper = new retailHelper()) { }\r\n\r\n AxInit(init: RetailDetailInitData): void {\r\n this.initData = init;\r\n\r\n this.swiperAssets = this._assetHelper.GetPhotoSwipeItems(init.Assets);\r\n this.questions = init.Questions;\r\n\r\n this.selectedRetailItem = this.initData.Item.RetailItemNr;\r\n\r\n this.questionEvents();\r\n this.initVariantSwitch();\r\n\r\n this._retailHelper.setColorPickerColors($('.retail__filter_color'));\r\n\r\n this.quantitySelection.init('.ax-dropdown',\r\n {\r\n multiSelect: false,\r\n searchBar: false,\r\n onSelect: ($parent, value) => {\r\n let quantity = parseInt(value as string);\r\n this.selectedQuantity = quantity;\r\n }\r\n });\r\n\r\n this.quantitySelection.setValue('1');\r\n\r\n $('.retail_detail__asset-main').click(x => {\r\n let src = x.target.getAttribute('src');\r\n this.initLightBox(src);\r\n });\r\n\r\n $('.retail_detail__asset-list-item').click(x => {\r\n this.activateImage(x.target);\r\n });\r\n\r\n $('.retail_addToCart').click(x => {\r\n if (!$(x.delegateTarget).prop('disabled')) {\r\n this._axLimestone.LockButton(x.delegateTarget);\r\n this.addToCart();\r\n }\r\n });\r\n\r\n for (let item of this.initData.VariantItems) {\r\n this.allVariants.push(...item.Variants.filter(x => this.allVariants.findIndex(y => y.FeatureType === x.FeatureType && y.FeatureName === x.FeatureName && x.FeatureValue === y.FeatureValue) === -1));\r\n }\r\n\r\n let reloaded = this._retailHelper.checkReload(x => {\r\n this.loadFilterFromLocalStorage(x);\r\n }, this.initData.Item.RetailItemNr, true);\r\n\r\n if (this.initData.VariantItems.length === 1) {\r\n this.checkAddToCartAllowed();\r\n }\r\n }\r\n\r\n loadFilterFromLocalStorage(storageFilter: RetailItemVariant[]) {\r\n if (storageFilter != null && storageFilter.length > 0) {\r\n for (let filter of storageFilter) {\r\n let $e = this.getElementFromVariant(filter);\r\n\r\n if ($e.length > 0) {\r\n this.activeVariant($e);\r\n this.toggleSupportedVariants($e);\r\n }\r\n }\r\n } else {\r\n this.initVariants();\r\n }\r\n }\r\n\r\n initVariants() {\r\n let variants: RetailItemVariant[];\r\n\r\n if (this.initData.Item.AvailableItems > 0) {\r\n variants = this.initData.Item.Variants;\r\n } else {\r\n let firstItem = this.initData.VariantItems.filter(x => x.AvailableItems > 0)[0];\r\n variants = firstItem.Variants;\r\n this.selectedRetailItem = firstItem.RetailItemNr;\r\n }\r\n\r\n for (let variant of variants) {\r\n let $elem = this.getElementFromVariant(variant);\r\n if ($elem.length > 0) {\r\n this.activeVariant($elem);\r\n }\r\n }\r\n }\r\n\r\n initVariantSwitch() {\r\n $(`.retail__filter`).click(e => {\r\n this.activeVariant($(e.delegateTarget));\r\n this.toggleSupportedVariants($(e.delegateTarget));\r\n });\r\n }\r\n\r\n activeVariant($e: JQuery<HTMLElement>) {\r\n let variant = this.getVariantFromElement($e);\r\n $e.toggleClass('disabled', false);\r\n\r\n switch (variant.FeatureType) {\r\n case 6:\r\n $(`button.retail__filter-chips[data-filterType=\"${variant.FeatureType}\"][data-filterName=\"${variant.FeatureName}\"].ax-chip.retail__filter-chips`).removeClass('active').removeClass('ax-fill-primary');\r\n this.toggleChip($e);\r\n break;\r\n\r\n case 2:\r\n $(`.retail__filter[data-filterType=\"${variant.FeatureType}\"][data-filterName=\"${variant.FeatureName}\"]`).toggleClass('active', false);\r\n $e.toggleClass('active', true);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n this.switchToItemImage(variant);\r\n }\r\n\r\n getCurrentVariantList(): RetailItemVariant[] {\r\n let variantList: RetailItemVariant[] = [];\r\n\r\n for (let activeE of $(`.retail__filter.active`)) {\r\n variantList.push(this.getVariantFromElement($(activeE)));\r\n }\r\n\r\n return variantList;\r\n }\r\n\r\n toggleSupportedVariants($e: JQuery<HTMLElement>) {\r\n let variant = this.getVariantFromElement($e);\r\n $(`.retail__filter`).toggleClass('disabled', false);\r\n\r\n let currentVariants: RetailItemVariant[] = this.getCurrentVariantList();\r\n currentVariants =\r\n currentVariants.sort(\r\n (a, b) => a.FeatureType === variant.FeatureType && a.FeatureName === variant.FeatureName ? -1 : 1);\r\n let deletedVariants: RetailItemVariant[] = [];\r\n\r\n //Search for impossible Combinations\r\n for (let searchV of currentVariants) {\r\n let itemsToSearch = this.initData.VariantItems.filter(x => this.itemContainsVariant(x, searchV));\r\n\r\n if (deletedVariants.findIndex(x => x.FeatureType === searchV.FeatureType && x.FeatureName === searchV.FeatureName && x.FeatureValue === searchV.FeatureValue) === -1) {\r\n for (let otherV of this.allVariants.filter(x => x.FeatureType !== searchV.FeatureType || x.FeatureName !== searchV.FeatureName)) {\r\n let itemsWithOtherV = itemsToSearch.filter(x => this.itemContainsVariant(x, otherV));\r\n\r\n if (itemsWithOtherV.length === 0) {\r\n deletedVariants.push(otherV);\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Indicate disabled Combinations and deactivate currently selected impossible combinations\r\n for (let delV of deletedVariants) {\r\n let $variantE = this.getElementFromVariant(delV);\r\n $variantE.toggleClass('disabled', true);\r\n switch (delV.FeatureType) {\r\n case 6:\r\n $variantE.toggleClass('active', false).toggleClass('ax-fill-primary', false);\r\n break;\r\n\r\n case 2:\r\n $variantE.toggleClass('active', false);\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n //Activate single Options\r\n let groupedFilter = this.allVariants.reduce((r, a) => {\r\n let key = `${a.FeatureType}-${a.FeatureName}`;\r\n r[key] = r[key] || [];\r\n r[key].push(a);\r\n return r;\r\n }, Object.create(null));\r\n\r\n for (let key of Object.keys(groupedFilter)) {\r\n let notDeletedFilters: RetailItemVariant[] = groupedFilter[key].filter(x => deletedVariants.findIndex(\r\n y => x.FeatureType === y.FeatureType &&\r\n x.FeatureValue === y.FeatureValue &&\r\n x.FeatureName === y.FeatureName) ===\r\n -1);\r\n if (notDeletedFilters.length === 1) {\r\n let $toActive = this.getElementFromVariant(notDeletedFilters[0]);\r\n this.activeVariant($toActive);\r\n }\r\n }\r\n\r\n currentVariants = this.getCurrentVariantList();\r\n this._retailHelper.saveToLocalStorage(currentVariants, this.initData.Item.RetailItemNr, true);\r\n\r\n this.checkAddToCartAllowed();\r\n }\r\n\r\n checkAddToCartAllowed() {\r\n let currentVariants: RetailItemVariant[] = this.getCurrentVariantList();\r\n\r\n let items = this.initData.VariantItems.filter(x => {\r\n for (let searchV of currentVariants) {\r\n let vFound = this.itemContainsVariant(x, searchV);\r\n if (!vFound) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n });\r\n\r\n $('.retail_addToCart').prop('disabled', items.length !== 1);\r\n if (items.length === 1) {\r\n this.selectedRetailItem = items[0].RetailItemNr;\r\n let maxAvailable = (items[0].AvailableItems >= this.initData.MaxItemsPerSelection\r\n ? this.initData.MaxItemsPerSelection\r\n : items[0].AvailableItems);\r\n \r\n let $dropdownMenu = $(this.quantitySelection.getElements()[0]).find('.ax-dropdown__menu');\r\n $dropdownMenu.html(\"\");\r\n\r\n for (let i = 1; i <= maxAvailable; i++) {\r\n const inner = document.createElement(\"li\");\r\n inner.innerHTML = i.toString();\r\n inner.classList.add(\"ax-dropdown__item\");\r\n inner.setAttribute(\"data-value\", i.toString());\r\n\r\n $dropdownMenu.append(inner);\r\n }\r\n\r\n if (this.selectedQuantity > maxAvailable) {\r\n this.quantitySelection.setValue('1');\r\n }\r\n\r\n return;\r\n }\r\n this.selectedRetailItem = null;\r\n }\r\n\r\n activateImage(e: HTMLElement) {\r\n let index = parseInt(e.getAttribute('data-index'));\r\n let scaledImagePath = e.getAttribute('data-scaled-image');\r\n\r\n $('.retail_detail__asset-main').attr('data-index', index);\r\n $('.retail_detail__asset-main').attr('src', scaledImagePath);\r\n }\r\n\r\n switchToItemImage(variant: RetailItemVariant) {\r\n let key = `W-${this.initData.RetailItemID}-VA-${variant.FeatureType}-${variant.FeatureName}-${variant.FeatureValue}`;\r\n let groupKey = `W-${this.initData.RetailItemID}-VA-${variant.FeatureType}-${variant.FeatureName}-`;\r\n $(`.retail_detail__asset-list-variant[data-identifier^=\"${groupKey}\"]`).addClass('d-none');\r\n $(`.retail_detail__asset-list-variant[data-identifier=\"${key}\"]`).removeClass('d-none');\r\n\r\n let currentSrc = $('.retail_detail__asset-main').attr('src');\r\n let $variantActive = $(`.retail_detail__asset-list-variant[src=\"${currentSrc}\"]`);\r\n let currentlyInvisible = $variantActive.length === 0 || $variantActive.hasClass('d-none');\r\n\r\n if (currentlyInvisible && $(`.retail_detail__asset-list-variant, .retail_detail__asset-list-item`).not('.d-none').length > 0) {\r\n $(`.retail_detail__asset-list-variant, .retail_detail__asset-list-item`).not('.d-none')[0].click();\r\n }\r\n }\r\n\r\n initLightBox(src: string) {\r\n let swiperAssets = [];\r\n let count = 0;\r\n let index = 0;\r\n\r\n for (let image of $(`.retail_detail__asset-list-variant, .retail_detail__asset-list-item`).not('.d-none')) {\r\n let imageSrc = $(image).attr('src');\r\n let tmp = this.swiperAssets.find(x => x.src == imageSrc);\r\n swiperAssets.push(tmp);\r\n\r\n if (imageSrc == src) {\r\n index = count;\r\n }\r\n\r\n count++;\r\n }\r\n\r\n\r\n if (this.swiperAssets != null) {\r\n let swipeElem = document.querySelectorAll('.pswp')[0] as HTMLElement;\r\n this.photoSwipe = new PhotoSwipe<PhotoSwipeUI_Default.Options>(swipeElem, PhotoSwipeUI_Default, swiperAssets, {\r\n index: index,\r\n closeEl: true,\r\n captionEl: false,\r\n fullscreenEl: false,\r\n zoomEl: false,\r\n shareEl: false,\r\n counterEl: false,\r\n arrowEl: false,\r\n preloaderEl: true,\r\n bgOpacity: 0.85,\r\n history: false\r\n });\r\n this.photoSwipe.init();\r\n }\r\n }\r\n\r\n questionEvents() {\r\n $('.retail_detail__input-list button.ax-chip').click(x => {\r\n let $target = $(x.delegateTarget);\r\n let questionID = parseInt($target.attr('data-target'));\r\n\r\n $target.parent().find('.active').each((i, e) => {\r\n this.toggleQuestionChip($(e));\r\n });\r\n\r\n this.toggleQuestionChip($target);\r\n this.questions.find(x => x.QuestionID == questionID).Answer = $target.attr('data-value');\r\n });\r\n }\r\n\r\n toggleQuestionChip($target: JQuery<HTMLElement>) {\r\n $target.toggleClass('active').toggleClass('ax-fill-primary');\r\n $target.find('i.las').toggleClass('ax-color-primary').toggleClass('color-white');\r\n $target.find('i.lar').toggleClass('ax-color-primary--light').toggleClass('color-white');\r\n }\r\n\r\n addToCart() {\r\n let answerList: CartEntryCustomerQuestion[] = [];\r\n let error: boolean = false;\r\n let errorMsg: string = \"\";\r\n for (let quest of this.questions) {\r\n let mandatoryButEmpty = false;\r\n\r\n if (quest.QuestionType != 3 && quest.QuestionType != 4 && quest.QuestionType != 5) {\r\n let qElem = document.getElementsByName(`retail_q_${quest.QuestionID}`)[0] as HTMLInputElement;\r\n mandatoryButEmpty = quest.Mandatory && qElem.value.trim() == '';\r\n answerList.push({\r\n QuestionID: quest.QuestionID,\r\n Value: qElem.value\r\n });\r\n } else {\r\n mandatoryButEmpty = quest.Mandatory && quest.Answer.trim() == '';\r\n answerList.push({\r\n QuestionID: quest.QuestionID,\r\n Value: quest.Answer\r\n });\r\n }\r\n\r\n if (mandatoryButEmpty) {\r\n error = true;\r\n errorMsg += this._i18nHelper.GetTranslation(Translations.FeldErforderlich, quest.Name) + '<br />';\r\n }\r\n }\r\n\r\n if (error) {\r\n\r\n Swal.fire({\r\n title: this._i18nHelper.GetTranslation(Translations.ValueMissing),\r\n icon: 'warning',\r\n html: errorMsg\r\n });\r\n\r\n this._axLimestone.UnlockButton($('.retail_addToCart')[0]);\r\n return;\r\n }\r\n\r\n AxessViewer.loadPartialView(this.initData.PostURL, { retailItemID: this.selectedRetailItem, questions: answerList, quantity: this.selectedQuantity }, result => {\r\n\r\n\r\n AxLoad.LoadModule('AxFireShoppingCartModal', {\r\n result: result,\r\n continueShoppingPath: 'Retail',\r\n btn: $('.retail_addToCart')[0],\r\n ResetQuantity: false\r\n });\r\n /* fireShoppingCart(result, false);*/\r\n this._axLimestone.UnlockButton($('.retail_addToCart')[0]);\r\n }, {\r\n silent: true,\r\n skipShoppingCartReload: false,\r\n });\r\n }\r\n\r\n itemContainsVariant(item: RetailItem, variant: RetailItemVariant): boolean {\r\n return item.Variants.findIndex(x => x.FeatureType === variant.FeatureType &&\r\n x.FeatureName === variant.FeatureName &&\r\n x.FeatureValue === variant.FeatureValue) !==\r\n -1;\r\n }\r\n\r\n toggleChip($target: JQuery<HTMLElement>) {\r\n $target.toggleClass('active').toggleClass('ax-fill-primary');\r\n }\r\n\r\n getElementFromVariant(variant: RetailItemVariant): JQuery<HTMLElement> {\r\n return $(`.retail__filter[data-filterType=\"${variant.FeatureType}\"][data-filterName=\"${variant.FeatureName}\"][value=\"${variant.FeatureValue}\"]`);\r\n }\r\n\r\n getVariantFromElement($e: JQuery<HTMLElement>): RetailItemVariant {\r\n return {\r\n FeatureType: parseInt($e.attr('data-filterType') as string),\r\n FeatureValue: $e.val() as string,\r\n FeatureName: $e.attr('data-filterName') as string,\r\n VariantRelated: false,\r\n Color: $e.css('background-color')\r\n };\r\n }\r\n}\r\n\r\ninterface RetailDetailInitData {\r\n RetailItemID: number;\r\n Questions: CustomerQuestion[];\r\n Assets: Asset[];\r\n PostURL: string;\r\n VariantItems: RetailItem[];\r\n Item: RetailItem;\r\n MaxItemsPerSelection: number;\r\n VariantDetailList: ProductDetails[];\r\n}", "import { Asset } from \"../../Interfaces/Assets/Asset\";\r\n\r\nexport class AssetHelper {\r\n GetPhotoSwipeItems(assets: Asset[]): PhotoSwipe.Item[] {\r\n let retVal: PhotoSwipe.Item[] = [];\r\n\r\n if (assets != null) {\r\n for (let asset of assets) {\r\n let resolutionSplit = asset.Resolution.split('x');\r\n\r\n let w: number = parseInt(resolutionSplit[0]);\r\n let h: number = parseInt(resolutionSplit[1]);\r\n\r\n retVal.push({\r\n src: asset.Link,\r\n w: w,\r\n h: h\r\n })\r\n }\r\n }\r\n return retVal;\r\n }\r\n}", "export class colorHelper {\r\n stringToRgb(color: string): RGB {\r\n let tmp = color.match(/^rgb\\((\\d+),\\s*(\\d+),\\s*(\\d+)\\)$/);\r\n\r\n if (tmp != null && tmp.length >= 3) {\r\n return {\r\n r: parseInt(tmp[1]),\r\n g: parseInt(tmp[2]),\r\n b: parseInt(tmp[3])\r\n };\r\n }\r\n tmp = color.match(/^rgba\\((\\d+),\\s*(\\d+),\\s*(\\d+),\\s*(\\d+)\\)$/);\r\n\r\n if (parseInt(tmp[4]) == 0) {\r\n return {\r\n r: 255,\r\n g: 255,\r\n b: 255\r\n }\r\n }\r\n return {\r\n r: parseInt(tmp[1]),\r\n g: parseInt(tmp[2]),\r\n b: parseInt(tmp[3])\r\n };\r\n }\r\n\r\n rgbToHsl(r: number, g: number, b: number): HSL {\r\n r /= 255;\r\n g /= 255;\r\n b /= 255;\r\n const l = Math.max(r, g, b);\r\n const s = l - Math.min(r, g, b);\r\n const h = s\r\n ? l === r\r\n ? (g - b) / s\r\n : l === g\r\n ? 2 + (b - r) / s\r\n : 4 + (r - g) / s\r\n : 0;\r\n return {\r\n h: Math.round(60 * h < 0 ? 60 * h + 360 : 60 * h),\r\n s: Math.round(100 * (s ? (l <= 0.5 ? s / (2 * l - s) : s / (2 - (2 * l - s))) : 0)),\r\n l: Math.round((100 * (2 * l - s)) / 2)\r\n };\r\n }\r\n\r\n hexToRgb(hex: string): RGB {\r\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\r\n hex = hex.replace(shorthandRegex, function (m, r, g, b) {\r\n return r + r + g + g + b + b;\r\n });\r\n\r\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\r\n return result ? {\r\n r: parseInt(result[1], 16),\r\n g: parseInt(result[2], 16),\r\n b: parseInt(result[3], 16)\r\n } : null;\r\n }\r\n\r\n luminance(r: number, g: number, b: number): number {\r\n const a = [r, g, b].map((v) => {\r\n v /= 255;\r\n return v <= 0.03928\r\n ? v / 12.92\r\n : Math.pow((v + 0.055) / 1.055, 2.4);\r\n });\r\n return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;\r\n }\r\n\r\n calculateRatio(color1Rgb: RGB, color2Rgb: RGB): number {\r\n const color1Luminance = this.luminance(color1Rgb.r, color1Rgb.g, color1Rgb.b);\r\n const color2Luminance = this.luminance(color2Rgb.r, color2Rgb.g, color2Rgb.b);\r\n\r\n const ratio = color1Luminance > color2Luminance\r\n ? ((color2Luminance + 0.05) / (color1Luminance + 0.05))\r\n : ((color1Luminance + 0.05) / (color2Luminance + 0.05));\r\n\r\n return ratio;\r\n }\r\n\r\n}\r\n\r\nexport class RGB {\r\n r: number;\r\n g: number;\r\n b: number;\r\n}\r\n\r\nexport class HSL {\r\n h: number;\r\n s: number;\r\n l: number;\r\n}", "export class LocalStorageKeyCollection {\r\n static retailFilterStorageKey = \"Retail.Filter.tmp.{0}\";\r\n static retailDetailStorageKey = \"Retail.Detail.tmp.{0}\";\r\n \r\n static accountLoginStorage = \"account.login.storage\";\r\n}", "import { colorHelper } from \"../ColorHelper\";\r\nimport { RetailItemVariant } from \"../../../Models/Retail/RetailItem\";\r\nimport { LocalStorageKeyCollection } from \"../../Constants/KeyCollection/LocalStorageKeyCollection\";\r\n\r\nexport class retailHelper {\r\n setColorPickerColors(colorFilters: JQuery<HTMLElement>) {\r\n let colorPicker = new colorHelper();\r\n \r\n for (let e of colorFilters) {\r\n let $e = $(e);\r\n let bgColor = colorPicker.stringToRgb($e.css('background-color'));\r\n\r\n let whiteLumi = colorPicker.calculateRatio(bgColor, { r: 255, g: 255, b: 255 });\r\n let darkLumi = colorPicker.calculateRatio(bgColor, { r: 75, g: 75, b: 75 });\r\n //console.log(`${$e.css('background-color')}::${whiteLumi} <-> ${darkLumi}`);\r\n\r\n if (darkLumi > whiteLumi) {\r\n $e.addClass('retail__filter_color--inverted');\r\n }\r\n\r\n if (whiteLumi === 1) {\r\n $e.addClass('retail__filter_color--bordered');\r\n }\r\n }\r\n }\r\n\r\n checkReload(reloadCallback: (storageFilter: RetailItemVariant[]) => void, productIndicator: number, detail?: boolean): boolean {\r\n detail = detail || false;\r\n let performanceTypes = window.performance\r\n .getEntriesByType('navigation')\r\n .map((nav: PerformanceNavigationTiming) => nav.type);\r\n const pageAccessedByReload = (\r\n (window.performance.navigation &&\r\n (window.performance.navigation.type === 1 || window.performance.navigation.type === 2)) ||\r\n performanceTypes.includes('reload') ||\r\n performanceTypes.includes('back_forward')\r\n );\r\n\r\n if (pageAccessedByReload) {\r\n let storageFilter: RetailItemVariant[] = JSON.parse(window.localStorage.getItem(\r\n (detail\r\n ? LocalStorageKeyCollection.retailDetailStorageKey\r\n : LocalStorageKeyCollection.retailFilterStorageKey).replace('{0}', productIndicator.toString())));\r\n reloadCallback(storageFilter);\r\n return storageFilter != null && storageFilter.length > 0;\r\n } else {\r\n this.saveToLocalStorage([], productIndicator, detail);\r\n }\r\n return false;\r\n }\r\n\r\n saveToLocalStorage(filterList: RetailItemVariant[], productIndicator: number, detail?: boolean) {\r\n detail = detail || false;\r\n window.localStorage.setItem((detail ? LocalStorageKeyCollection.retailDetailStorageKey : LocalStorageKeyCollection.retailFilterStorageKey).replace('{0}', productIndicator.toString()), JSON.stringify(filterList));\r\n }\r\n\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { ComponentFunction } from \"@glidejs/glide\";\r\nimport Glide from \"@glidejs/glide\";\r\n\r\n@ModuleName(\"RetailMain\")\r\nexport class RetailMain implements AxInit {\r\n private Glides: Map<string, Glide.Static> = new Map<string, Glide.Static>();\r\n\r\n AxInit(init: any): void {\r\n $('.ax-products__groupList[data-display-mode=\"swiper\"]').each((i, x) => {\r\n let glideID: string = $(x).attr('id');\r\n let rows: number = $(x).data('rows');\r\n let smallGap = $(x).hasClass('glid--sm');\r\n let glide = new Glide('#' + glideID, {\r\n type: 'slider',\r\n perView: rows,\r\n rewind: false,\r\n bound: true,\r\n animationDuration: 300,\r\n breakpoints: {\r\n 800: {\r\n perView: 2\r\n },\r\n 480: {\r\n perView: 1\r\n }\r\n },\r\n classes: {\r\n activeSlide: 'glide__slide--active',\r\n disabledArrow: 'glide__arrow--disabled'\r\n },\r\n gap: smallGap ? -18 : 0\r\n });\r\n\r\n this.Glides.set(glideID, glide);\r\n\r\n glide.on('run.before', e => {\r\n e.steps = e.direction === '>' ? -glide.settings.perView : glide.settings.perView\r\n })\r\n glide.mount({\r\n 'DisableControls': this.updateGlideFunc\r\n });\r\n });\r\n }\r\n\r\n private updateGlideFunc: ComponentFunction = (glide: Glide.Static, Components: any, Events: any) => {\r\n\r\n const PREV_CONTROL_SELECTOR = \"[data-glide-dir='<']\";\r\n const NEXT_CONTROL_SELECTOR = \"[data-glide-dir='>']\";\r\n const component = {\r\n buildAfter() {\r\n this.prevBtn = Components.Html.root.querySelector(PREV_CONTROL_SELECTOR);\r\n this.nextBtn = Components.Html.root.querySelector(NEXT_CONTROL_SELECTOR);\r\n },\r\n handleDisable() {\r\n const perView = glide.settings.perView;\r\n const slidesCount = Components.Html.slides.length;\r\n\r\n this.prevBtn.disabled = (glide.index <= 0);\r\n this.nextBtn.disabled = (glide.index >= slidesCount - perView);\r\n },\r\n mount() {\r\n }\r\n };\r\n\r\n Events.on(\"build.after\", function () {\r\n component.buildAfter();\r\n component.handleDisable();\r\n });\r\n Events.on(\"run.after\", function () {\r\n component.handleDisable();\r\n });\r\n return component;\r\n }\r\n}", "import Swal from \"sweetalert2\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { Address, CustomerAddressType } from \"../../Models/Account/Address\";\r\nimport { CustomerShippingInfo, ShippingStatus } from \"../../Models/Shipping/CustomerShippingInfo\";\r\n\r\n@ModuleName(\"Shipping\")\r\nexport class Shipping implements AxInit {\r\n private AddressFormSelector: string = \"form[name=shipping_portlet__address_form]\";\r\n private InvoiceFormSelector: string = \"form[name=shipping_portlet__invoice_form]\";\r\n\r\n private AddressModalSelector: string = \".shipping_portlet__address_modal\";\r\n private InvoiceModalSelector: string = \".shipping_portlet__invoice_modal\";\r\n\r\n private Addresses: Address[];\r\n private ShippingInfo: CustomerShippingInfo;\r\n\r\n constructor(private _AxLimestone = new AxLimeStone()) { }\r\n\r\n AxInit(init: ShippingInitData): void {\r\n this.Addresses = init.Addresses;\r\n this.ShippingInfo = init.ShippingInfo;\r\n\r\n $(`input[name=shipping_portlet__type][value=${this.ShippingInfo.Status}]`).prop('checked', true);\r\n\r\n this.ShippingEditEvents();\r\n this.ShippingChangeEvents();\r\n this.AddresseDeleteEvents();\r\n this.toggleShippingFee();\r\n this.SubmitEvents();\r\n }\r\n\r\n\r\n SubmitEvents() {\r\n $('.shipping_submit').click(x => {\r\n let target = x.delegateTarget;\r\n this._AxLimestone.LockButton(target);\r\n\r\n AxessViewer.loadPartialView(\"/Shipping/Checkout\", {}, resp => {\r\n if (resp.success) {\r\n window.location.href = resp.successLink;\r\n } else {\r\n Swal.fire({\r\n text: resp.message,\r\n icon: 'info',\r\n }).then((result) => {\r\n this._AxLimestone.UnlockButton(target);\r\n });\r\n }\r\n\r\n }, { silent: true });\r\n });\r\n }\r\n\r\n\r\n ShippingChangeEvents() {\r\n $('input[name=shipping_portlet__type]').change(x => {\r\n this.ShippingInfo.Status = parseInt($(x.delegateTarget).val() as string);\r\n this.toggleShippingFee();\r\n this.SaveShippingInfo();\r\n });\r\n\r\n $(`${this.AddressModalSelector} .shipping_address_change`).click(x => {\r\n let typeID = parseInt($(x.delegateTarget).attr('data-type'));\r\n this.ShippingInfo.DeliveryAddress = typeID;\r\n\r\n this.UpdateCurrentShipping(this.AddressModalSelector, typeID, '.shipping_address__current_del');\r\n this.SaveShippingInfo();\r\n });\r\n\r\n $(`${this.InvoiceModalSelector} .shipping_address_change`).click(x => {\r\n let typeID = parseInt($(x.delegateTarget).attr('data-type'));\r\n this.ShippingInfo.InvoiceAddress = typeID;\r\n\r\n this.UpdateCurrentShipping(this.InvoiceModalSelector, typeID, '.shipping_address__current_inv');\r\n this.SaveShippingInfo();\r\n });\r\n }\r\n\r\n toggleShippingFee() {\r\n $('.shipping_price-incFee').toggleClass('d-none', this.ShippingInfo.Status === ShippingStatus.PickUp);\r\n $('.shipping_price-excFee').toggleClass('d-none', this.ShippingInfo.Status !== ShippingStatus.PickUp);\r\n }\r\n\r\n AddresseDeleteEvents() {\r\n $('.shipping_address_delete').click(x => {\r\n let typeID = parseInt($(x.delegateTarget).attr('data-type'));\r\n let data = this.Addresses.find(x => x.Type == typeID) as AddressEdit;\r\n data.Delete = true;\r\n\r\n AxessViewer.loadPartialView(\"/Shipping/EditAddress\", data, x => {\r\n $('.shipping_portlet__address_modal').modal('hide');\r\n }, { reload: true });\r\n });\r\n }\r\n\r\n ShippingEditEvents() {\r\n $('.shipping_portlet__address_edit').click(x => {\r\n $(this.AddressModalSelector).modal('show');\r\n });\r\n $('.shipping_portlet__invoice_edit').click(x => {\r\n $(this.InvoiceModalSelector).modal('show');\r\n });\r\n\r\n\r\n $(`${this.AddressModalSelector} .shipping_address_edit`).click(x => {\r\n let typeID = parseInt($(x.delegateTarget).attr('data-type'));\r\n this.FillAddressForm(this.AddressModalSelector, this.AddressFormSelector, this.Addresses.find(x => x.Type == typeID));\r\n });\r\n $(`${this.InvoiceModalSelector} .shipping_address_edit`).click(x => {\r\n let typeID = parseInt($(x.delegateTarget).attr('data-type'));\r\n this.FillAddressForm(this.InvoiceModalSelector, this.InvoiceFormSelector, this.Addresses.find(x => x.Type == typeID));\r\n });\r\n\r\n $(`${this.AddressModalSelector} .shipping_address_add`).click(x => {\r\n let typeID = parseInt($(x.delegateTarget).attr('data-type'));\r\n this.EmptyAddressForm(this.AddressModalSelector, this.AddressFormSelector, typeID);\r\n });\r\n $(`${this.InvoiceModalSelector} .shipping_address_add`).click(x => {\r\n let typeID = parseInt($(x.delegateTarget).attr('data-type'));\r\n this.EmptyAddressForm(this.InvoiceModalSelector, this.InvoiceFormSelector, typeID);\r\n });\r\n\r\n $(`${this.AddressModalSelector} .address_form__submit`).click(x => {\r\n let data = $(`${this.AddressModalSelector} ${this.AddressFormSelector}`).serialize();\r\n AxessViewer.loadPartialView(\"/Shipping/EditAddress\", data, x => {\r\n $(this.AddressModalSelector).modal('hide');\r\n }, { reload: true });\r\n });\r\n\r\n $(`${this.InvoiceModalSelector} .address_form__submit`).click(x => {\r\n let data = $(`${this.InvoiceModalSelector} ${this.InvoiceFormSelector}`).serialize();\r\n AxessViewer.loadPartialView(\"/Shipping/EditAddress\", data, x => {\r\n $(this.InvoiceModalSelector).modal('hide');\r\n }, { reload: true });\r\n });\r\n\r\n $(`${this.AddressModalSelector} .address_form__cancel`).click(x => {\r\n $(`${this.AddressModalSelector} .shipping_address_edit_form`).addClass('d-none');\r\n $(`${this.AddressModalSelector} .shipping_address_list`).removeClass('d-none');\r\n });\r\n\r\n $(`${this.InvoiceModalSelector} .address_form__cancel`).click(x => {\r\n $(`${this.InvoiceModalSelector} .shipping_address_edit_form`).addClass('d-none');\r\n $(`${this.InvoiceModalSelector} .shipping_address_list`).removeClass('d-none');\r\n });\r\n }\r\n\r\n SaveShippingInfo() {\r\n AxessViewer.loadPartialView(\"/Shipping/UpdateShippingInfo\", this.ShippingInfo, y => {\r\n }, { silent: true });\r\n }\r\n\r\n UpdateCurrentShipping(modalSelector: string, type: CustomerAddressType, additionalSelector: string) {\r\n let address = $(`${modalSelector} .shipping_address[data-for=${type}]`).clone();\r\n $(`${modalSelector} .shipping_address__current, ${additionalSelector}`).html(address.html());\r\n }\r\n\r\n EmptyAddressForm(modalSelector: string, formSelector: string, type: CustomerAddressType) {\r\n $(`${modalSelector} ${formSelector} [name=\"Type\"]`).val(type);\r\n $(`${modalSelector} ${formSelector} [name=\"Street\"]`).val('');\r\n $(`${modalSelector} ${formSelector} [name=\"Description\"]`).val('');\r\n $(`${modalSelector} ${formSelector} [name=\"City\"]`).val('');\r\n $(`${modalSelector} ${formSelector} [name=\"ZipCode\"]`).val('');\r\n $(`${modalSelector} ${formSelector} [name=\"CO\"]`).val('');\r\n $(`${modalSelector} ${formSelector} [name=\"State\"]`).val('');\r\n $(`${modalSelector} ${formSelector} [name=\"CountryCode\"]`).val('');\r\n\r\n $(`${modalSelector} .shipping_address_list`).addClass('d-none');\r\n $(`${modalSelector} .shipping_address_edit_form`).removeClass('d-none');\r\n }\r\n\r\n FillAddressForm(modalSelector: string, formSelector: string, address: Address) {\r\n $(`${modalSelector} ${formSelector} [name=\"Type\"]`).val(address.Type);\r\n $(`${modalSelector} ${formSelector} [name=\"Street\"]`).val(address.Street);\r\n $(`${modalSelector} ${formSelector} [name=\"Description\"]`).val(address.Description);\r\n $(`${modalSelector} ${formSelector} [name=\"City\"]`).val(address.City);\r\n $(`${modalSelector} ${formSelector} [name=\"ZipCode\"]`).val(address.ZipCode);\r\n $(`${modalSelector} ${formSelector} [name=\"CO\"]`).val(address.CO);\r\n $(`${modalSelector} ${formSelector} [name=\"State\"]`).val(address.State);\r\n $(`${modalSelector} ${formSelector} [name=\"CountryCode\"]`).val(address.CountryCode);\r\n\r\n $(`${modalSelector} .shipping_address_list`).addClass('d-none');\r\n $(`${modalSelector} .shipping_address_edit_form`).removeClass('d-none');\r\n }\r\n}\r\n\r\n\r\nclass ShippingInitData {\r\n Addresses: Address[];\r\n ShippingInfo: CustomerShippingInfo;\r\n}\r\n\r\nclass AddressEdit implements Address {\r\n City: string;\r\n CO: string;\r\n CountryCode: string;\r\n Description: string;\r\n Phone: string;\r\n Street: string;\r\n ZipCode: string;\r\n State: string;\r\n Type: CustomerAddressType;\r\n\r\n Delete: boolean;\r\n}", "import { CustomerAddressType } from \"../Account/Address\";\r\n\r\nexport class CustomerShippingInfo {\r\n DeliveryAddress: CustomerAddressType;\r\n InvoiceAddress: CustomerAddressType;\r\n Status: ShippingStatus;\r\n}\r\n\r\nexport enum ShippingStatus {\r\n PickUp = 0,\r\n Delivery = 1,\r\n InProgress = 2,\r\n Shipped = 3,\r\n Done = 4\r\n}", "import { IonRangeSliderEvent, IonRangeSliderOptions } from \"ion-rangeslider\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { RetailItem, RetailItemVariant } from \"../../Models/Retail/RetailItem\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { retailHelper } from \"../../Lib/Helper/Retail/RetailHelper\";\r\nimport { BodyUtility } from \"../../Components/AxUtility/BodyUtility\";\r\nimport { LocalStorageKeyCollection } from \"../../Lib/Constants/KeyCollection/LocalStorageKeyCollection\";\r\n\r\n@ModuleName(\"RetailFilter\")\r\nexport class RetailFilter implements AxInit {\r\n private rangeSlider: any;\r\n private priceRangeMin: number;\r\n private priceRangeMax: number;\r\n private currencyString: string;\r\n private retailItems: RetailItem[];\r\n private globalVariants: RetailItemVariant[] = [];\r\n private groupID: number;\r\n\r\n constructor(private _retailHelper = new retailHelper(),\r\n private _axLoading = new AxLoading(),\r\n private _bodyUtility = new BodyUtility()) { }\r\n\r\n private multiSelectFilter: RetailItemVariant[] = [];\r\n private tmpFilter: RetailItemVariant[];\r\n\r\n AxInit(init: RetailFilterInit): void {\r\n this.retailItems = init.RetailItems;\r\n this.currencyString = init.CurrencyString;\r\n this.groupID = init.GroupID;\r\n this.mergeVariants();\r\n\r\n this.setSizeValues();\r\n this.setMultiSelectFilter();\r\n this.setChipFilter();\r\n this.setColorPicker();\r\n this.setPriceFilter();\r\n\r\n this.assignResetEvent();\r\n this.setFilterCount();\r\n\r\n this._retailHelper.checkReload(x => {\r\n this.loadFilterFromLocalStorage(x);\r\n }, this.groupID);\r\n\r\n $('.retail__filter_settings').click(e => {\r\n window.scrollTo(0, 0);\r\n this.tmpFilter = this.multiSelectFilter.slice();\r\n $('.prod_selection__prod-wrapper').addClass('active');\r\n this._bodyUtility.DisableScroll();\r\n });\r\n\r\n\r\n $('.prod_selection__prod-wrapper .retail__filter_settings-close').click(e => {\r\n this.multiSelectFilter = this.tmpFilter;\r\n\r\n for (let gVariant of this.globalVariants.filter(x => !this.containsFilter(x, this.tmpFilter))) {\r\n this.toggleFilter(gVariant, false);\r\n }\r\n for (let tVariant of this.tmpFilter) {\r\n this.toggleFilter(tVariant, true);\r\n }\r\n if (typeof this.rangeSlider != 'undefined') {\r\n //This triggers update, keep it last!\r\n this.rangeSlider.update({\r\n from: this.rangeSlider.options.min,\r\n to: this.rangeSlider.options.max\r\n });\r\n } else {\r\n this.updateFilteredProducts();\r\n }\r\n\r\n $('.prod_selection__prod-wrapper').removeClass('active');\r\n\r\n this._bodyUtility.EnableScroll();\r\n });\r\n\r\n $('.retail__filter-update').click(e => {\r\n $('.prod_selection__prod-wrapper').removeClass('active');\r\n this._bodyUtility.EnableScroll();\r\n\r\n });\r\n\r\n $('.retail__filter-resetAllFilter').click(e => {\r\n for (let tmp of this.multiSelectFilter) {\r\n this.toggleFilter(tmp, false);\r\n }\r\n this.multiSelectFilter = [];\r\n\r\n if (typeof this.rangeSlider != 'undefined') {\r\n //This triggers update, keep it last!\r\n this.rangeSlider.update({\r\n from: this.rangeSlider.options.min,\r\n to: this.rangeSlider.options.max\r\n });\r\n } else {\r\n this.updateFilteredProducts();\r\n }\r\n });\r\n }\r\n\r\n\r\n loadFilterFromLocalStorage(storageFilter: RetailItemVariant[]) {\r\n if (storageFilter != null && storageFilter.length > 0) {\r\n this.multiSelectFilter = [];\r\n\r\n for (let filter of storageFilter) {\r\n if ($(`.retail__filter-container[data-filterType=\"${filter.FeatureType}\"][data-filterName=\"${filter.FeatureName}\"][value=\"${filter.FeatureValue}\"]`).length > 0) {\r\n this.toggleFilter(filter, true);\r\n this.multiSelectFilter.push(filter);\r\n }\r\n }\r\n\r\n if (this.multiSelectFilter.length > 0) {\r\n this.updateFilteredProducts();\r\n }\r\n }\r\n }\r\n\r\n setFilterCount() {\r\n let groupedFilter = this.globalVariants.reduce((r, a) => {\r\n let key = `${a.FeatureType}-${a.FeatureName}`;\r\n r[key] = r[key] || [];\r\n r[key].push(a);\r\n return r;\r\n }, Object.create(null));\r\n\r\n\r\n for (let group of Object.keys(groupedFilter)) {\r\n let sampleVariant: RetailItemVariant = groupedFilter[group][0];\r\n let availableItems = this.getFilteredList(this.multiSelectFilter.filter(\r\n x => x.FeatureName !== sampleVariant.FeatureName || x.FeatureType !== sampleVariant.FeatureType)).filter(x => x.IsMaster);\r\n let anyElementActive = false;\r\n\r\n let priceMinFilterChanged = this.rangeSlider != null ? this.rangeSlider.options.min !== this.rangeSlider.old_from : false;\r\n let priceMaxFilterChanged = this.rangeSlider != null ? this.rangeSlider.options.max !== this.rangeSlider.old_to : false;\r\n\r\n\r\n for (let variant of groupedFilter[group]) {\r\n let itemsWithVariant = availableItems.filter(y => y.Variants.findIndex(x => x.FeatureName === variant.FeatureName &&\r\n x.FeatureType === variant.FeatureType &&\r\n x.FeatureValue === variant.FeatureValue) !== -1 && ((y.Tariff <= this.priceRangeMax || !priceMaxFilterChanged) && (y.Tariff >= this.priceRangeMin || !priceMinFilterChanged)));\r\n let $container =\r\n $(`.retail__filter-container[data-filterType=\"${sampleVariant.FeatureType}\"][data-filterName=\"${sampleVariant.FeatureName}\"][value=\"${variant.FeatureValue}\"]`);\r\n let elementActive = itemsWithVariant.length > 0 || $container.hasClass('active');\r\n anyElementActive = anyElementActive || elementActive;\r\n $container.toggleClass('d-none', !elementActive);\r\n\r\n $(`.retail__filter-container[data-filterType=\"${sampleVariant.FeatureType}\"][data-filterName=\"${sampleVariant.FeatureName}\"][value=\"${variant.FeatureValue}\"] .retail__filter_count`)\r\n .html(`(${itemsWithVariant.length})`);\r\n }\r\n\r\n $(`.retail__filter-block[data-filterType=\"${sampleVariant.FeatureType}\"][data-filterName=\"${sampleVariant\r\n .FeatureName}\"]`).toggleClass('d-none', !anyElementActive);\r\n }\r\n }\r\n\r\n assignResetEvent() {\r\n $('.retail__filter_reset').click(e => {\r\n let $e = $(e.delegateTarget);\r\n let featureType = parseInt($e.attr('data-filterType') as string);\r\n let featureName = $e.attr('data-filterName') as string;\r\n\r\n this.toggleFilterByType(featureType, featureName, false);\r\n this.multiSelectFilter =\r\n this.multiSelectFilter.filter(\r\n x => x.FeatureType !== featureType || x.FeatureName !== featureName);\r\n this.updateFilteredProducts();\r\n });\r\n }\r\n\r\n getFilteredList(filterList: RetailItemVariant[]): RetailItem[] {\r\n let filteredItems: RetailItem[] = [];\r\n\r\n let multiSelectFilter = filterList.filter(x => this.isMultiSelectFilter(x));\r\n if (multiSelectFilter.length > 0) {\r\n let baseList = this.retailItems;\r\n\r\n let groupedFilter = multiSelectFilter.reduce((r, a) => {\r\n let key = `${a.FeatureType}-${a.FeatureName}`;\r\n r[key] = r[key] || [];\r\n r[key].push(a);\r\n return r;\r\n }, Object.create(null));\r\n\r\n for (let group of Object.keys(groupedFilter)) {\r\n filteredItems = [];\r\n for (let filter of groupedFilter[group]) {\r\n filteredItems.push(...baseList.filter(x => x.Variants != null &&\r\n x.Variants.findIndex(y => y.FeatureName === filter.FeatureName &&\r\n y.FeatureValue === filter.FeatureValue &&\r\n y.FeatureType === filter.FeatureType) !==\r\n -1));\r\n }\r\n baseList = filteredItems;\r\n }\r\n } else {\r\n filteredItems = this.retailItems;\r\n }\r\n\r\n let chipFilter = filterList.filter(x => !this.isMultiSelectFilter(x));\r\n if (chipFilter.length > 0) {\r\n for (let filter of chipFilter) {\r\n filteredItems = filteredItems.filter(x => x.Variants != null &&\r\n x.Variants.findIndex(y => y.FeatureName === filter.FeatureName &&\r\n y.FeatureValue === filter.FeatureValue &&\r\n y.FeatureType === filter.FeatureType) !==\r\n -1);\r\n }\r\n }\r\n\r\n return filteredItems;\r\n }\r\n\r\n updateFilteredProducts(): void {\r\n //300ms loading\r\n this._axLoading.ShowLoadingIndicator($('.retail__filter_bar')[0], true);\r\n $('.retail__filter_bar--container').addClass('loading');\r\n\r\n setTimeout(() => {\r\n let filteredItems: RetailItem[] = this.getFilteredList(this.multiSelectFilter);\r\n let priceFilteredItems =\r\n filteredItems.filter(y => y.Tariff <= this.priceRangeMax && y.Tariff >= this.priceRangeMin);\r\n\r\n this.updatePriceFilter(filteredItems);\r\n\r\n $('.retail__filter_item').removeClass('d-none');\r\n\r\n for (let item of this.retailItems.filter(x => priceFilteredItems.findIndex(y => y.RetailItemNr === x.RetailItemNr) === -1)) {\r\n $(`.retail__filter_item[data-itemid=${item.RetailItemNr}]`).addClass('d-none');\r\n }\r\n\r\n let entriesLeft: boolean = $('.retail__filter_item').not('.d-none').length !== 0;\r\n $('.retail__notFound').toggleClass('d-none', entriesLeft);\r\n\r\n if (entriesLeft) {\r\n this._retailHelper.saveToLocalStorage(this.multiSelectFilter, this.groupID);\r\n $('.retail__filter_settings').toggleClass('hideCount', this.multiSelectFilter.length == 0).attr('data-count', this.multiSelectFilter.length);\r\n }\r\n\r\n this.setFilterCount();\r\n\r\n this._axLoading.HideLoadingIndicator($('.retail__filter_bar')[0]);\r\n $('.retail__filter_bar--container').removeClass('loading');\r\n }, 300);\r\n }\r\n\r\n setColorPicker() {\r\n this._retailHelper.setColorPickerColors($('.retail__filter_color'));\r\n\r\n $('.retail__filter_color-btn').click(e => {\r\n let $e = $(e.delegateTarget);\r\n let $container = $e.parent();\r\n let filter = this.getFilterFromElement($container);\r\n\r\n $e.toggleClass('active');\r\n\r\n this.setActiveContainer($container, $e.hasClass('active'));\r\n if ($e.hasClass('active')) {\r\n this.multiSelectFilter.push(filter);\r\n } else {\r\n this.multiSelectFilter =\r\n this.multiSelectFilter.filter(x => x.FeatureType !== filter.FeatureType || x.FeatureName !== filter.FeatureName || x.FeatureValue !== filter.FeatureValue);\r\n }\r\n this.updateFilteredProducts();\r\n });\r\n }\r\n\r\n\r\n setPriceFilter() {\r\n let min = this.retailItems.reduce((prev, curr) => prev.Tariff < curr.Tariff ? prev : curr).Tariff;\r\n let max = this.retailItems.reduce((prev, curr) => prev.Tariff > curr.Tariff ? prev : curr).Tariff;\r\n\r\n this.priceRangeMin = min;\r\n this.priceRangeMax = max;\r\n\r\n if (min !== max) {\r\n $(\"#retail__filter__price_slider\").ionRangeSlider({\r\n skin: 'round',\r\n type: 'double',\r\n hide_min_max: true,\r\n extra_classes: 'ax-range-slider has-labels',\r\n prefix: `${this.currencyString} `,\r\n max: max / 100,\r\n min: min / 100,\r\n drag_interval: true,\r\n onStart: x => {\r\n this.currentFilterList = this.getFilteredList(this.multiSelectFilter);\r\n },\r\n onFinish: x => this.priceSliderChange(x),\r\n onUpdate: x => this.priceSliderChange(x),\r\n onChange: x => this.backgroundUpdatePriceFilter(x)\r\n });\r\n this.rangeSlider = $(\"#retail__filter__price_slider\").data(\"ionRangeSlider\");\r\n\r\n $('.retail__filter__price_reset').click(x => {\r\n this.rangeSlider.update({\r\n from: this.rangeSlider.options.min,\r\n to: this.rangeSlider.options.max\r\n });\r\n });\r\n } else {\r\n $('.retail__filter__price_holder').addClass('d-none');\r\n }\r\n }\r\n\r\n priceSliderChange(x: IonRangeSliderEvent) {\r\n this.priceRangeMin = Math.round(x.from * 100);\r\n this.priceRangeMax = Math.round(x.to * 100);\r\n this.updateFilteredProducts();\r\n\r\n let priceFilteredItems = this.currentFilterList.filter(y => y.Tariff <= Math.round(x.to * 100) && y.Tariff >= Math.round(x.from * 100));\r\n\r\n if (priceFilteredItems.length > 0) {\r\n let min = priceFilteredItems.reduce((prev, curr) => prev.Tariff < curr.Tariff ? prev : curr).Tariff;\r\n let max = priceFilteredItems.reduce((prev, curr) => prev.Tariff > curr.Tariff ? prev : curr).Tariff;\r\n\r\n if (min !== max) {\r\n this.updatePriceFilterSingleItem(0);\r\n }\r\n }\r\n }\r\n\r\n private currentFilterList: RetailItem[];\r\n\r\n backgroundUpdatePriceFilter(event: IonRangeSliderEvent) {\r\n let priceFilteredItems = this.currentFilterList.filter(y => y.Tariff <= Math.round(event.to * 100) && y.Tariff >= Math.round(event.from * 100));\r\n\r\n if (priceFilteredItems.length > 0) {\r\n let min = priceFilteredItems.reduce((prev, curr) => prev.Tariff < curr.Tariff ? prev : curr).Tariff;\r\n let max = priceFilteredItems.reduce((prev, curr) => prev.Tariff > curr.Tariff ? prev : curr).Tariff;\r\n\r\n if (min === max) {\r\n this.updatePriceFilterSingleItem(priceFilteredItems[0].Tariff);\r\n }\r\n }\r\n }\r\n\r\n private lastPriceFilterTariff: number = 0;\r\n\r\n updatePriceFilterSingleItem(tariff: number) {\r\n if (tariff !== this.lastPriceFilterTariff) {\r\n this.lastPriceFilterTariff = tariff;\r\n if (tariff !== 0) {\r\n this.rangeSlider.update({\r\n from_max: tariff / 100,\r\n to_min: tariff / 100\r\n });\r\n } else {\r\n this.rangeSlider.update({\r\n from_max: null,\r\n to_min: null\r\n });\r\n }\r\n }\r\n }\r\n\r\n updatePriceFilter(itemList: RetailItem[]) {\r\n let rangeSliderExist = typeof this.rangeSlider != 'undefined';\r\n\r\n if (rangeSliderExist) {\r\n let oldMin = this.rangeSlider.options.min;\r\n let oldMax = this.rangeSlider.options.max;\r\n\r\n let min = 0;\r\n let max = 0;\r\n\r\n if (itemList.length > 0) {\r\n min = itemList.reduce((prev, curr) => prev.Tariff < curr.Tariff ? prev : curr).Tariff / 100;\r\n max = itemList.reduce((prev, curr) => prev.Tariff > curr.Tariff ? prev : curr).Tariff / 100;\r\n }\r\n\r\n let oldFrom = this.rangeSlider.old_from;\r\n let oldTo = this.rangeSlider.old_to;\r\n let from = oldFrom > min && oldFrom !== oldMin ? oldFrom : min;\r\n let to = oldTo < max && oldTo !== oldMax ? oldTo : max;\r\n\r\n if (min !== oldMin || max !== oldMax) {\r\n this.rangeSlider.update({\r\n min: min,\r\n max: max,\r\n from: from,\r\n to: to\r\n });\r\n }\r\n }\r\n }\r\n\r\n setChipFilter() {\r\n $('button.ax-chip.retail__filter-chips').click(e => {\r\n let $target = $(e.delegateTarget);\r\n let $container = $target.parent();\r\n let filter = this.getFilterFromElement($container);\r\n\r\n $container.parent().find('button.ax-chip.retail__filter-chips.active').each((i, siblings) => {\r\n this.toggleChip($(siblings));\r\n });\r\n\r\n this.toggleChip($target);\r\n\r\n this.multiSelectFilter = this.multiSelectFilter.filter(x => x.FeatureType !== filter.FeatureType || x.FeatureName !== filter.FeatureName);\r\n if ($target.hasClass('active')) {\r\n this.multiSelectFilter.push({\r\n FeatureType: filter.FeatureType,\r\n FeatureValue: filter.FeatureValue,\r\n FeatureName: filter.FeatureName,\r\n VariantRelated: false,\r\n Color: filter.Color\r\n });\r\n }\r\n\r\n this.updateFilteredProducts();\r\n });\r\n }\r\n\r\n setMultiSelectFilter() {\r\n $('.retail__filter-multiselect').change(x => {\r\n let $e = $(x.delegateTarget);\r\n let $container = $e.parent().parent();\r\n\r\n let filter = this.getFilterFromElement($container);\r\n this.setActiveContainer($container, $e.prop('checked'));\r\n\r\n if ($e.prop('checked')) {\r\n this.multiSelectFilter.push({\r\n FeatureType: filter.FeatureType,\r\n FeatureValue: filter.FeatureValue,\r\n FeatureName: filter.FeatureName,\r\n VariantRelated: false,\r\n Color: filter.Color\r\n });\r\n } else {\r\n this.multiSelectFilter = this.multiSelectFilter.filter(x => x.FeatureType !== filter.FeatureType ||\r\n x.FeatureValue !== filter.FeatureValue ||\r\n x.FeatureName !== filter.FeatureName);\r\n }\r\n\r\n this.updateFilteredProducts();\r\n });\r\n }\r\n\r\n containsFilter(searchValue: RetailItemVariant, list: RetailItemVariant[]) {\r\n return list.findIndex(x => x.FeatureType === searchValue.FeatureType &&\r\n x.FeatureName === searchValue.FeatureName &&\r\n x.FeatureValue === searchValue.FeatureValue) !==\r\n -1;\r\n }\r\n\r\n setActiveContainer($e: JQuery<Element>, toggleValue: boolean) {\r\n $e.toggleClass('active', toggleValue);\r\n }\r\n\r\n getFilterFromElement($e: JQuery<HTMLElement>): RetailItemVariant {\r\n return {\r\n FeatureType: parseInt($e.attr('data-filterType') as string),\r\n FeatureValue: $e.attr('value') as string,\r\n FeatureName: $e.attr('data-filterName') as string,\r\n VariantRelated: false,\r\n Color: $e.css('background-color')\r\n };\r\n }\r\n\r\n toggleChip($target: JQuery<HTMLElement>) {\r\n $target.toggleClass('active').toggleClass('ax-fill-primary');\r\n }\r\n\r\n setSizeValues() {\r\n for (let item of this.retailItems.filter(x => x.Variants != null &&\r\n x.Variants.findIndex(y => y.FeatureType === 6) !== -1)) {\r\n let size = item.Variants.filter(x => x.FeatureType === 6).map(x => x.FeatureValue).join(\" \");\r\n $(`.retail__filter_item[data-itemid=${item.RetailItemNr}] .retail__filter_item_size`).html(size);\r\n }\r\n }\r\n\r\n toggleFilterByType(featureType: number, featureName: string, state: boolean) {\r\n switch (featureType) {\r\n case 6:\r\n $(`.retail__filter-container[data-filterType=\"${featureType}\"][data-filterName=\"${featureName}\"] button.retail__filter-chips.ax-chip.retail__filter-chips`).each((i, x) => {\r\n let $x = $(x);\r\n $x.toggleClass('active', state).toggleClass('ax-fill-primary', state);\r\n });\r\n break;\r\n\r\n case 2:\r\n for (let x of $('.retail__filter_color-btn')) {\r\n let $x = $(x);\r\n $x.toggleClass('active', state);\r\n }\r\n break;\r\n\r\n default:\r\n $(`.retail__filter-container[data-filterType=\"${featureType}\"][data-filterName=\"${featureName}\"] .retail__filter-multiselect`)\r\n .prop('checked', state);\r\n break;\r\n }\r\n }\r\n\r\n toggleFilter(variant: RetailItemVariant, state: boolean) {\r\n switch (variant.FeatureType) {\r\n case 6:\r\n $(`.retail__filter-container[data-filterType=\"${variant.FeatureType}\"][data-filterName=\"${variant.FeatureName}\"][value=\"${variant.FeatureValue}\"] button.retail__filter-chips.ax-chip.retail__filter-chips`).toggleClass('active', state).toggleClass('ax-fill-primary', state);\r\n break;\r\n\r\n case 2:\r\n $(`.retail__filter-container[data-filterType=\"${variant.FeatureType}\"][data-filterName=\"${variant.FeatureName}\"][value=\"${variant.FeatureValue}\"] .retail__filter_color-btn`).toggleClass('active', state);\r\n break;\r\n\r\n default:\r\n $(`.retail__filter-container[data-filterType=\"${variant.FeatureType}\"][data-filterName=\"${variant.FeatureName}\"][value=\"${variant.FeatureValue}\"] .retail__filter-multiselect`).prop('checked', state);\r\n break;\r\n }\r\n }\r\n\r\n mergeVariants() {\r\n for (let item of this.retailItems.filter(x => !x.IsMaster && x.AvailableItems > 0)) {\r\n let mainItem = this.retailItems.find(x => x.RetailNr === item.RetailParentNr);\r\n\r\n if (mainItem.AvailableItems === 0) {\r\n mainItem.Variants = [];\r\n }\r\n\r\n if (mainItem.Variants != null) {\r\n mainItem.Variants.push(...item.Variants.filter(x => mainItem.Variants.findIndex(y => y.FeatureType === x.FeatureType && y.FeatureName === x.FeatureName && x.FeatureValue === y.FeatureValue) === -1));\r\n } else {\r\n mainItem.Variants = item.Variants;\r\n }\r\n }\r\n this.setGlobalVariant();\r\n }\r\n\r\n setGlobalVariant() {\r\n for (let item of this.retailItems.filter(x => x.IsMaster)) {\r\n this.globalVariants.push(...item.Variants.filter(x => this.globalVariants.findIndex(y => y.FeatureType === x.FeatureType && y.FeatureName === x.FeatureName && x.FeatureValue === y.FeatureValue) === -1));\r\n }\r\n }\r\n\r\n isMultiSelectFilter(variant: RetailItemVariant): boolean {\r\n return variant.FeatureType !== 6;\r\n }\r\n}\r\n\r\ninterface RetailFilterInit {\r\n CurrencyString: string;\r\n RetailItems: RetailItem[];\r\n GroupID: number;\r\n}", "import Swal from \"sweetalert2\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { AxPortletExpandable } from \"../../Limestone/AxPortlet/AxPortletExpandable\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\n\r\ninterface IOrderHistoryInitData {\r\n cancellationAdditionalText: string;\r\n}\r\n\r\n@ModuleName(\"OrderHistory\")\r\nexport class OrderHistory implements AxInit {\r\n public axLoading: AxLoading;\r\n\r\n private cancellationAdditionalText: string;\r\n private i18nHelper = new I18nHelper();\r\n\r\n constructor(private _Porlet = new AxPortletExpandable()) { }\r\n\r\n AxInit(init: IOrderHistoryInitData): void {\r\n this.axLoading = new AxLoading();\r\n\r\n AxLoad.LoadModule('BleQrCodes', {\r\n loadTicketBtnClass: '.ax-history-button--showQr',\r\n copyTextToClipboardBtnClass: '.ax-history-button--Qrlink'\r\n });\r\n\r\n\r\n this.cancellationAdditionalText = init.cancellationAdditionalText;\r\n\r\n this._Porlet.OnOpen('.cart-history button[data-trans]', (e, elem) => {\r\n let transNr = parseInt($(elem).attr('data-trans'));\r\n let posNr = parseInt($(elem).attr('data-pos'));\r\n this.LoadData(posNr, transNr);\r\n });\r\n\r\n }\r\n\r\n\r\n\r\n // ToggleTimings\r\n ToggleTimings(delegatedTarget: HTMLElement) {\r\n let $e = $(delegatedTarget);\r\n $e.next('.history__timeslot-accordion-box').slideToggle('fast');\r\n $e.find('i').toggleClass('las la-angle-down').toggleClass('las la-angle-up');\r\n }\r\n\r\n // LoadData\r\n LoadData(posNr: number, transNr: number) {\r\n let key: string = `#detail-${posNr}-${transNr}`;\r\n\r\n $(key).html(\"<div></div>\"); // clear detail view before load\r\n\r\n this.axLoading.ShowLoadingIndicator($(key)[0]);\r\n\r\n AxessViewer.loadPartialView(\r\n '/Profile/_Details',\r\n { trans_id: transNr, posNr: posNr },\r\n ({ view, data: { postData, ticketDefIsKGT23, waiverIsEnabled, oneRISKProcessRequired, waiverCompeling, transactionNumber } }) => {\r\n $(key).html(view);\r\n\r\n $(key).find('.tv4_side__selection-timing--toggle').on('click', (x) => { this.ToggleTimings(x.delegateTarget); });\r\n\r\n this.addClickListenerCancelButton(posNr, transNr);\r\n\r\n AxLoad.ReloadModule('BleQrCodes', key);\r\n\r\n this.axLoading.HideLoadingIndicator($(key)[0]);\r\n\r\n AxLoad.LoadModules([\r\n {\r\n name: \"OneRisk\", initData: {\r\n // processIndicatorActive: @(ViewBag.Layout_SlimHeader ?? false ? \"true\" : \"false\"),\r\n // progressBarMode: @(Request.QueryString[\"Ref\"] == \"pit\" ? 1 : 0),\r\n postData,\r\n ticketDefIsKGT23,\r\n waiverIsEnabled,\r\n oneRISKProcessRequired,\r\n waiverCompeling,\r\n transactionNumber,\r\n }\r\n }\r\n ]);\r\n }\r\n );\r\n }\r\n // addClickListenerCancelButton\r\n addClickListenerCancelButton(posNr: any, transNr: any) {\r\n let cancelButtons = document.getElementById(`detail-${posNr}-${transNr}`).getElementsByClassName(\"ax-history-button--cancel\");\r\n\r\n if (cancelButtons.length > 0) {\r\n\r\n for (let i = 0; i < cancelButtons.length; i++) {\r\n cancelButtons[i].addEventListener(\"click\", ev => {\r\n let transNr = $(ev.target).attr('data-transNr');\r\n let serialNr = $(ev.target).attr('data-serialNr');\r\n let poolNr = $(ev.target).attr('data-poolNr');\r\n\r\n this.confirmCancel(transNr, serialNr, poolNr, ev.target);\r\n });\r\n }\r\n }\r\n }\r\n // confirmCancel\r\n confirmCancel(transNr, serialNr, poolNr, button) {\r\n\r\n let apiRequestData = {\r\n serialNr: serialNr,\r\n transNr: transNr,\r\n };\r\n\r\n AxessViewer.ajaxRequest('/api/CancelationApi/GetTicketCancelationStatus',\r\n apiRequestData,\r\n (result) => {\r\n\r\n console.log(result);\r\n\r\n if (result.TicketIsCanceled) {\r\n Swal.fire({\r\n title: this.i18nHelper.GetTranslation(Translations.Error),\r\n icon: 'warning',\r\n showCancelButton: false,\r\n html: '<div>' + 'already canceled' + '</div>',\r\n showDenyButton: false,\r\n footer: this.cancellationAdditionalText,\r\n confirmButtonText: this.i18nHelper.GetTranslation(Translations.Cancel),\r\n denyButtonText: this.i18nHelper.GetTranslation(Translations.Cancel),\r\n cancelButtonText: this.i18nHelper.GetTranslation(Translations.Cancel)\r\n }).then((result) => {\r\n\r\n });\r\n } else {\r\n let data = {\r\n transNr: transNr,\r\n serialNr: serialNr,\r\n poolNr: poolNr\r\n };\r\n\r\n AxessViewer.loadPartialView('/Profile/GetCancelSweetAlertHtml', data, (result) => {\r\n Swal.fire({\r\n title: this.i18nHelper.GetTranslation(Translations.AreYouSure),\r\n icon: 'warning',\r\n showCancelButton: true,\r\n html: result,\r\n showDenyButton: false,\r\n footer: this.cancellationAdditionalText,\r\n confirmButtonText: this.i18nHelper.GetTranslation(Translations.Confirmation),\r\n denyButtonText: this.i18nHelper.GetTranslation(Translations.Cancel),\r\n cancelButtonText: this.i18nHelper.GetTranslation(Translations.Cancel)\r\n }).then((result) => {\r\n if (result.value) {\r\n $(button).prop(\"disabled\", true);\r\n this.cancelTicket(transNr, serialNr);\r\n } else if (result.isDenied) {\r\n\r\n }\r\n });\r\n }, { dataType: 'html' });\r\n }\r\n }, {});\r\n\r\n\r\n }\r\n // cancelTicket\r\n cancelTicket(transNr, serialNr) {\r\n\r\n let that = this;\r\n\r\n const data = {\r\n transNr: transNr,\r\n serialNr: serialNr\r\n };\r\n\r\n that.axLoading.ShowLoadingIndicatorFixed($('.ax-body')[0]);\r\n\r\n AxessViewer.loadPartialView('/Profile/CancelTicket', data, function (resp) {\r\n\r\n that.axLoading.HideLoadingIndicator($('.ax-body')[0]);\r\n\r\n if (resp[\"error\"] === false) {\r\n Swal.fire({\r\n title: `${that.i18nHelper.GetTranslation(Translations.Success)}!`,\r\n icon: 'success',\r\n text: resp['message'],\r\n confirmButtonText: that.i18nHelper.GetTranslation(Translations.Ok),\r\n showConfirmButton: true\r\n }).then((result) => {\r\n location.reload();\r\n });\r\n }\r\n else {\r\n Swal.fire({\r\n title: `${that.i18nHelper.GetTranslation(Translations.Error)}!`,\r\n text: resp['message'],\r\n icon: 'error',\r\n confirmButtonText: that.i18nHelper.GetTranslation(Translations.Ok)\r\n }).then(resp => {\r\n location.reload();\r\n });\r\n }\r\n\r\n }, {\r\n silent: true\r\n });\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxDropdown, IAxDropdownOptions } from \"@axess/limestone\";\r\n\r\nexport interface IAxBirthDateInitData {\r\n birthdayPattern: string;\r\n parentId: string;\r\n outputTarget: string;\r\n setDay: string;\r\n setMonth: string;\r\n setYear: string;\r\n setBirthDate: string;\r\n}\r\n\r\n@ModuleName(\"AxBirthDateInputTriple\")\r\nexport class AxBirthDateInputTriple implements AxInit {\r\n private _birthdayPattern: string = \"\";\r\n\r\n private _birthDateMonthDropDown: AxDropdown = new AxDropdown();\r\n private _birthDateDayDropDown: AxDropdown = new AxDropdown();\r\n private _birthDateYearDropDown: AxDropdown = new AxDropdown();\r\n\r\n private _parentId: string;\r\n private _outputTarget: string;\r\n\r\n private _month: string;\r\n private _day: string;\r\n private _year: string;\r\n\r\n AxInit(initData: IAxBirthDateInitData): void {\r\n\r\n this._parentId = initData.parentId;\r\n this._birthdayPattern = initData.birthdayPattern;\r\n this._outputTarget = initData.outputTarget;\r\n\r\n this._birthDateMonthDropDown.init(this._parentId + ' .axBirthDate__month-selection__month-wrapper',\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent, value) => {\r\n this._month = value as string;\r\n this.getDaysDropDownList();\r\n this.setOutPutBirthDate();\r\n }\r\n });\r\n\r\n this._birthDateDayDropDown.init(this._parentId + ' .axBirthDate__day-selection__day-wrapper',\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent, value) => {\r\n this._day = value as string;\r\n this.setOutPutBirthDate();\r\n }\r\n });\r\n\r\n this._birthDateYearDropDown.init(this._parentId + ' .axBirthDate__year-selection__year-wrapper',\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent, value) => {\r\n this._year = value as string;\r\n this.getDaysDropDownList();\r\n this.setOutPutBirthDate();\r\n }\r\n });\r\n\r\n if (initData.setBirthDate) {\r\n let momentFamilyMemberDate = moment(initData.setBirthDate, this._birthdayPattern.toUpperCase(), true);\r\n\r\n const monthValue = momentFamilyMemberDate.format(\"MM\");\r\n const dayValue = momentFamilyMemberDate.format(\"DD\");\r\n const yearValue = momentFamilyMemberDate.format(\"YYYY\");\r\n this.setCurrentSavedDate(monthValue, dayValue, yearValue);\r\n }\r\n\r\n if (initData.setDay && initData.setMonth && initData.setYear) {\r\n this.setCurrentSavedDate(initData.setMonth, initData.setDay, initData.setYear);\r\n } else if (!initData.setBirthDate) {\r\n this._birthDateMonthDropDown.resetSelection();\r\n this._birthDateDayDropDown.resetSelection();\r\n this._birthDateYearDropDown.resetSelection();\r\n }\r\n }\r\n\r\n getDaysDropDownList() {\r\n const daysInMonth = moment(`${this._year ?? \"2012\"}-${this._month}`, \"YYYY-MM\").daysInMonth();\r\n $(this._parentId + ' .registerBirthDateMonthList').html(\"\");\r\n\r\n for (let i = 1; i <= daysInMonth; i++) {\r\n const inner = document.createElement(\"li\");\r\n inner.innerHTML = i.toString();\r\n inner.classList.add(\"ax-dropdown__item\");\r\n inner.setAttribute(\"data-value\", i.toString());\r\n\r\n $(this._parentId + ' .registerBirthDateMonthList').append(inner);\r\n }\r\n\r\n if (this._day != null && parseInt(this._day) > daysInMonth) {\r\n this._birthDateDayDropDown.setValue(\"1\");\r\n }\r\n }\r\n\r\n // setCurrentSavedDate\r\n setCurrentSavedDate(month: string, day: string, year: string) {\r\n this._birthDateMonthDropDown.setValue(month);\r\n this._birthDateDayDropDown.setValue(day);\r\n this._birthDateYearDropDown.setValue(year);\r\n\r\n this._month = month;\r\n this._day = day;\r\n this._year = year;\r\n\r\n this.setOutPutBirthDate();\r\n }\r\n\r\n // setCartPersonBirthDate\r\n setOutPutBirthDate() {\r\n if (this._month && this._day && this._year) {\r\n let momentDate = moment(this._month + '-' + this._day + '-' + this._year, 'MM-DD-YYYY');\r\n\r\n let $outputElem = $(this._parentId).find(this._outputTarget);\r\n\r\n if ($outputElem.length > 0) {\r\n $outputElem.val(momentDate.format(this._birthdayPattern.toUpperCase()));\r\n $outputElem.trigger('change').trigger('blur');\r\n }\r\n }\r\n }\r\n}", "export class AxCounterWithInput {\r\n private Target: JQuery<HTMLElement>;\r\n private Options: OptionsCounterInput;\r\n\r\n Init(options: OptionsCounterInput) {\r\n this.Options = options;\r\n options.onChange = options.onChange || ((x) => { });\r\n if (typeof this.Options.incrementValue !== 'number') {\r\n this.Options.incrementValue = 1;\r\n }\r\n this.Target = $(this.Options.target);\r\n if (this.Target.length > 0) {\r\n this.Target.addClass('ax-counter-input').addClass('position-relative');\r\n\r\n let minus = document.createElement('div');\r\n minus.classList.add(\"ax-btn-transparent\");\r\n minus.classList.add(\"ax-btn\");\r\n minus.classList.add(\"ax-color-black\");\r\n minus.style.borderColor = \"#fff\";\r\n minus.style.borderBottomLeftRadius = \"2px\";\r\n minus.style.borderTopLeftRadius = \"2px\";\r\n minus.style.cursor = \"pointer\";\r\n let minusChar = document.createTextNode('-');\r\n minus.appendChild(minusChar);\r\n\r\n let inputContainer = document.createElement('div');\r\n inputContainer.classList.add(\"d-flex\");\r\n inputContainer.classList.add(\"align-items-center\");\r\n let input = $(this.Target)[0].getElementsByTagName('input')[0];\r\n input.classList.add(\"ax-counter-input\")\r\n input.setAttribute('type', 'number');\r\n\r\n let additionalText = document.createTextNode(options.text);\r\n inputContainer.appendChild(input);\r\n inputContainer.appendChild(additionalText);\r\n\r\n let plus = document.createElement('div');\r\n plus.classList.add(\"ax-btn-transparent\");\r\n plus.classList.add(\"ax-ml-1\")\r\n plus.classList.add(\"ax-color-black\");\r\n plus.classList.add(\"ax-btn\");\r\n plus.style.backgroundColor = \"#FFE5D6\";\r\n plus.style.borderColor = \"#ffe5d6\";\r\n plus.style.borderBottomRightRadius = \"2px\";\r\n plus.style.borderTopRightRadius = \"2px\";\r\n plus.style.cursor = \"pointer\";\r\n let plusChar = document.createTextNode('+');\r\n plus.appendChild(plusChar);\r\n\r\n let component = document.createElement('div');\r\n component.classList.add(\"ax-counter-input-box\");\r\n component.classList.add(\"d-flex\");\r\n component.append(minus);\r\n component.append(inputContainer);\r\n component.append(plus);\r\n\r\n this.Target.append(component);\r\n\r\n let fn = function resizeInput() {\r\n\r\n //disalow decimals\r\n let old = input.value;\r\n if (old == \"\" || old == undefined) {\r\n old = \"0\";\r\n }\r\n input.value = String(parseInt(old));\r\n\r\n checkBoundaries();\r\n //width is wider so that paddings can be applied\r\n this.style.width = (this.value.length + 1) + \"ch\";\r\n options.onChange(parseInt(input.value));\r\n }\r\n let incrementFn = function increment() {\r\n let oldValue: number = parseInt(input.value);\r\n let newValue: number = oldValue + options.incrementValue;\r\n input.value = String(newValue);\r\n options.onChange(newValue);\r\n fn.call(input);\r\n }\r\n plus.addEventListener('click', incrementFn);\r\n\r\n let decrementFn = function decrement() {\r\n let oldValue: number = parseInt(input.value);\r\n let newValue: number = oldValue - options.incrementValue;\r\n input.value = String(newValue)\r\n options.onChange(newValue);\r\n fn.call(input);\r\n }\r\n\r\n let checkBoundaries = function () {\r\n let amount: number = parseInt(input.value);\r\n if (typeof options.minValue !== 'undefined' && options.minValue != null) {\r\n if (amount < options.minValue) {\r\n input.value = String(options.minValue);\r\n }\r\n }\r\n if (typeof options.maxValue !== 'undefined' && options.maxValue != null) {\r\n if (amount > options.maxValue) {\r\n input.value = String(options.maxValue);\r\n }\r\n }\r\n }\r\n\r\n minus.addEventListener('click', decrementFn);\r\n input.addEventListener('input', fn);\r\n fn.call(input); // immediately call the function \r\n }\r\n }\r\n\r\n destroy() {\r\n this.Target.html('');\r\n }\r\n\r\n public changeAmount(amount: number): void {\r\n let input = $(this.Target)[0].getElementsByTagName('input')[0];\r\n input.value = String(amount);\r\n input.style.width = (input.value.length + 1) + \"ch\";\r\n }\r\n\r\n public getAmount(): string {\r\n let input = $(this.Target)[0].getElementsByTagName('input')[0];\r\n return input.value;\r\n }\r\n\r\n}\r\n\r\nexport interface OptionsCounterInput {\r\n target: string;\r\n inputValue?: number;\r\n incrementValue?: number;\r\n maxValue?: number;\r\n minValue?: number;\r\n text: string;\r\n onChange?: (value: number) => void\r\n}", "import { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { Step } from \"../../Limestone/AxProgressBar/AxProgressBar\";\r\n\r\nexport class ProgressBar {\r\n constructor(private i18nHelper = new I18nHelper()) { }\r\n GetGiftCardSteps(): Step[] {\r\n return [\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.AmountAndDesign),\r\n type: 'inactive'\r\n },\r\n {\r\n label: this.i18nHelper.GetTranslation(Translations.Personalize),\r\n type: 'inactive'\r\n },\r\n ];\r\n }\r\n}", "import { AxCounterWithInput } from \"../../Components/AxInput/AxCounterWithInput\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxProgressBar } from \"../../Limestone/AxProgressBar/AxProgressBar\";\r\nimport { ProgressBar } from \"./ProgressbarGiftCards\";\r\nimport Swal from 'sweetalert2';\r\nimport EXIF from \"exif-js\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { ComponentFunction } from \"@glidejs/glide\";\r\nimport Glide from \"@glidejs/glide\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { Asset } from \"../../Interfaces/Assets/Asset\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport tippy from 'tippy.js';\r\nimport { Console } from \"console\";\r\n\r\ndeclare let Dropzone: any;\r\ndeclare let Cropper: any;\r\n\r\n@ModuleName(\"MainGiftCards\")\r\nexport class MainGiftCards implements AxInit {\r\n private initData: AxGiftCardsInit;\r\n private giftCardObserver: IntersectionObserver;\r\n private dz: Dropzone;\r\n private crop: Cropper;\r\n private addURL: string;\r\n private PostURL: string;\r\n public selectedGIftCardTypeId: number = 0;\r\n private imageOrientation: any = -1;\r\n private instanceInfo;\r\n public giftCardData: any = {\r\n amount: 0,\r\n cropperModel: {\r\n x: null,\r\n y: null,\r\n width: null,\r\n height: null,\r\n rotate: null,\r\n scaleX: null,\r\n scaleY: null,\r\n Resolution: null,\r\n orientation: null\r\n }\r\n };\r\n constructor(\r\n private _I18nHelper = new I18nHelper(),\r\n private _ProgressBarGiftCards = new ProgressBar(),\r\n private _AxProgressBar = new AxProgressBar(),\r\n private _AxInputWithCounter = new AxCounterWithInput(),\r\n private _AxLimestone = new AxLimeStone(),\r\n private amount: number,\r\n protected _RequestHelper = new RequestHelper()\r\n ) {\r\n }\r\n\r\n AxInit(init: AxGiftCardsInit): void {\r\n this.initData = init;\r\n\r\n this.instanceInfo = tippy(document.querySelector('#UploadInfo'), {\r\n content: this._I18nHelper.GetTranslation(Translations.MaximumFileSize).replace(\"{{size}}\", \"7\").replace(\"{{file}}\", \"Image\") + \" \" + this._I18nHelper.GetTranslation(Translations.AcceptableFilesExtention).replace(\"{{filesExtention}}\", \".jpeg, .jpg, .png\"),\r\n placement: 'left',\r\n interactive: true,\r\n trigger: 'manual',\r\n theme: 'material',\r\n\r\n });\r\n\r\n let that = this;\r\n let steps = this._ProgressBarGiftCards.GetGiftCardSteps();\r\n if (this.initData.ProgressBarActiveStep == ProgressBarActiveStepEnum.AmountDesign) {\r\n steps[0].type = \"active\";\r\n } else {\r\n steps[1].type = \"active\";\r\n }\r\n this.addURL = this.initData.addURL;\r\n this.PostURL = this.initData.PostURL;\r\n\r\n this._AxProgressBar.Init({\r\n target: '.GiftCards__progressbar',\r\n steps: steps\r\n });\r\n this._AxInputWithCounter.Init({\r\n target: '.GiftCards__Amount',\r\n incrementValue: this.initData.steps,\r\n minValue: 0,\r\n maxValue: this.initData.upperLimit,\r\n text: this.initData.currency,\r\n onChange: x => {\r\n this.InputValidation();\r\n }\r\n });\r\n\r\n this.InitializeGlider();\r\n\r\n this.AttachOnClickOnGiftCards();\r\n this.AttachChipsClicks();\r\n\r\n $('#GiftCards__UseTemplatesOption').click(x => {\r\n this.instanceInfo.destroy();\r\n this.ChangeTemplates('#GiftCards__UseTemplatesOption');\r\n });\r\n $('#GiftCards__UploadTemplatesOption').click(x => {\r\n this.instanceInfo.show();\r\n this.ChangeTemplates('#GiftCards__UploadTemplatesOption');\r\n });\r\n\r\n $('#BtnContinue').click(x => {\r\n this._AxLimestone.LockButton($('#BtnContinue')[0]);\r\n this.PersonalizeGiftCard();\r\n });\r\n\r\n $('#BtnContinueMob').click(x => {\r\n this._AxLimestone.LockButton($('#BtnContinueMob')[0]);\r\n this.PersonalizeGiftCard();\r\n });\r\n\r\n $('#GiftCards__UploadImgTest').click(x => {\r\n this.PersonalizeGiftCardSave();\r\n });\r\n\r\n $('#GiftCards__Cropper__Save').click(x => {\r\n this.PrepareGiftCardUpload();\r\n });\r\n\r\n $('#GiftCards__Cropper__Cancel').click(x => {\r\n this.CancelCroperEdit();\r\n this.PrepareDropzone();\r\n });\r\n\r\n $('#GiftCard_templateImgEdit').click(x => {\r\n this.CropperEditExistingImg();\r\n });\r\n $('#GiftCard_templateImgDelete').click(x => {\r\n this.instanceInfo.show();\r\n this.CropperDeleteExistingImg();\r\n this.PrepareDropzone();\r\n\r\n });\r\n\r\n this.PrepareDropzone();\r\n\r\n $('.admin_assets__assetUpload_modal').on('hide.bs.modal', function () {\r\n that.dz.removeAllFiles();\r\n }); $('.GiftCard__cropper').on('hide.bs.modal', function () {\r\n event.preventDefault();\r\n });\r\n\r\n this.AttachGiftCardsEmptyActions();\r\n\r\n $('.admin_assets__details_close').click(e => {\r\n this.CloseDetails();\r\n });\r\n\r\n $('#GiftCards__UploadImg').click(e => {\r\n this.UploadImage();\r\n });\r\n\r\n document.getElementById('cropperImageGiftCard').addEventListener('load', () => {\r\n $('.GiftCard__cropper').modal('show');\r\n });\r\n\r\n $('.GiftCard__cropper').on('shown.bs.modal', () => {\r\n this.AttachCropper();\r\n })\r\n this.FixMobileScroll();\r\n this.ToogleMobContinueBtn();\r\n }\r\n\r\n FixMobileScroll() {\r\n $(document).ready(() => {\r\n if (window.screen.width < 992) {\r\n if (!$('body').hasClass('ax-body--top')) {\r\n $('body').addClass('ax-body--top');\r\n window.addEventListener(\"scroll\", x => { this.CheckMobileBtn() });\r\n }\r\n }\r\n });\r\n }\r\n\r\n ToogleMobContinueBtn() {\r\n $(document).ready(() => {\r\n this.giftCardObserver = new IntersectionObserver(\r\n ([e]) => {\r\n if (window.screen.width < 992) {\r\n //without this scroll does not scroll as it should\r\n if (!$('body').hasClass('ax-body--top')) {\r\n $('body').addClass('ax-body--top');\r\n }\r\n window.addEventListener(\"scroll\", x => { this.CheckMobileBtn() });\r\n }\r\n },\r\n { threshold: 1 }\r\n );\r\n this.giftCardObserver.observe(document.querySelector('.GiftCards__progressbar'));\r\n });\r\n }\r\n\r\n CheckMobileBtn() {\r\n let scrollY = window.scrollY;\r\n let screenHeight = window.screen.height;\r\n let heightToShowBtn = $(\".ax-body\").height() - screenHeight;\r\n if ((scrollY) >= heightToShowBtn && window.screen.width < 992) {\r\n if (!$('.prod_selection__summary').hasClass('d-flex')) {\r\n $('.prod_selection__summary').addClass('d-flex');\r\n $('.prod_selection__summary').removeClass('d-none');\r\n }\r\n } else {\r\n $('.prod_selection__summary').removeClass('d-flex');\r\n $('.prod_selection__summary').addClass('d-none');\r\n }\r\n }\r\n\r\n\r\n InputValidation() {\r\n if ($('#GiftCards__amount__value').val() == 0) {\r\n $('#BtnContinue').attr('disabled', 'disabled');\r\n return;\r\n }\r\n const awaitTimeout = delay =>\r\n new Promise(resolve => setTimeout(resolve, delay));\r\n awaitTimeout(200).then(() => {\r\n let oldValue = $('#GiftCards__amount__value').val() as string;\r\n let depositStepSize = this.initData.depositStepSize !== 0 ? this.initData.depositStepSize : 1;\r\n let modulo = parseInt(oldValue) % depositStepSize;\r\n if (modulo !== 0) {\r\n $('.giftcards__amount-invalid').removeClass('d-none');\r\n $('#BtnContinue').prop('disabled', true);\r\n } else {\r\n $('.giftcards__amount-invalid').addClass('d-none');\r\n $('#BtnContinue').prop('disabled', false);\r\n }\r\n this.CheckChipsButtons();\r\n });\r\n }\r\n\r\n InitializeGlider() {\r\n let numberOfTemplates = $('.glide__slides').children().length;\r\n\r\n if (numberOfTemplates > 0) {\r\n let defaultNumberOfTemplates: number = 4;\r\n let glide = new Glide('.glide', {\r\n type: 'slider',\r\n startAt: 0,\r\n perView: defaultNumberOfTemplates,\r\n rewind: false,\r\n bound: true,\r\n animationDuration: 300,\r\n slideWidth: 300,\r\n //focusAt: 'center',\r\n breakpoints: {\r\n 800: {\r\n perView: 2\r\n },\r\n 400: {\r\n perView: 1\r\n }\r\n },\r\n classes: {\r\n disabledArrow: 'glide__arrow--disabled'\r\n },\r\n });\r\n\r\n glide.on('run.before', e => {\r\n //e.steps = e.direction === '>' ? -glide.settings.perView : glide.settings.perView\r\n })\r\n glide.mount({\r\n 'DisableControls': this.updateGlideFunc,\r\n //'setGlideSize': this.setGlideSize\r\n });\r\n }\r\n }\r\n\r\n private updateGlideFunc: ComponentFunction = (glide: Glide.Static, Components: any, Events: any) => {\r\n\r\n const PREV_CONTROL_SELECTOR = \"[data-glide-dir='<']\";\r\n const NEXT_CONTROL_SELECTOR = \"[data-glide-dir='>']\";\r\n const component = {\r\n buildAfter() {\r\n this.prevBtn = Components.Html.root.querySelector(PREV_CONTROL_SELECTOR);\r\n this.nextBtn = Components.Html.root.querySelector(NEXT_CONTROL_SELECTOR);\r\n },\r\n handleDisable() {\r\n const perView = glide.settings.perView;\r\n const slidesCount = Components.Html.slides.length;\r\n\r\n this.prevBtn.disabled = (glide.index <= 0);\r\n this.nextBtn.disabled = (glide.index >= slidesCount - perView);\r\n },\r\n mount() {\r\n }\r\n };\r\n\r\n Events.on(\"build.after\", function () {\r\n component.buildAfter();\r\n component.handleDisable();\r\n });\r\n Events.on(\"run.after\", function () {\r\n component.handleDisable();\r\n });\r\n return component;\r\n }\r\n\r\n AttachOnClickOnGiftCards() {\r\n let giftCardsCount = $('.GiftCardAmount').length;\r\n for (let max = giftCardsCount, i = 0; i < max; i++) {\r\n let elemm: HTMLElement = $('.GiftCardAmount')[i];\r\n let amount = elemm.getElementsByTagName('input')[0].value.toString();\r\n\r\n $(elemm).click(x => {\r\n this.selectAmount(amount);\r\n $(elemm).toggleClass('ax-chip--active');\r\n });\r\n }\r\n }\r\n\r\n AttachChipsClicks() {\r\n $(\".ax-chip\").click(e => {\r\n let newAmount = $(e.target).html().split(\" \");\r\n $(\".ax-chip\").removeClass(\"ax-chip--active\");\r\n $(e.target).addClass(\"ax-chip--active\");\r\n this.selectAmount(newAmount[0]);\r\n });\r\n }\r\n\r\n CheckChipsButtons() {\r\n $(\".ax-chip\").removeClass(\"ax-chip--active\");\r\n let giftCardValue = $(\"#GiftCards__amount__value\").val();\r\n $(\".ax-chip\").each(function (item) {\r\n let chipCardValue = $(this).text().split(\" \")[0];\r\n if (chipCardValue == giftCardValue) {\r\n $(this).addClass(\"ax-chip--active\");\r\n }\r\n });\r\n }\r\n\r\n selectAmount(value: string) {\r\n this._AxInputWithCounter.changeAmount(parseInt(value));\r\n }\r\n\r\n CancelCroperEdit() {\r\n if (this.giftCardData.cropperModel.x === null) {\r\n $('.GiftCard__cropper').modal('hide');\r\n $('#GiftCard_uploadedTemplateImg').toggleClass('d-none');\r\n this.CropperDeleteExistingImg();\r\n this.PrepareDropzone();\r\n } else {\r\n $('.GiftCard__cropper').modal('hide');\r\n $('#GiftCard_uploadedTemplateImg').toggleClass('d-none');\r\n }\r\n }\r\n\r\n CropperDeleteExistingImg() {\r\n $('#GiftCard_uploadedTemplateImg').toggleClass('d-none');\r\n $('#GiftCard__TemplateUploadedImg').children('img').remove();\r\n this.giftCardData = {\r\n amount: 0,\r\n cropperModel: {\r\n x: null,\r\n y: null,\r\n width: null,\r\n height: null,\r\n rotate: null,\r\n scaleX: null,\r\n scaleY: null,\r\n Resolution: null,\r\n orientation: null\r\n }\r\n };\r\n $(\"#GiftCardCropperModel\").val(`${JSON.stringify(this.giftCardData.cropperModel)}`);\r\n this.DestroyCropper();\r\n this.DestroyDropzone();\r\n $('.GiftCard__dZ').show();\r\n }\r\n\r\n CropperEditExistingImg() {\r\n $('#GiftCard_uploadedTemplateImg').toggleClass('d-none');\r\n $('.GiftCard__cropper').modal('show');\r\n }\r\n\r\n PrepareGiftCardUpload() {\r\n console.log('PrepareGiftCardUpload');\r\n $('#GiftCard__TemplateUploadedImg').addClass('w-h-100');\r\n $('#GiftCard__TemplateUploadedImg').children('img').remove();\r\n $('#GiftCard__TemplateUploadedImg').append(\"<img src class='w-100'/>\");\r\n $('#GiftCard__TemplateUploadedImg').children('img').attr('src', this.crop.getCroppedCanvas().toDataURL(\"image/png\"));\r\n $('.GiftCard__cropper').modal('hide');\r\n $('#GiftCard_uploadedTemplateImg').toggleClass('d-none');\r\n $(\"#GiftCardAmount\").val($(\"#GiftCards__amount__value\").val().toString());\r\n let cropData = this.crop.getData();\r\n\r\n\r\n this.giftCardData.cropperModel.x = Math.floor(cropData?.x);\r\n this.giftCardData.cropperModel.y = Math.floor(cropData?.y);\r\n this.giftCardData.cropperModel.width = Math.floor(cropData?.width);\r\n this.giftCardData.cropperModel.height = Math.floor(cropData?.height);\r\n this.giftCardData.cropperModel.rotate = Math.floor(cropData?.rotate);\r\n this.giftCardData.cropperModel.scaleX = Math.floor(cropData?.scaleX);\r\n this.giftCardData.cropperModel.scaleY = Math.floor(cropData?.scaleY);\r\n this.giftCardData.cropperModel.Resolution = null;\r\n this.giftCardData.cropperModel.orientation = null;\r\n\r\n $(\"#GiftCardCropperModel\").val(`${JSON.stringify(this.giftCardData.cropperModel)}`);\r\n }\r\n\r\n AttachGiftCardsEmptyActions() {\r\n let count: number = $('.glide__slides').children().length;\r\n if (count === 1) {\r\n this.ToogleGiftCardsEmpty(1);\r\n } else {\r\n for (let i = 1; i < count + 1; i++) {\r\n let container = '#GiftCards__GiftCardEmpty' + i;\r\n $(container).click(e => {\r\n this.ToogleGiftCardsEmpty(i);\r\n });\r\n }\r\n }\r\n }\r\n\r\n ToogleGiftCardsEmpty(id: any) {\r\n if (this.selectedGIftCardTypeId != 0 && this.selectedGIftCardTypeId != id) {\r\n this.ToogleGiftCardsEmpty(this.selectedGIftCardTypeId);\r\n }\r\n\r\n if (this.selectedGIftCardTypeId == id) {\r\n this.selectedGIftCardTypeId = 0;\r\n } else {\r\n this.selectedGIftCardTypeId = id;\r\n }\r\n let container = '#GiftCards__GiftCardEmpty' + id;\r\n let checkid = '#GiftCards__Check__' + id;\r\n $(container).toggleClass('ax-outline-primary');\r\n $(checkid).toggleClass('d-none');\r\n }\r\n\r\n ChangeTemplates(selectedElementId: string) {\r\n let isSelected = this.IsTemplateOptionSelected(selectedElementId);\r\n\r\n if (!isSelected) {\r\n $('#GiftCards__UploadTemplatesOption').toggleClass(\"active\");\r\n $('#GiftCards__UseTemplatesOption').toggleClass(\"active\");\r\n $('#GiftCards__UseTemplates').toggleClass(\"d-none\");\r\n $('#GiftCards__UploadTemplates').toggleClass(\"d-none\");\r\n }\r\n }\r\n\r\n IsTemplateOptionSelected(optionId: string): boolean {\r\n let isSelected: boolean = false;\r\n if ($(optionId).hasClass(\" ax-border-gray-900\")) {\r\n isSelected = true;\r\n }\r\n return isSelected;\r\n }\r\n EnableBtnContinue() {\r\n this._AxLimestone.UnlockButton($('#BtnContinue')[0]);\r\n }\r\n\r\n PersonalizeGiftCard() {\r\n if ($('#GiftCards__UseTemplates').length !== 0 && !$('#GiftCards__UseTemplates').hasClass('d-none')) {\r\n if (this.selectedGIftCardTypeId == 0) {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Error),\r\n icon: 'warning',\r\n html: this._I18nHelper.GetTranslation(Translations.PleaseSelectGiftCardTemplate)\r\n }).then(() => {\r\n this._AxLimestone.UnlockButton($('#BtnContinue')[0]);\r\n this._AxLimestone.UnlockButton($('#BtnContinueMob')[0]);\r\n });\r\n } else {\r\n this.Personalize(\"\");\r\n }\r\n } else {\r\n if (!$('#GiftCard_uploadedTemplateImg').hasClass('d-none')) {\r\n this.dz.processQueue();\r\n } else {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Error),\r\n icon: 'warning',\r\n html: this._I18nHelper.GetTranslation(Translations.PleaseSelectGiftCardTemplate)\r\n }).then(() => {\r\n this._AxLimestone.UnlockButton($('#BtnContinue')[0]);\r\n this._AxLimestone.UnlockButton($('#BtnContinueMob')[0]);\r\n });\r\n }\r\n }\r\n }\r\n\r\n\r\n PersonalizeGiftCardSave() {\r\n let url = $(\"#GiftCards__IndexContinue\").val().toString();\r\n let amount = $(\"#GiftCards__amount__value\").val().toString();\r\n url = url.replace('_amount', amount);\r\n url = url.replace('_cropperModel', JSON.stringify(this.crop.getData()));\r\n alert(url);\r\n }\r\n\r\n populateSubmitDropzoneForm(formData) {\r\n formData.append(\"amount\", this.amount);\r\n formData.append(\"x\", this.giftCardData.cropperModel.x.toString());\r\n formData.append(\"y\", this.giftCardData.cropperModel.y.toString());\r\n formData.append(\"width\", this.giftCardData.cropperModel.width.toString());\r\n formData.append(\"height\", this.giftCardData.cropperModel.height.toString());\r\n formData.append(\"rotate\", this.giftCardData.cropperModel.rotate.toString());\r\n formData.append(\"scaleX\", this.giftCardData.cropperModel.scaleX.toString());\r\n formData.append(\"scaleY\", this.giftCardData.cropperModel.scaleY.toString());\r\n formData.append(\"Resolution\", null);\r\n formData.append(\"orientation\", this.imageOrientation);\r\n }\r\n\r\n PrepareDropzone() {\r\n let that = this;\r\n this.DestroyDropzone();\r\n this.DestroyCropper();\r\n\r\n $('.GiftCard__dZ').dropzone({\r\n url: this.addURL,\r\n autoProcessQueue: false,\r\n maxFiles: 1,\r\n maxFilesize: 7,\r\n acceptedFiles: \".jpeg,.jpg,.png\",\r\n sending: function (file, xhr, formData) {\r\n formData.append(\"amount\", $(\"#GiftCardAmount\").val().toString());\r\n formData.append(\"x\", (that.giftCardData.cropperModel === undefined) ? null : `${that.giftCardData.cropperModel.x}`);\r\n formData.append(\"y\", that.giftCardData.cropperModel?.y.toString());\r\n formData.append(\"width\", that.giftCardData.cropperModel?.width.toString());\r\n formData.append(\"height\", that.giftCardData.cropperModel?.height.toString());\r\n formData.append(\"rotate\", that.giftCardData.cropperModel?.rotate.toString());\r\n formData.append(\"scaleX\", that.giftCardData.cropperModel?.scaleX.toString());\r\n formData.append(\"scaleY\", that.giftCardData.cropperModel?.scaleY.toString());\r\n formData.append(\"Resolution\", null);\r\n formData.append(\"orientation\", that.imageOrientation);\r\n },\r\n accept: function (file, done) {\r\n this.dz = this;\r\n let filework: any;\r\n filework = file;\r\n done();\r\n that.showCropperUploadGiftCard(filework);\r\n },\r\n success: (file, resp) => {\r\n if (resp.data != \"\") {\r\n this.Personalize(resp.data);\r\n }\r\n\r\n },\r\n error: (errFile) => {\r\n let filesize = Math.round(100 * errFile.size / Math.pow(1024, 2)) / 100;\r\n let acceptedFiles = [\"jpeg\", \"jpg\", \"png\"]\r\n if (filesize > 7) {\r\n const size_instance = tippy(document.querySelector('.GiftCard__dZ'), {\r\n content: this._I18nHelper.GetTranslation(Translations.DrpZneFileTooBig).replace(\"{{filesize}}\", filesize.toString()).replace(\"{{maxFilesize}}\", \"7\"),\r\n placement: 'left',\r\n trigger: 'manual',\r\n interactive: true,\r\n theme: 'material',\r\n\r\n });\r\n size_instance.show();\r\n }\r\n else if (!acceptedFiles.includes(errFile.name.split(\".\").pop())) {\r\n const type_instance = tippy(document.querySelector('.GiftCard__dZ'), {\r\n content: this._I18nHelper.GetTranslation(Translations.AcceptableFilesExtention).replace(\"{{filesExtention}}\", \".jpeg, .jpg, .png\"),\r\n allowHTML: true,\r\n placement: 'right',\r\n trigger: 'manual',\r\n interactive: true,\r\n theme: 'material',\r\n\r\n });\r\n type_instance.show();\r\n }\r\n\r\n this.PrepareDropzone();\r\n }\r\n\r\n });\r\n this.dz = Dropzone.instances[0];\r\n $(\".dz-default.dz-message\").toggleClass('d-none');\r\n }\r\n\r\n Personalize(imageName: string) {\r\n let url = $(\"#GiftCards__IndexContinue\").val().toString();\r\n let amount = this._AxInputWithCounter.getAmount();\r\n url = url.replace('_amount', amount);\r\n\r\n url = url.replace('_imageName', imageName);\r\n url = url.replace('_selectedTemplate', this.selectedGIftCardTypeId.toString());\r\n\r\n let requestObj = {\r\n retailItemNr: this.initData.retailItemNr,\r\n amount: amount,\r\n imageName: imageName,\r\n selectedTemplate: this.selectedGIftCardTypeId\r\n };\r\n this._RequestHelper.postToUrl(this.PostURL, requestObj, {});\r\n }\r\n\r\n showCropperUploadGiftCard(fileToWorkWith) {\r\n $('.GiftCard__dZ').hide();\r\n let that = this;\r\n EXIF.getData(fileToWorkWith, function () {\r\n try {\r\n let allTags = EXIF.getAllTags(this);\r\n //console.log(allTags);\r\n if (\"Orientation\" in allTags) {\r\n that.imageOrientation = EXIF.getTag(this, \"Orientation\");\r\n }\r\n }\r\n catch (e) {\r\n that.imageOrientation = -2;\r\n console.log(\"Error get Orientation from EXIF data: \" + e.message);\r\n }\r\n });\r\n $('#cropperImageGiftCard').attr('src', URL.createObjectURL(this.dz.files[0]));\r\n }\r\n\r\n AttachCropper() {\r\n if (this.crop) return;\r\n let img: HTMLElement = document.getElementById('cropperImageGiftCard');\r\n\r\n this.crop = new Cropper(img, {\r\n aspectRatio: 1200 / 675,\r\n viewMode: 2,\r\n zoomable: false,\r\n cropBoxMovable: true,\r\n dragMode: 'none',\r\n scalable: false,\r\n crop(event) {\r\n }\r\n });\r\n }\r\n\r\n DestroyDropzone() {\r\n if (this.dz != null) {\r\n this.dz.destroy();\r\n }\r\n }\r\n\r\n DestroyCropper() {\r\n if (this.crop) {\r\n this.crop.destroy();\r\n $('#cropperImage').attr('src', '');\r\n $('.admin_assets__assetUpload_dZ').show();\r\n this.crop = null;\r\n }\r\n }\r\n ClearCropper() {\r\n if (this.crop) {\r\n this.crop.clear();\r\n }\r\n }\r\n\r\n UploadImage() {\r\n this.dz.processQueue();\r\n }\r\n\r\n AssetDetails(asset: Asset) {\r\n $('.admin_assets__wrapper').addClass('d-none');\r\n $('.admin_assets__details_Title').html(asset.FileName);\r\n $('.admin_assets__details_UID').html(asset.UID);\r\n $('.admin_assets__details_FileSize').html(asset.FileSize);\r\n $('.admin_assets__details_Resolution').html(asset.Resolution);\r\n $('.admin_assets__details_Type').html(asset.MimeType);\r\n $('.admin_assets__details_Created').html(asset.Created);\r\n $('.admin_assets__details_Updated').html(asset.Created);\r\n\r\n $('.admin_assets__details_Link').html(asset.Link).attr('href', asset.Link);\r\n $('.admin_assets__details_imageHolder img').attr('src', asset.Link);\r\n //this.currentAssetID = asset.AssetID;\r\n\r\n $('.admin_assets__overlay').removeClass('d-none');\r\n }\r\n\r\n CloseDetails() {\r\n $('.admin_assets__wrapper').removeClass('d-none');\r\n $('.admin_assets__overlay').addClass('d-none');\r\n this.DestroyCropper();\r\n //this.currentAssetID = 0;\r\n }\r\n}\r\n\r\nexport interface AxGiftCardsInit {\r\n ProgressBarActiveStep: ProgressBarActiveStepEnum;\r\n addURL: string;\r\n PostURL: string;\r\n getTemplateURL: string;\r\n CartURL: string;\r\n steps: number;\r\n upperLimit: number;\r\n retailItemNr: number;\r\n currency: string;\r\n depositStepSize: number;\r\n}\r\n\r\nexport enum ProgressBarActiveStepEnum {\r\n AmountDesign = 0,\r\n Personalize = 1\r\n}\r\n", "import Swal from \"sweetalert2\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { AxProgressBar } from \"../../Limestone/AxProgressBar/AxProgressBar\";\r\nimport { ProgressBarActiveStepEnum } from \"./MainGiftCards\";\r\nimport { ProgressBar } from \"./ProgressbarGiftCards\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { PriceHelper } from \"../../Lib/Helper/PriceHelper\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\n\r\n@ModuleName(\"PersonalizeGiftCard\")\r\nexport class PersonalizeGiftCard implements AxInit {\r\n private initData: AxGiftCardsPersonalizeInit;\r\n public selectedGIftCardTypeId: number = 0;\r\n public PostUrl: string;\r\n private validationError: string;\r\n public priceHelper: PriceHelper;\r\n private quantityPicker: AxDropdown = new AxDropdown();\r\n\r\n constructor(\r\n private _ProgressBarGiftCards = new ProgressBar(),\r\n private _AxProgressBar = new AxProgressBar(),\r\n private _AxLimestone = new AxLimeStone(),\r\n private _I18nHelper = new I18nHelper(),\r\n ) { }\r\n\r\n AxInit(init: AxGiftCardsPersonalizeInit): void {\r\n this.initData = init;\r\n this.PostUrl = init.PostURL;\r\n this.priceHelper = new PriceHelper(init.CultureInfo, false);\r\n\r\n this.quantityPicker.init('#GiftCard__Quantity',\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent, value) => {\r\n let quantity = parseInt(value as string);\r\n $('.giftCards__personalization-count').html(value as string);\r\n $('.giftcard__priceholder').html(this.priceHelper.GetPriceString(this.initData.Amount * quantity / 100));\r\n }\r\n });\r\n\r\n\r\n let steps = this._ProgressBarGiftCards.GetGiftCardSteps();\r\n if (this.initData.ProgressBarActiveStep == ProgressBarActiveStepEnum.AmountDesign) {\r\n steps[0].type = \"active\";\r\n } else {\r\n steps[0].type = \"done\";\r\n steps[1].type = \"active\";\r\n }\r\n this._AxProgressBar.Init({\r\n target: '.GiftCards__progressbar',\r\n steps: steps\r\n });\r\n this.AppendClickActions();\r\n this.AppendGiftCardMessageValidator();\r\n\r\n $('.giftcard__priceholder').html(this.priceHelper.GetPriceString(this.initData.Amount / 100));\r\n }\r\n\r\n AddToCart() {\r\n let quantity: string = this.quantityPicker.getValue() as string;\r\n let retailItemNr: string = $(\"#GiftCard__RetailItemNr\").val().toString();\r\n let tariff: string = $(\"#GiftCard__Tariff\").val().toString();\r\n let giftCard = {\r\n Email: $(\"#GiftCard__Email\").val(),\r\n From: $(\"#GiftCard__From\").val(),\r\n To: $(\"#GiftCard__To\").val(),\r\n Message: $(\"#GiftCard__Message\").val(),\r\n ImageLocation: this.initData.HeaderImageLocation,\r\n Quantity: parseInt(quantity),\r\n Tariff: parseFloat(tariff),\r\n RetailItemNr: parseInt(retailItemNr),\r\n };\r\n if (this.ValidateGiftCardInputs()) {\r\n AxessViewer.loadPartialView(this.initData.PostURL, giftCard, (result) => {\r\n if (result.success) {\r\n AxLoad.LoadModule('AxFireShoppingCartModal', {\r\n result: result,\r\n continueShoppingPath: 'GiftCards',\r\n btn: '.GiftCardPersonalize__AddToCart',\r\n ResetQuantity: null\r\n });\r\n }\r\n this.UnLockButtons();\r\n }, {\r\n silent: true,\r\n });\r\n }\r\n else {\r\n this.ShowErrorPopup();\r\n }\r\n }\r\n\r\n ShowErrorPopup() {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Error),\r\n icon: 'warning',\r\n html: this.validationError\r\n }).then(() => {\r\n this.UnLockButtons();\r\n });\r\n }\r\n\r\n UnLockButtons() {\r\n let btnContinueMobile = $(\".GiftCardPersonalize__AddToCart\").last() as unknown as HTMLElement;\r\n let btnContinueDesktop = $(\".GiftCardPersonalize__AddToCart\").first() as unknown as HTMLElement;\r\n let btnGoBackMobile = $(\".GiftCardPersonalize__AddToCart\").last() as unknown as HTMLElement;\r\n let btnGoBackDesktop = $(\".GiftCardPersonalize__AddToCart\").first() as unknown as HTMLElement;\r\n this._AxLimestone.UnlockButton(btnContinueMobile);\r\n this._AxLimestone.UnlockButton(btnGoBackMobile);\r\n this._AxLimestone.UnlockButton(btnContinueDesktop);\r\n this._AxLimestone.UnlockButton(btnGoBackDesktop);\r\n }\r\n\r\n LockButtons() {\r\n let btnContinueMobile = $(\".GiftCardPersonalize__AddToCart\").last() as unknown as HTMLElement;\r\n let btnContinueDesktop = $(\".GiftCardPersonalize__AddToCart\").first() as unknown as HTMLElement;\r\n let btnGoBackMobile = $(\".GiftCardPersonalize__AddToCart\").last() as unknown as HTMLElement;\r\n let btnGoBackDesktop = $(\".GiftCardPersonalize__AddToCart\").first() as unknown as HTMLElement;\r\n this._AxLimestone.LockButton(btnContinueMobile);\r\n this._AxLimestone.LockButton(btnGoBackMobile);\r\n this._AxLimestone.LockButton(btnContinueDesktop);\r\n this._AxLimestone.LockButton(btnGoBackDesktop);\r\n }\r\n\r\n ValidateGiftCardInputs(): boolean {\r\n let success = true;\r\n let recipientEmail = $(\"#GiftCard__Email\").val().toString();\r\n let from = $(\"#GiftCard__From\").val().toString();\r\n let to = $(\"#GiftCard__To\").val().toString();\r\n let message = $(\"#GiftCard__Message\").val().toString();\r\n this.validationError = \"\";\r\n if (!this.ValidateEmail(recipientEmail)) {\r\n this.validationError += this._I18nHelper.GetTranslation(Translations.ValidationMail) + '<br />';\r\n success = false;\r\n }\r\n if (from.length == 0) {\r\n let fromStr = this._I18nHelper.GetTranslation(Translations.From);\r\n this.validationError += this._I18nHelper.GetTranslation(Translations.FeldErforderlich, fromStr) + '<br />';\r\n success = false;\r\n }\r\n if (to.length == 0) {\r\n let toStr = this._I18nHelper.GetTranslation(Translations.To);\r\n this.validationError += this._I18nHelper.GetTranslation(Translations.FeldErforderlich, toStr) + '<br />';\r\n success = false;\r\n }\r\n if (message.length == 0) {\r\n let messageStr = this._I18nHelper.GetTranslation(Translations.Message);\r\n this.validationError += this._I18nHelper.GetTranslation(Translations.FeldErforderlich, messageStr) + '<br />';\r\n success = false;\r\n }\r\n return success;\r\n }\r\n\r\n ValidateEmail(email) {\r\n const re = new RegExp(\"([!#-'*+/-9=?A-Z^-~-]+(\\.[!#-'*+/-9=?A-Z^-~-]+)*|\\\"\\(\\[\\]!#-[^-~ \\t]|(\\\\[\\t -~]))+\\\")@([!#-'*+/-9=?A-Z^-~-]+(\\.[!#-'*+/-9=?A-Z^-~-]+)*|\\[[\\t -Z^-~]*])\");\r\n return re.test(String(email).toLowerCase());\r\n }\r\n\r\n AppendClickActions() {\r\n $('.GiftCardPersonalize__AddToCart').click(x => {\r\n this.LockButtons();\r\n this.AddToCart();\r\n });\r\n }\r\n\r\n AppendGiftCardMessageValidator() {\r\n $('#GiftCard__Message').val(\"\");\r\n const maxLength = 500;\r\n let oldLength = 0;\r\n let oldString = \"\";\r\n $(\".giftCard_areaCounter\").html(`0/${maxLength}`);\r\n $('#GiftCard__Message').keydown(x => {\r\n oldLength = $('#GiftCard__Message').val().toString().length;\r\n oldString = $('#GiftCard__Message').val().toString();\r\n if (oldLength == maxLength && (x.keyCode != 8 && x.keyCode != 46)) {\r\n x.preventDefault();\r\n return false;\r\n }\r\n });\r\n $('#GiftCard__Message').keyup(x => {\r\n let currentLength = $('#GiftCard__Message').val().toString().length;\r\n //workaround for paste\r\n if (currentLength > maxLength) {\r\n $('#GiftCard__Message').val(oldString);\r\n currentLength = $('#GiftCard__Message').val().toString().length;\r\n }\r\n $(\".giftCard_areaCounter\").html(`${currentLength}/${maxLength}`);\r\n });\r\n }\r\n\r\n}\r\nexport interface AxGiftCardsPersonalizeInit {\r\n ProgressBarActiveStep: ProgressBarActiveStepEnum;\r\n PostURL: string;\r\n HeaderImageLocation: string;\r\n CultureInfo: any;\r\n Amount: number\r\n}", "import { CultureInfo } from \"../../Models/Culture/CultureInfo\";\r\nimport { AxLoad } from \"../AxSystem/AxLoad\";\r\nimport { LocalizationModule } from \"../../Modules/Global/LocalizationModule\";\r\nimport { ConfigDefinition, ConfigHelper } from \"./Config/ConfigHelper\";\r\n\r\nexport class PriceHelper {\r\n cultureInfo: CultureInfo;\r\n private localizationModule: LocalizationModule;\r\n private usedCurrencySymbol: string;\r\n\r\n constructor(cultureInfo: CultureInfo, checkCurrencySymbolConfig: boolean) {\r\n this.localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n\r\n if (cultureInfo == null || cultureInfo == undefined) {\r\n this.cultureInfo = this.localizationModule.getCultureInfo();\r\n } else {\r\n this.cultureInfo = cultureInfo;\r\n }\r\n\r\n this.usedCurrencySymbol = this.cultureInfo.CurrencySymbol;\r\n\r\n if (checkCurrencySymbolConfig) {\r\n ConfigHelper.getBoolConfigValue(ConfigDefinition.StoreCurrencyWebUseIsoSymbol, (currencyWebUseIsoSymbol) => {\r\n if (currencyWebUseIsoSymbol) {\r\n this.usedCurrencySymbol = this.cultureInfo.CurrencySymbol;\r\n } else {\r\n this.usedCurrencySymbol = this.cultureInfo.CurrencyName;\r\n }\r\n });\r\n }\r\n }\r\n\r\n GetPriceStringWithDecimalDivisorCalced(totalAmount: number): string {\r\n const calculatedPrice: number = totalAmount / this.localizationModule.getPriceToDecimalDivisor();\r\n\r\n const priceString = $.number(calculatedPrice,\r\n this.cultureInfo.currencyDecimalDigits,\r\n this.cultureInfo.currencyDecimalSeparator,\r\n this.cultureInfo.currencyGroupSeparator);\r\n\r\n return priceString;\r\n }\r\n\r\n GetPriceString(totalAmount: number) {\r\n return $.number(totalAmount,\r\n this.cultureInfo.currencyDecimalDigits,\r\n this.cultureInfo.currencyDecimalSeparator,\r\n this.cultureInfo.currencyGroupSeparator);\r\n }\r\n\r\n GetPriceStringWithCurrencySymbol(totalAmount: number): string {\r\n let currencyString = `${this.cultureInfo.CurrencyPosition == 0 ? this.usedCurrencySymbol : ''}${this.GetPriceString(totalAmount)}${this.cultureInfo.CurrencyPosition == 1\r\n ? this.usedCurrencySymbol\r\n : ''}`;\r\n\r\n return currencyString;\r\n }\r\n\r\n GetPrice(price: number): number {\r\n return price / 100;\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxFormValidation, AxInput } from \"@axess/limestone\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport Swal from 'sweetalert2/dist/sweetalert2.js'\r\n\r\n@ModuleName(\"PasswordValidation\")\r\nexport class PasswordValidation implements AxInit {\r\n constructor(private _I18nHelper = new I18nHelper(),\r\n private _requestHelper = new RequestHelper()) { }\r\n\r\n AxInit(): void {\r\n new AxInput('#password').init();\r\n\r\n //LoginForm\r\n new AxFormValidation({\r\n selector: '#formReset',\r\n rules: {\r\n password: {\r\n required: true,\r\n pwcheck: true,\r\n minlength: 8,\r\n },\r\n PasswordConfirm: {\r\n required: true,\r\n equalTo: \"#password\"\r\n },\r\n },\r\n callback: () => {\r\n this.resetPw();\r\n }\r\n }).init();\r\n }\r\n \r\n resetPw() {\r\n let baseForm = this._requestHelper.objectifyForm($('#formReset').serializeArray());\r\n\r\n return AxessViewer.loadPartialView('/Account/LoginReset', baseForm, (resp) => {\r\n if (resp.success == true) {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Success),\r\n text: resp['message'],\r\n icon: 'success',\r\n confirmButtonText: 'Ok'\r\n }).then((result) => {\r\n window.location.replace('/Home');\r\n });\r\n } else {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Error),\r\n text: resp['message'],\r\n icon: 'error',\r\n confirmButtonText: 'OK'\r\n })\r\n }\r\n }, { silent: true });\r\n }\r\n}\r\n", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { I18nHelper, Translations } from '../../Lib/Helper/I18nHelper';\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport swal from 'sweetalert2';\r\nimport EXIF from \"exif-js\";\r\nimport { AccountRentalData, AccountRentalDataInitData } from \"../Account/AccountRentalData\";\r\nimport { IAxBirthDateInitData } from \"../Global/AxBirthDateInputTriple\";\r\nimport { CustomerLessonProperties, InitCustomerProps } from \"../Account/CustomerLessonProperties\";\r\n\r\ndeclare let Dropzone: Dropzone;\r\n\r\n@ModuleName(\"MyFamily\")\r\nexport class MyFamily implements AxInit {\r\n public AxLoading: AxLoading;\r\n private familyMembers: IFamilyMember[];\r\n private ticketImgBase64: string;\r\n private ticketDropzone: Dropzone;\r\n private cropper: Cropper;\r\n\r\n private _accountRentalData: AccountRentalData = new AccountRentalData();\r\n private _customerLessonProps: CustomerLessonProperties = new CustomerLessonProperties();\r\n private lessonPropsParentId: string;\r\n private rentalParentId: string;\r\n private ciDatePattern: string;\r\n\r\n private activeDeleteModalAccountNo: number;\r\n private activeEditModalAccountNo: number;\r\n private tempFamImageSrc: string;\r\n\r\n private dobSettings: IAxBirthDateInitData;\r\n\r\n constructor(private i18nHelper = new I18nHelper()) { }\r\n\r\n AxInit(init: IMyFamilyData): void {\r\n this.familyMembers = init.famMembers;\r\n this.AxLoading = new AxLoading();\r\n this.rentalParentId = init.parentId;\r\n this.ciDatePattern = init.ciDatePattern;\r\n this.dobSettings = init.dobInit;\r\n this.lessonPropsParentId = init.lessonPropsParentId;\r\n this._customerLessonProps.AxInit(new InitCustomerProps(init.lessonPropsParentId, \"\"));\r\n\r\n if (window.location.hash != '') {\r\n $('a[href=\"' + window.location.hash + '\"]').tab('show');\r\n }\r\n\r\n this.initTicketDropzone();\r\n this.initFamilyMemberCardButtonEvents();\r\n this.initFamilyMemberEditModalOnShowEvents();\r\n this.initDeleteMemberModalEvents();\r\n\r\n $('#imageFamTicket_update_modal').on('hidden.bs.modal', () => {\r\n this.userImageFamTicketBack();\r\n });\r\n\r\n $('#family_edit_modal').on('hidden.bs.modal', () => {\r\n this.resetTempFamImageSrc();\r\n });\r\n }\r\n\r\n // initFamilyMemberCardButtonEvents\r\n initFamilyMemberCardButtonEvents() {\r\n $('.Delete_member').click((e) => {\r\n this.activeDeleteModalAccountNo = parseInt($(e.delegateTarget).attr('member-data'));\r\n $('#FamMember_delete_modal').modal('show');\r\n });\r\n }\r\n\r\n // initFamilyMemberEditModalOnShowEvents\r\n initFamilyMemberEditModalOnShowEvents() {\r\n $('.family_edit_modal').on('show.bs.modal', (e) => {\r\n this.initPartialEvents(e);\r\n });\r\n }\r\n\r\n // initDeleteMemberModalEvents\r\n initDeleteMemberModalEvents() {\r\n $('.FamMember_delete_modal_cancel').click((e) => {\r\n $('#FamMember_delete_modal').modal('hide');\r\n });\r\n\r\n $('.FamMember_delete_modal_delete').click((e) => {\r\n this.deleteFamMember(this.activeDeleteModalAccountNo);\r\n });\r\n }\r\n\r\n // initTicketDropZoneAfterSuccessEvents\r\n initTicketDropZoneAfterAcceptEvents() {\r\n $('.profile__family_ticket-back').click((e) => {\r\n this.userImageFamTicketBack();\r\n });\r\n\r\n $('.profile__family_ticket-send').click((e) => {\r\n this.sendFamTicketDropzone();\r\n });\r\n }\r\n\r\n // initPartialEvents\r\n initPartialEvents(e: any) {\r\n let $target = $(e.delegateTarget);\r\n\r\n let accNr = $target.attr('data-customerAccNr');\r\n let onSubmitAction = $target.attr('data-onsubmitaction') ?? true;\r\n this.AxLoading.ShowLoadingIndicator($target.find('.family_edit_modal_formholder')[0]);\r\n\r\n AxessViewer.loadPartialView('/Profile/GetEditFamilyMemberFormPartial', { familyMemberAccountNo: accNr, onSubmitAction: onSubmitAction }, (result) => {\r\n this.activeEditModalAccountNo = parseInt(accNr);\r\n $(e.delegateTarget).find('.family_edit_modal_formholder').html(result);\r\n this.initFormPartialEvents(e);\r\n }, { dataType: 'html' });\r\n }\r\n\r\n // initFormPartialEvents\r\n initFormPartialEvents(event: any) {\r\n this._accountRentalData.AxInit(new AccountRentalDataInitData(this.rentalParentId));\r\n this._customerLessonProps.AxInit(new InitCustomerProps(this.lessonPropsParentId, \"\"));\r\n\r\n if (this.familyMembers != undefined) {\r\n this.setFamilyMemberTicketImageInPartial();\r\n }\r\n\r\n this.dobSettings.parentId = `#${event.delegateTarget.id}`;\r\n this.dobSettings.outputTarget = `input[name=DateOfBirthCi]`;\r\n this.dobSettings.setBirthDate = $(event.delegateTarget).find('input[name=DateOfBirthCi]').val() as string;\r\n AxLoad.LoadModule('AxBirthDateInputTriple', this.dobSettings);\r\n\r\n this.AxLoading.HideLoadingIndicator($(event.delegateTarget).find('.family_edit_modal_formholder')[0]);\r\n\r\n $('.profile__family_ticket-open').click((x) => {\r\n this.openImageFamTicketUpload();\r\n });\r\n }\r\n\r\n // openImageFamTicketUpload\r\n openImageFamTicketUpload() {\r\n $('#family_edit_modal_' + this.activeEditModalAccountNo).modal('hide');\r\n\r\n $('#imageFamTicket_update_modal').modal({\r\n backdrop: 'static',\r\n });\r\n }\r\n\r\n // setFamilyMemberTicketImageInPartial\r\n setFamilyMemberTicketImageInPartial() {\r\n let famMember = this.getFamilyMemberByAccNo(this.activeEditModalAccountNo);\r\n\r\n if (famMember != null && typeof famMember.productImagePath != 'undefined') {\r\n\r\n $('#imageFamTicket_update_modal #personProjNr').val(famMember.personProjNr);\r\n $('#imageFamTicket_update_modal #personPosNr').val(famMember.personPosNr);\r\n $('#imageFamTicket_update_modal #personNr').val(famMember.personNr);\r\n\r\n $('#imageFamTicket_update_modal .user_image_holder img').attr('src', famMember.productImagePath);\r\n $('#famMemImage').attr(\"src\", famMember.productImagePath);\r\n\r\n } else {\r\n console.error('setFamilyMemberTicketImageInPartial: famMember null');\r\n }\r\n\r\n if (!this.tempFamImageSrc) {\r\n $('#famMemImage').attr(\"src\", this.tempFamImageSrc);\r\n }\r\n\r\n $('#imageFamTicket_update_modal .user_image_holder').removeClass('kt-hidden');\r\n }\r\n\r\n // deleteFamMember\r\n deleteFamMember(accNo: number) {\r\n AxessViewer.loadPartialView('/ProfileSettings/DeleteFamilyMember', { number: accNo }, () => { }, { reload: true });\r\n }\r\n\r\n // sendFamTicketDropzone\r\n sendFamTicketDropzone() {\r\n $('#ticketImgBase64').val(this.ticketImgBase64);\r\n this.ticketDropzone[0].dropzone.processQueue();\r\n }\r\n\r\n // userImageFamTicketBack\r\n userImageFamTicketBack() {\r\n $('.imageFamTicket-upload-2').css('display', 'none');\r\n $('.imageFamTicket-upload-1').css('display', 'block');\r\n $('#imageFamTicket_update_modal').modal('hide');\r\n $('#family_edit_modal_' + this.activeEditModalAccountNo).modal('show');\r\n this.cropper.destroy();\r\n this.ticketDropzone[0].dropzone.removeAllFiles(true);\r\n }\r\n\r\n // getFamilyMemberByAccNo\r\n getFamilyMemberByAccNo(accNo: number): IFamilyMember {\r\n let famMem = this.familyMembers.find(x => x.cNr === accNo);\r\n return famMem;\r\n }\r\n\r\n // resetTempFamImageSrc\r\n resetTempFamImageSrc() {\r\n this.tempFamImageSrc = '';\r\n }\r\n\r\n resetFamilyMemberForm() {\r\n $('#EditFirstName').val(\"\");\r\n $('#EditLastName').val(\"\");\r\n $('#EditDayOfBirth').val(\"\");\r\n $('#EditEmail').val(\"\");\r\n $('#famMemImage').attr(\"src\", `/Images/pers/placeholder1.png`);\r\n $('#EditPersonProjNr').val(\"\");\r\n $('#EditPersonPosNr').val(\"\");\r\n $('#EditPersonNr').val(\"\");\r\n this._accountRentalData.resetDropdowns();\r\n }\r\n\r\n initTicketDropzone() {\r\n this.ticketDropzone = $('#AvatarFamTicketUploadForm').dropzone({\r\n paramName: \"AvatarFamTicketUploadForm\",\r\n maxFilesize: 10,\r\n uploadMultiple: false,\r\n maxFiles: 1,\r\n acceptedFiles: 'image/*',\r\n autoProcessQueue: false,\r\n thumbnailWidth: 138,\r\n thumbnailHeight: 171,\r\n init: () => { },\r\n sending: (file, xhr, formData) => {\r\n $('#imageFamTicket_update_modal_body').addClass('loading');\r\n },\r\n accept: (file, done) => {\r\n this.initTicketDropZoneAfterAcceptEvents();\r\n\r\n // @ts-ignore\r\n EXIF.getData(file, () => {\r\n let allMetaData = EXIF.getAllTags(this);\r\n $('#imageFamTicketOrientation').val(allMetaData.Orientation);\r\n $('#editimageorientation').val(allMetaData.Orientation);\r\n\r\n const reader = new FileReader();\r\n reader.onload = (event) => {\r\n this.ticketImgBase64 = (event.target.result as string).split('base64,')[1];\r\n\r\n $('#imageFamTicket').attr('src', event.target.result as string);\r\n\r\n $('#famMemImage').attr('src', event.target.result as string);\r\n\r\n let imageFamTicket = document.getElementById('imageFamTicket') as HTMLImageElement;\r\n\r\n // @ts-ignore\r\n this.cropper = new Cropper(imageFamTicket, {\r\n aspectRatio: 138 / 171,\r\n zoomable: false,\r\n viewMode: 2,\r\n crop: (event) => {\r\n let y = event.detail.y;\r\n if (y < 0) {\r\n y = 0;\r\n }\r\n $('#imageFamTicketPosX').val(Math.round(event.detail.x));\r\n $('#imageFamTicketPosY').val(Math.round(y));\r\n $('#imageFamTicketSizeX').val(Math.round(event.detail.width));\r\n $('#imageFamTicketSizeY').val(Math.round(event.detail.height));\r\n $('#editimageposx').val(Math.round(event.detail.x));\r\n $('#editimageposy').val(Math.round(y));\r\n $('#editimagesizex').val(Math.round(event.detail.width));\r\n $('#editimagesizey').val(Math.round(event.detail.height));\r\n },\r\n });\r\n\r\n $('.imageFamTicket-upload-1').css('display', 'none');\r\n $('.imageFamTicket-upload-2').css('display', 'block');\r\n };\r\n reader.readAsDataURL(file);\r\n done();\r\n });\r\n },\r\n success: (file, resp) => {\r\n if (resp[\"error\"] === false) {\r\n swal.fire({\r\n title: this.i18nHelper.GetTranslation(Translations.Success) + '!',\r\n icon: 'success',\r\n text: resp['message'],\r\n confirmButtonText: 'Ok'\r\n }).then((result) => {\r\n $('.m-content > .alert-danger').remove();\r\n location.reload();\r\n });\r\n\r\n } else {\r\n swal.fire({\r\n title: this.i18nHelper.GetTranslation(Translations.Error) + '!',\r\n text: resp['message'],\r\n icon: 'error',\r\n confirmButtonText: 'OK'\r\n });\r\n }\r\n }\r\n });\r\n }\r\n}\r\n\r\ninterface IMyFamilyData {\r\n parentId: string;\r\n famMembers: IFamilyMember[];\r\n ciDatePattern: string;\r\n lessonPropsParentId: string;\r\n dobInit: IAxBirthDateInitData;\r\n}\r\n\r\ninterface IFamilyMember {\r\n cNr: number;\r\n firstName: string;\r\n lastname: string;\r\n dateofbirth: string;\r\n mail: string;\r\n imagePath: string;\r\n productImagePath: string;\r\n personProjNr: number;\r\n personPosNr: number;\r\n personNr: number;\r\n weight: number;\r\n height: number;\r\n shoeSize: number;\r\n skiLevel: number;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\n\r\nexport interface IAccountRentalDataInitData {\r\n rentalParentId: string;\r\n}\r\n\r\nexport class AccountRentalDataInitData implements IAccountRentalDataInitData {\r\n\r\n constructor(parentId: string) {\r\n this.rentalParentId = parentId;\r\n }\r\n\r\n rentalParentId: string;\r\n}\r\n\r\n@ModuleName(\"AccountRentalData\")\r\nexport class AccountRentalData implements AxInit {\r\n private rentalParentId: string;\r\n private _RentalWeightDropDown: AxDropdown = new AxDropdown();\r\n private _RentalHeightDropDown: AxDropdown = new AxDropdown();\r\n private _RentalShowSizeDropDown: AxDropdown = new AxDropdown();\r\n private _RentalSkiLevelDropDown: AxDropdown = new AxDropdown();\r\n\r\n private activeRentalFields: boolean;\r\n\r\n AxInit(init: AccountRentalDataInitData): void {\r\n this.rentalParentId = init.rentalParentId;\r\n\r\n this.activeRentalFields = $(init.rentalParentId).length !== 0;\r\n\r\n this.initRentalDropdowns();\r\n this.registerRentalUnitRadios();\r\n }\r\n\r\n // initRentalDropdowns\r\n initRentalDropdowns(): void {\r\n if (!this.activeRentalFields) return;\r\n\r\n this.initWeightDropdown(this.rentalParentId);\r\n this.initHeightDropdown(this.rentalParentId);\r\n this.initShoeSizeDropdown(this.rentalParentId);\r\n this.initSkiLevelDropdown(this.rentalParentId);\r\n\r\n this.updateDropdownValue();\r\n }\r\n\r\n // updateDropdownValue\r\n updateDropdownValue() {\r\n if (!this.activeRentalFields) return;\r\n\r\n const rentalWeight = $(\"#RentalWeight\").val() as string;\r\n const rentalHeight = $(\"#RentalHeight\").val() as string;\r\n const rentalShoeSize = $(\"#RentalShoeSize\").val() as string;\r\n const rentalSkiLevel = $(\"#RentalSkiLevel\").val() as string;\r\n\r\n if ($('.accountsettings__rentalWeight').length > 0) {\r\n this._RentalWeightDropDown.setValue(rentalWeight != '0' ? rentalWeight : null);\r\n }\r\n\r\n if ($('.accountsettings__rentalHeight').length > 0) {\r\n this._RentalHeightDropDown.setValue(rentalHeight != '0' ? rentalHeight : null);\r\n }\r\n\r\n if ($('.accountsettings__rentalShoeSize').length > 0) {\r\n this._RentalShowSizeDropDown.setValue(rentalShoeSize != '0' ? rentalShoeSize : null);\r\n }\r\n\r\n if ($('.accountsettings__rentalSkiLevel').length > 0) {\r\n this._RentalSkiLevelDropDown.setValue(rentalSkiLevel != '0' ? rentalSkiLevel : '2');\r\n }\r\n }\r\n\r\n // resetDropdownSelections\r\n resetDropdowns() {\r\n if (!this.activeRentalFields) return;\r\n\r\n $('#RentalWeight').val(\"\");\r\n $('#RentalHeight').val(\"\");\r\n $('#RentalShoeSize').val(\"\");\r\n $('#RentalSkiLevel').val(\"2\");\r\n\r\n this._RentalWeightDropDown.resetSelection();\r\n this._RentalHeightDropDown.resetSelection();\r\n this._RentalShowSizeDropDown.resetSelection();\r\n this._RentalSkiLevelDropDown.resetSelection();\r\n }\r\n\r\n // initWeightDropdown\r\n initWeightDropdown(parentId: string): void {\r\n this._RentalWeightDropDown.init(`${parentId} .accountsettings__rentalWeight`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent: JQuery<HTMLElement>, value: string) => {\r\n $('#RentalWeight').val(value);\r\n }\r\n }\r\n );\r\n }\r\n\r\n // initHeightDropdown\r\n initHeightDropdown(parentId: string): void {\r\n this._RentalHeightDropDown.init(`${parentId} .accountsettings__rentalHeight`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent: JQuery<HTMLElement>, value: string) => {\r\n $('#RentalHeight').val(value);\r\n }\r\n }\r\n );\r\n }\r\n\r\n // initShoeSizeDropdown\r\n initShoeSizeDropdown(parentId: string): void {\r\n this._RentalShowSizeDropDown.init(`${parentId} .accountsettings__rentalShoeSize`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent: JQuery<HTMLElement>, value: string) => {\r\n $('#RentalShoeSize').val(value);\r\n }\r\n }\r\n );\r\n }\r\n\r\n // initSkiLevelDropdown\r\n initSkiLevelDropdown(parentId: string): void {\r\n this._RentalSkiLevelDropDown.init(`${parentId} .accountsettings__rentalSkiLevel`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent: JQuery<HTMLElement>, value: string) => {\r\n $('#RentalSkiLevel').val(value);\r\n }\r\n }\r\n );\r\n }\r\n\r\n // registerRentalUnitRadios\r\n registerRentalUnitRadios() {\r\n if (!this.activeRentalFields) return;\r\n\r\n $(this.rentalParentId).on(\"change\", \"input[type=radio]\", e => {\r\n\r\n let rentalViewModel = {\r\n Height: $('#RentalHeight').val(),\r\n Weight: $('#RentalWeight').val(),\r\n ShoeSize: $('#RentalShoeSize').val(),\r\n SkiLevel: $('#RentalSkiLevel').val()\r\n };\r\n\r\n if ($(this.rentalParentId).length > 0) {\r\n AxessViewer.loadPartialView('/Account/GetAccRentalInfo', {\r\n rentalViewModel: rentalViewModel,\r\n unit: e.currentTarget.value\r\n }, resp => {\r\n $(this.rentalParentId).html(resp.view);\r\n this.initRentalDropdowns();\r\n }, null);\r\n }\r\n });\r\n }\r\n}", "import { AxDropdown } from \"@axess/limestone\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\nexport class LessonProperty {\r\n constructor(id: number, name: string, lessonPropertyType: LessonPropertyType) {\r\n this.id = id;\r\n this.name = name;\r\n this.lessonPropertyType = lessonPropertyType;\r\n }\r\n\r\n id: number;\r\n name: string;\r\n lessonPropertyType: LessonPropertyType;\r\n}\r\n\r\nexport enum LessonPropertyType {\r\n Allergy = 1,\r\n MedicalState = 2,\r\n Language = 3\r\n}\r\n\r\nexport interface CustomerLessonPropertiesInit {\r\n parentId: string;\r\n formElementPrefix: string;\r\n}\r\n\r\nexport class InitCustomerProps implements CustomerLessonPropertiesInit {\r\n parentId: string;\r\n formElementPrefix: string;\r\n\r\n constructor(parentId: string, formElementPrefix: string) {\r\n this.parentId = parentId;\r\n this.formElementPrefix = formElementPrefix;\r\n }\r\n}\r\n\r\n@ModuleName(\"CustomerLessonProperties\")\r\nexport class CustomerLessonProperties implements AxInit {\r\n\r\n private lessonAllergiesDropDown: AxDropdown;\r\n private lessonLanguagesDropDown: AxDropdown;\r\n private lessonMedicalsDropDown: AxDropdown;\r\n private lessonLevelsDropDown: AxDropdown;\r\n\r\n private hiddenAllergies: HTMLElement;\r\n private hiddenMedicalStates: HTMLElement;\r\n private hiddenLanguages: HTMLElement;\r\n //private hiddenLessonLevels: HTMLElement;\r\n\r\n private formElementPrefix: string;\r\n\r\n private allDropdowns: AxDropdown[] = [];\r\n\r\n allergies: LessonProperty[] = [];\r\n medicalStates: LessonProperty[] = [];\r\n languages: LessonProperty[] = [];\r\n lessonLevels: LessonProperty[] = [];\r\n\r\n AxInit(init: CustomerLessonPropertiesInit): void {\r\n this.formElementPrefix = init.formElementPrefix;\r\n\r\n this.hiddenAllergies = document.querySelector(`${init.parentId} .hidden_allergies`) as HTMLElement;\r\n this.hiddenMedicalStates = document.querySelector(`${init.parentId} .hidden_medicalStates`) as HTMLElement;\r\n this.hiddenLanguages = document.querySelector(`${init.parentId} .hidden_languages`) as HTMLElement;\r\n //this.hiddenLessonLevels = document.querySelector(`${init.parentId} .hidden_lessonLevels`) as HTMLElement;\r\n\r\n this.initLessonPropertyDropdowns(init.parentId);\r\n }\r\n\r\n //public getAllDropdowns(): AxDropdown[] {\r\n // return this.allDropdowns;\r\n //}\r\n\r\n private initLessonPropertyDropdowns(parentId: string) {\r\n this.initAllergiesDropdown(parentId);\r\n this.initLanguagesDropdown(parentId);\r\n this.initMedicalsDropdown(parentId);\r\n this.initLevelsDropdown(parentId);\r\n }\r\n\r\n private initAllergiesDropdown(parentId: string) {\r\n this.lessonAllergiesDropDown = new AxDropdown();\r\n this.lessonAllergiesDropDown.init(`${parentId} .lesson-property-dropDown_allergies`,\r\n {\r\n searchBar: false,\r\n multiSelect: true,\r\n onOpen: () => { },\r\n onChange: (elem, changedValue, dir, values) => {\r\n this.hiddenAllergies.innerHTML = \"\";\r\n this.allergies = [];\r\n\r\n if (Array.isArray(values)) {\r\n values.forEach((value, i) => {\r\n const temp = new LessonProperty(Number(value), \"\", LessonPropertyType.Allergy);\r\n this.allergies.push(temp);\r\n this.createFormElementProp(\"LessonAllergies\", i, temp, this.hiddenAllergies);\r\n });\r\n } else {\r\n const temp = new LessonProperty(Number(values), \"\", LessonPropertyType.Allergy);\r\n this.createFormElementProp(\"LessonAllergies\", 0, temp, this.hiddenAllergies);\r\n }\r\n },\r\n \r\n });\r\n\r\n this.allDropdowns.push(this.lessonAllergiesDropDown);\r\n }\r\n\r\n private initLanguagesDropdown(parentId: string) {\r\n this.lessonLanguagesDropDown = new AxDropdown();\r\n this.lessonLanguagesDropDown.init(`${parentId} .lesson-property-dropDown_languages`,\r\n {\r\n searchBar: false,\r\n multiSelect: true,\r\n onOpen: () => { },\r\n onChange: (elem, changedValue, dir, values) => {\r\n this.hiddenLanguages.innerHTML = \"\";\r\n this.languages = [];\r\n\r\n if (Array.isArray(values)) {\r\n values.forEach((value, i) => {\r\n const temp = new LessonProperty(Number(value), \"\", LessonPropertyType.Language);\r\n this.languages.push(temp);\r\n this.createFormElementProp(\"LessonLanguages\", i, temp, this.hiddenLanguages);\r\n });\r\n } else {\r\n const temp = new LessonProperty(Number(values), \"\", LessonPropertyType.Language);\r\n this.createFormElementProp(\"LessonLanguages\", 0, temp, this.hiddenLanguages);\r\n }\r\n }\r\n });\r\n\r\n this.allDropdowns.push(this.lessonLanguagesDropDown);\r\n }\r\n\r\n private initMedicalsDropdown(parentId: string) {\r\n this.lessonMedicalsDropDown = new AxDropdown();\r\n this.lessonMedicalsDropDown.init(`${parentId} .lesson-property-dropDown_medicalStates`,\r\n {\r\n searchBar: false,\r\n multiSelect: true,\r\n onOpen: () => { },\r\n onChange: (elem, changedValue, dir, values) => {\r\n if (Array.isArray(values)) {\r\n this.hiddenMedicalStates.innerHTML = \"\";\r\n this.medicalStates = [];\r\n\r\n values.forEach((value, i) => {\r\n const temp = new LessonProperty(Number(value), \"\", LessonPropertyType.MedicalState);\r\n this.medicalStates.push(temp);\r\n this.createFormElementProp(\"LessonMedicals\", i, temp, this.hiddenMedicalStates);\r\n });\r\n } else {\r\n const temp = new LessonProperty(Number(values), \"\", LessonPropertyType.MedicalState);\r\n this.createFormElementProp(\"LessonMedicals\", 0, temp, this.hiddenMedicalStates);\r\n }\r\n }\r\n });\r\n\r\n this.allDropdowns.push(this.lessonMedicalsDropDown);\r\n }\r\n\r\n private initLevelsDropdown(parentId: string) {\r\n this.lessonLevelsDropDown = new AxDropdown();\r\n this.lessonLevelsDropDown.init(`${parentId} .lesson-property-dropDown_lessonLevels`,\r\n {\r\n searchBar: false,\r\n multiSelect: true,\r\n onOpen: () => { },\r\n onSelect: (elem, values) => {\r\n\r\n //if (Array.isArray(values)) {\r\n // this.hiddenLessonLevels.value = values.join(',');\r\n //} else {\r\n // this.hiddenLessonLevels.value = values;\r\n //}\r\n }\r\n });\r\n\r\n this.allDropdowns.push(this.lessonLevelsDropDown);\r\n }\r\n\r\n private createFormElementProp(propFieldName: string, index: number, lessonProperty: LessonProperty, parent: HTMLElement) {\r\n this.createFormElementPropId(propFieldName, index, lessonProperty.id.toString(), parent);\r\n this.createFormElementPropName(propFieldName, index, lessonProperty.name, parent);\r\n this.createFormElementPropType(propFieldName, index, lessonProperty.lessonPropertyType, parent);\r\n\r\n }\r\n\r\n private createFormElementPropId(propName: string, index: number, value: string, parent: HTMLElement) {\r\n const propElement = document.createElement('input');\r\n propElement.type = \"hidden\";\r\n propElement.name = `${this.formElementPrefix}${propName}[${index}].id`;\r\n propElement.value = value;\r\n\r\n parent.appendChild(propElement);\r\n }\r\n\r\n private createFormElementPropName(propName: string, index: number, value: string, parent: HTMLElement) {\r\n const propElement = document.createElement('input');\r\n propElement.type = \"hidden\";\r\n propElement.name = `${this.formElementPrefix}${propName}[${index}].name`;\r\n propElement.value = value;\r\n\r\n parent.appendChild(propElement);\r\n }\r\n\r\n private createFormElementPropType(propName: string, index: number, propType: LessonPropertyType, parent: HTMLElement) {\r\n const propElement = document.createElement('input');\r\n propElement.type = \"hidden\";\r\n propElement.name = `${this.formElementPrefix}${propName}[${index}].lessonPropertyType`;\r\n propElement.value = propType.toString();\r\n\r\n parent.appendChild(propElement);\r\n }\r\n}", "import { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"inputMaskHelper\")\r\nexport class inputMaskHelper {\r\n static maskWtpOld = \"WAAAAAAA-AAA-AAA\";\r\n static maskWtpNew = \"ZSAA-AAAA-AAAA-AAAA\";\r\n\r\n private static birthdayPattern: string;\r\n private static proj4d: boolean;\r\n\r\n //private static i18nHelper: \r\n\r\n static init(proj4d, birthdayPattern) {\r\n this.birthdayPattern = birthdayPattern;\r\n this.proj4d = proj4d;\r\n const i18nHelper = new I18nHelper();\r\n\r\n\r\n //@ts-ignore\r\n jQuery.validator.addMethod(\"wtpNumber\", function (value, element) {\r\n const isComplete = $(element).inputmask(\"isComplete\");\r\n return isComplete;\r\n\r\n }, i18nHelper.GetTranslation(Translations.WTPNumberNotFound));\r\n }\r\n\r\n static setBirthdayPattern(birthdayPattern) {\r\n this.birthdayPattern = birthdayPattern;\r\n }\r\n\r\n static getBirthdayPattern() {\r\n return this.birthdayPattern;\r\n }\r\n\r\n static wtpNumberMask() {\r\n return this.proj4d ? this.maskWtpNew : this.maskWtpOld;\r\n }\r\n\r\n static openpassMaskOptions(): Inputmask.Options {\r\n return {\r\n removeMaskOnSubmit: false,\r\n placeholder: \"_\",\r\n definitions: {\r\n \"A\": {\r\n validator: \"[1-9A-Za-z]\",\r\n casing: \"upper\"\r\n }\r\n }\r\n }\r\n }\r\n\r\n static wtpMaskOptions(): Inputmask.Options {\r\n return {\r\n removeMaskOnSubmit: false,\r\n placeholder: \"_\",\r\n definitions: {\r\n \"Z\": {\r\n validator: \"[Zz]\",\r\n casing: \"upper\"\r\n },\r\n \"S\": {\r\n validator: \"[1-9A-Za-z]\",\r\n casing: \"upper\"\r\n },\r\n \"W\": {\r\n validator: \"[0-9A-Fa-fGHJKLMNPghjklmnp]\",\r\n casing: \"upper\"\r\n },\r\n \"A\": {\r\n validator: \"[0-9A-Za-z]\",\r\n casing: \"upper\"\r\n },\r\n \"X\": {\r\n validator: \"[0-9A-Za-z\\-]\",\r\n casing: \"upper\"\r\n }\r\n }\r\n };\r\n }\r\n}", "import { from, fromEvent, Observable, of } from 'rxjs';\r\nimport { map, tap } from 'rxjs/operators';\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from '../../Lib/Helper/I18nHelper';\r\nimport { AxDropdown, IAxDropdownOptions } from \"@axess/limestone\";\r\nimport { inputMaskHelper } from '../../Lib/Helper/InputMaskHelper';\r\n\r\n@ModuleName(\"SeasonCardBooking\")\r\nexport class SeasonCardBooking implements AxInit {\r\n private InitData: ReservationsInitData;\r\n\r\n private txtSerial: HTMLInputElement;\r\n private txtPosNr: HTMLInputElement;\r\n private txtWtp: HTMLInputElement;\r\n private btnNext: HTMLButtonElement;\r\n private linkPopup: HTMLLinkElement;\r\n\r\n private txtSerialChange$: Observable<InputEvent>;\r\n private txtPosNrChange$: Observable<InputEvent>;\r\n private linkChange$: Observable<InputEvent>;\r\n\r\n public ProjectNr: number;\r\n public PosNr: number;\r\n public SerialNr: number;\r\n public NextUrl: string;\r\n private formValidator: FormValidator;\r\n\r\n protected seasonCardDropdown: AxDropdown = new AxDropdown();\r\n\r\n constructor(private _i18nHelper = new I18nHelper) { }\r\n\r\n AxInit(init: any): void {\r\n this.InitData = init;\r\n\r\n this.txtSerial = document.getElementById('serialNr') as HTMLInputElement;\r\n this.txtPosNr = document.getElementById('posNr') as HTMLInputElement;\r\n this.txtWtp = document.getElementById('wtpInput') as HTMLInputElement;\r\n this.btnNext = document.getElementById('spb_enter_button') as HTMLButtonElement;\r\n this.linkPopup = document.getElementById('popupDesc') as HTMLLinkElement;\r\n\r\n this.formValidator = new FormValidator();\r\n\r\n this.formValidator.setValidationMessages(\"projNr\", \"msgProjNr\", {\r\n valueMissing: this._i18nHelper.GetTranslation(Translations.ValueMissing),\r\n patternMismatch: this._i18nHelper.GetTranslation(Translations.OnlyNumbers),\r\n }, this.btnNext);\r\n\r\n\r\n this.formValidator.setValidationMessages(\"posNr\", \"msgPosNr\", {\r\n valueMissing: this._i18nHelper.GetTranslation(Translations.ValueMissing),\r\n patternMismatch: this._i18nHelper.GetTranslation(Translations.OnlyNumbers),\r\n }, this.btnNext);\r\n\r\n this.formValidator.setValidationMessages(\"serialNr\", \"msgSerialNr\", {\r\n valueMissing: this._i18nHelper.GetTranslation(Translations.ValueMissing),\r\n patternMismatch: this._i18nHelper.GetTranslation(Translations.OnlyNumbers),\r\n }, this.btnNext);\r\n\r\n $('#spb_enter_button').click(x => {\r\n let projNr = $('#projNr').val();\r\n let posNr = $('#posNr').val();\r\n let serialNr = $('#serialNr').val();\r\n\r\n this.submitInput(projNr, posNr, serialNr);\r\n });\r\n\r\n $(\".chip-card-sample-close\").click(function () {\r\n $(\".ax-resportal-card-example-holder\").hide();\r\n });\r\n\r\n $('input:radio[name=flexRadioDefault]').change(() => {\r\n this.seasonCardDropdown.resetSelection();\r\n this.resetSelection();\r\n });\r\n\r\n this.txtSerialChange$ = fromEvent<InputEvent>(this.txtSerial, 'input');\r\n this.txtPosNrChange$ = fromEvent<InputEvent>(this.txtPosNr, 'input');\r\n this.linkChange$ = fromEvent<InputEvent>(this.linkPopup, 'click');\r\n this.linkPopup.addEventListener('click', (e: Event) => this.showExample('exampleHoler_1'));\r\n\r\n this.seasonCardDropdown.init(`.seasonPassReservation__product-dropdown`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: ($parent: JQuery<HTMLElement>) => {\r\n $('input:radio[name=flexRadioDefault]').prop('checked', false);\r\n $('#collapse_1').collapse('hide');\r\n $('#collapse_2').collapse('hide');\r\n this.resetSelection();\r\n }\r\n });\r\n this.setSeasonPassDropDownObserver();\r\n\r\n let maskOptions = inputMaskHelper.wtpMaskOptions();\r\n maskOptions.oncomplete = () => {\r\n AxessViewer.loadPartialView('/Reservations/CheckWtp', { wtp: $(this.txtWtp).val() }, (result) => {\r\n if (result.success) {\r\n this.ProjectNr = result.proj;\r\n this.PosNr = result.pos;\r\n this.SerialNr = result.serie;\r\n this.NextUrl = `/${this.InitData.Language}/Reservations/Reserved?ProjNr=${this.ProjectNr}&PosNr=${this.PosNr}&SerialNr=${this.SerialNr}`;\r\n\r\n this.btnNext.disabled = false;\r\n\r\n $('#msgWtpInput').html('');\r\n }\r\n else {\r\n this.btnNext.disabled = true;\r\n $('#msgWtpInput').html(this._i18nHelper.GetTranslation(Translations.NotValidWtp));\r\n }\r\n }, {\r\n silent: false\r\n });\r\n };\r\n\r\n $(this.txtWtp).inputmask(inputMaskHelper.wtpNumberMask(), maskOptions);\r\n\r\n this.setSerialInputObservers();\r\n this.setPosNoInputObservers();\r\n\r\n this.btnNext.disabled = true;\r\n\r\n //QR stuff\r\n\r\n // let html5QrcodeScanner = new Html5QrcodeScanner(\r\n // \"reader\",\r\n // { fps: 10, qrbox: { width: 250, height: 250 } },\r\n ///* verbose= */ false);\r\n // html5QrcodeScanner.render(this.onScanSuccess, this.onScanFailure);\r\n }\r\n\r\n onScanSuccess(decodedText, decodedResult) {\r\n let that = this;\r\n $('#cameraModal').modal('hide');\r\n $('body').removeClass('modal-open');\r\n $('.modal-backdrop').remove();\r\n\r\n\r\n AxessViewer.loadPartialView('/Reservations/CheckScanedWtp', { wtp: decodedText }, function (result) {\r\n if (result.success) {\r\n\r\n that.btnNext.disabled = false;\r\n }\r\n else {\r\n $('.loading-spinner.loading').hide();\r\n $('#wtpInput').val(result.wtpNr);\r\n $('#msgWtpInput').html(this._i18nHelper.GetTranslation(Translations.NotValidWtp));\r\n }\r\n }, {\r\n silent: true,\r\n\r\n });\r\n }\r\n\r\n resetSelection() {\r\n this.btnNext.disabled = true;\r\n $('#posNr').val('');\r\n $('#serialNr').val('');\r\n $(this.txtWtp).val('');\r\n }\r\n\r\n onScanFailure(error) {\r\n console.warn(`Code scan error = ${error}`);\r\n }\r\n\r\n setSerialInputObservers() {\r\n this.txtSerialChange$\r\n .pipe(map((event: InputEvent) => (event.target as HTMLInputElement).value))\r\n .subscribe((sp) => {\r\n\r\n let projNr = $('#projNr').val();\r\n let posNr = $('#posNr').val();\r\n let serialNr = $('#serialNr').val();\r\n\r\n if (/*sp.length < 5 ||*/ this.isEmpty(posNr)) {\r\n return;\r\n }\r\n\r\n this.checkSerialNo(projNr, posNr, serialNr);\r\n });\r\n }\r\n\r\n setPosNoInputObservers() {\r\n this.txtPosNrChange$\r\n .pipe(map((event: InputEvent) => (event.target as HTMLInputElement).value))\r\n .subscribe((sp) => {\r\n\r\n let projNr = $('#projNr').val();\r\n let posNr = $('#posNr').val();\r\n let serialNr = $('#serialNr').val();\r\n\r\n if (/*sp.length < 3 || */this.isEmpty(serialNr)) {\r\n return;\r\n }\r\n\r\n this.checkSerialNo(projNr, posNr, serialNr);\r\n });\r\n }\r\n\r\n showExample(elemId: string) {\r\n $('#' + elemId).show();\r\n }\r\n\r\n checkSerialNo(projNr, posNr, serialNr) {\r\n let data = {\r\n projNr: projNr,\r\n posNr: posNr,\r\n serialNr: serialNr\r\n }\r\n\r\n let that = this;\r\n if ($('#serialNr').val() == null || $('#serialNr').val() == '') {\r\n return;\r\n }\r\n\r\n if ($('#posNr').val() == null || $('#posNr').val() == '') {\r\n return;\r\n }\r\n\r\n AxessViewer.loadPartialView('/Reservations/CheckSerial', data, function (result) {\r\n if (result.success) {\r\n that.ProjectNr = result.proj;\r\n that.PosNr = result.pos;;\r\n that.SerialNr = result.serie;\r\n that.NextUrl = `/${that.InitData.Language}/Reservations/Reserved?ProjNr=${that.ProjectNr}&PosNr=${that.PosNr}&SerialNr=${that.SerialNr}`;\r\n\r\n that.btnNext.disabled = false;\r\n }\r\n else {\r\n that.btnNext.disabled = true;\r\n $('#msgSerialNr').html(that._i18nHelper.GetTranslation(Translations.NotValidSerialNumber));\r\n }\r\n }, {\r\n silent: false,\r\n });\r\n }\r\n\r\n setSeasonPassDropDownObserver() {\r\n this.seasonCardDropdown.getSelectObserver().subscribe((sp: string) => {\r\n if (sp != null && sp.length > 4) {\r\n $(\".collapse\").collapse(\"hide\");\r\n $('input:radio[name=flexRadioDefault]').each(function () { $(this).prop('checked', false); });\r\n\r\n this.ProjectNr = parseInt(sp.split('-')[0]);\r\n this.PosNr = parseInt(sp.split('-')[1]);\r\n this.SerialNr = parseInt(sp.split('-')[2]);\r\n this.NextUrl = `/${this.InitData.Language}/Reservations/Reserved?ProjNr=${this.ProjectNr}&PosNr=${this.PosNr}&SerialNr=${this.SerialNr}`;\r\n this.btnNext.disabled = false;\r\n }\r\n else {\r\n this.btnNext.disabled = true;\r\n }\r\n });\r\n }\r\n\r\n submitInput(projNr, posNr, serialNr) {\r\n let url = `/${this.InitData.Language}/Reservations/Reserved?ProjNr=${projNr}&PosNr=${posNr}&SerialNr=${serialNr}`;\r\n\r\n if (this.NextUrl != null) {\r\n url = this.NextUrl;\r\n }\r\n\r\n window.location.href = url;\r\n }\r\n\r\n isEmpty(str) {\r\n return (!str || str.length === 0);\r\n }\r\n}\r\n\r\ninterface ReservationsInitData {\r\n Language: string;\r\n}\r\n\r\ntype ValidationMessages = Partial<Record<'valueMissing' | /*'tooShort' | 'tooLong' | 'rangeUnderflow' | 'rangeOverflow' | 'typeMismatch' |*/ 'patternMismatch', string>>;\r\n\r\nclass FormValidator {\r\n public isOk: boolean = true;\r\n public setValidationMessages(ctrlID: string, msgEleID: string, messages: ValidationMessages, btnNext: HTMLButtonElement) {\r\n\r\n let element: any = document.querySelector(\"#\" + ctrlID);\r\n\r\n element.addEventListener(\"input\", (evt) => {\r\n let flag: boolean;\r\n this.isOk = true;\r\n if (element.validity.valueMissing) {\r\n if (typeof messages.valueMissing !== \"undefined\") {\r\n element.setCustomValidity(messages.valueMissing);\r\n flag = true;\r\n this.isOk = false;\r\n }\r\n }\r\n\r\n if (element.validity.patternMismatch) {\r\n if (typeof messages.patternMismatch !== \"undefined\") {\r\n element.setCustomValidity(messages.patternMismatch);\r\n flag = true;\r\n this.isOk = false;\r\n }\r\n }\r\n\r\n if (flag) {\r\n document.querySelector(\"#\" + msgEleID).innerHTML = element.validationMessage;\r\n btnNext.disabled = true;\r\n this.isOk = false;\r\n }\r\n else {\r\n element.setCustomValidity(\"\");\r\n document.querySelector(\"#\" + msgEleID).innerHTML = \"\";\r\n //btnNext.disabled = false;\r\n this.isOk = true;\r\n }\r\n });\r\n }\r\n}\r\n", "import { I18nHelper } from \"../../Lib/Helper/I18nHelper\";\r\n\r\n\r\nexport class AxCheck {\r\n private label: HTMLElement;\r\n private checkBoxInstance: IAxCheckBoxInstance;\r\n public identifier: string;\r\n\r\n constructor(identifier: string, label: HTMLElement) {\r\n this.label = label;\r\n this.identifier = identifier;\r\n this.checkBoxInstance = {\r\n checkBoxWrapper: label,\r\n valueElem: label.children[0] as HTMLElement,\r\n spanElem: label.children[1] as HTMLElement\r\n }\r\n }\r\n\r\n static Init(identifier: string, label: HTMLElement): AxCheck {\r\n return new AxCheck(identifier, label);\r\n }\r\n\r\n setSpanValue(newValue: string) {\r\n this.checkBoxInstance.spanElem.innerHTML = '(' + newValue + ')';\r\n }\r\n\r\n resetCheckBox() {\r\n const checkbox = this.checkBoxInstance.valueElem as HTMLInputElement;\r\n checkbox.checked = false;\r\n }\r\n\r\n hideCheckBox() {\r\n $(this.checkBoxInstance.checkBoxWrapper).hide();\r\n }\r\n\r\n showCheckBox() {\r\n $(this.checkBoxInstance.checkBoxWrapper).show();\r\n }\r\n}\r\n\r\ninterface IAxCheckBoxInstance {\r\n checkBoxWrapper: HTMLElement;\r\n spanElem: HTMLElement;\r\n valueElem: HTMLElement;\r\n}", "import { IonRangeSliderEvent, IonRangeSliderOptions } from \"ion-rangeslider\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxCheck } from \"../../Components/AxForm/AxCheck\";\r\nimport { PlatformHelper } from \"../../Lib/Helper/PlatformHelper\";\r\nimport { ComplexPackageSelection } from \"./ComplexPackageSelection\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { ComplexPackageSearchBar } from \"./ComplexPackageSearchBar\";\r\n\r\ninterface IComplexPackageFilterInit {\r\n currencyString: string;\r\n filterMin: number;\r\n filterMax: number;\r\n}\r\n\r\n@ModuleName(\"ComplexPackageFilter\")\r\nexport class ComplexPackageFilter implements AxInit {\r\n private axLoading: AxLoading;\r\n private complexPackageSelectionModule: ComplexPackageSelection;\r\n private complexPackageSearchBarModule: ComplexPackageSearchBar;\r\n\r\n protected checkBoxesActivity: AxCheck[];\r\n protected checkBoxesContent: AxCheck[];\r\n protected checkBoxesDuration: AxCheck[];\r\n protected checkBoxesAgeGroups: AxCheck[];\r\n protected checkBoxesSkillLevels: AxCheck[];\r\n\r\n private identifierActivity = \"identifierActivity_\";\r\n private identifierDuration = \"identifierDuration_\";\r\n private identifierAgeGroup = \"identifierAgeGroup_\";\r\n private identifierSkillLevel = \"identifierSkillLevel_\";\r\n private identifierContent = \"identifierContent_\";\r\n private rangeSliderDesktop: any;\r\n private rangeSliderMobile: any;\r\n private priceRangeMin: number;\r\n private priceRangeMax: number;\r\n\r\n AxInit(init: IComplexPackageFilterInit): void {\r\n this.axLoading = new AxLoading();\r\n\r\n this.checkBoxesActivity = [];\r\n this.checkBoxesContent = [];\r\n this.checkBoxesDuration = [];\r\n this.checkBoxesAgeGroups = [];\r\n this.checkBoxesSkillLevels = [];\r\n\r\n init.filterMax = init.filterMax / 100;\r\n init.filterMin = init.filterMin / 100;\r\n\r\n this.initCheckBoxes();\r\n this.initRangeSliderDesktop(init);\r\n this.initRangeSliderMobile(init);\r\n this.setChangeListeners();\r\n this.initMobile(init);\r\n this.complexPackageSelectionModule = AxLoad.GetModule<ComplexPackageSelection>(\"ComplexPackageSelection\");\r\n this.complexPackageSearchBarModule = AxLoad.GetModule<ComplexPackageSearchBar>(\"ComplexPackageSearchBar\");\r\n this.setupResetButtons();\r\n this.loadFilteredResults();\r\n }\r\n\r\n initMobile(init: IComplexPackageFilterInit) {\r\n const buttonMobileFilter = document.getElementById('compPacksFilterOpenButtonMobile');\r\n\r\n buttonMobileFilter?.addEventListener('click', event => {\r\n document.querySelector(\".lessones_filter_mobile_holder.collapsible\").classList.toggle(\"collapsed\");;\r\n\r\n let compPackFilterFooter = <HTMLFormElement>document.getElementById('compPackFilterFooter');\r\n\r\n if (compPackFilterFooter.style.display !== 'flex') {\r\n compPackFilterFooter.style.display = 'flex';\r\n }\r\n\r\n $('.ax-header--fixed.ax-header-mobile--fixed').toggleClass('noscroll');\r\n });\r\n\r\n const compPackFilterMobileSafeButton = document.getElementById('compackFilterMobileSafeButton');\r\n compPackFilterMobileSafeButton?.addEventListener('click', event => {\r\n this.safeMobileFilter();\r\n });\r\n\r\n const filterCloseButtonMobile = document.getElementById('filterCloseButtonMobile');\r\n filterCloseButtonMobile?.addEventListener('click', event => {\r\n this.closeMobileFilter();\r\n });\r\n }\r\n\r\n // closeMobileFilter\r\n closeMobileFilter() {\r\n document.querySelector(\".lessones_filter_mobile_holder.collapsible\").classList.toggle(\"collapsed\");;\r\n\r\n let compPackFilterFooter = <HTMLFormElement>document.getElementById('compPackFilterFooter');\r\n\r\n if (compPackFilterFooter.style.display !== 'none') {\r\n compPackFilterFooter.style.display = 'none';\r\n }\r\n\r\n $('.ax-header--fixed.ax-header-mobile--fixed').toggleClass('noscroll');\r\n }\r\n\r\n // safeMobileFilter\r\n safeMobileFilter() {\r\n this.closeMobileFilter();\r\n\r\n $([document.documentElement, document.body]).animate({\r\n scrollTop: $(\".compPacks_input_mask\").offset().top - 59\r\n }, 500);\r\n }\r\n\r\n // initRangeSlider\r\n initRangeSliderDesktop(init: IComplexPackageFilterInit) {\r\n this.rangeSliderDesktop = $(\".ax-range-slider.ax-compPack-desktopIdentifier\").ionRangeSlider({\r\n skin: 'round',\r\n type: 'double',\r\n hide_min_max: true,\r\n extra_classes: 'ax-range-slider has-labels',\r\n prefix: `${init.currencyString} `,\r\n max: init.filterMax,\r\n min: init.filterMin,\r\n step: 2.5,\r\n onChange: x => this.setPriceFromSlider(x),\r\n onFinish: x => this.sliderUpdated(x),\r\n onStart: x => this.setPriceFromSlider(x),\r\n onUpdate: x => this.sliderUpdated(x)\r\n });\r\n }\r\n\r\n // initRangeSlider\r\n initRangeSliderMobile(init: IComplexPackageFilterInit) {\r\n this.rangeSliderMobile = $(\".ax-range-slider.ax-compPack-mobileIdentifier\").ionRangeSlider({\r\n skin: 'round',\r\n type: 'double',\r\n hide_min_max: true,\r\n extra_classes: 'ax-range-slider has-labels',\r\n prefix: `${init.currencyString} `,\r\n max: init.filterMax,\r\n min: init.filterMin,\r\n step: 2.5,\r\n onChange: x => this.setPriceFromSlider(x),\r\n onFinish: x => this.sliderUpdated(x),\r\n onStart: x => this.setPriceFromSlider(x),\r\n onUpdate: x => this.sliderUpdated(x)\r\n });\r\n }\r\n\r\n // sliderChanged\r\n sliderUpdated(x: IonRangeSliderEvent) {\r\n this.setPriceFromSlider(x);\r\n this.loadFilteredResults();\r\n }\r\n\r\n // setPriceFromSlider\r\n setPriceFromSlider(x: IonRangeSliderEvent) {\r\n this.priceRangeMin = x.from;\r\n this.priceRangeMax = x.to;\r\n }\r\n\r\n // initCheckBoxes\r\n initCheckBoxes() {\r\n $('.compPack_filter_item_activity').parent().each((i, obj) => {\r\n let id = $(obj).find('.compPack_filter_item_activity').attr('data-activity-id');\r\n this.checkBoxesActivity.push(new AxCheck(this.identifierActivity + id, obj));\r\n });\r\n\r\n $('.compPack_filter_item_content').parent().each((i, obj) => {\r\n let id = $(obj).find('.compPack_filter_item_content').attr('data-content-id');\r\n this.checkBoxesContent.push(new AxCheck(this.identifierContent + id, obj));\r\n });\r\n\r\n $('.compPack_filter_item_duration').parent().each((i, obj) => {\r\n let id = $(obj).find('.compPack_filter_item_duration').attr('data-duration-id');\r\n this.checkBoxesDuration.push(new AxCheck(this.identifierDuration + id, obj));\r\n });\r\n\r\n $('.compPack_filter_item_ageGroup').parent().each((i, obj) => {\r\n let id = $(obj).find('.compPack_filter_item_ageGroup').attr('data-ageGroup-id');\r\n this.checkBoxesAgeGroups.push(new AxCheck(this.identifierAgeGroup + id, obj));\r\n });\r\n\r\n $('.compPack_filter_item_skillLevel').parent().each((i, obj) => {\r\n let id = $(obj).find('.compPack_filter_item_skillLevel').attr('data-skillLevel-id');\r\n this.checkBoxesSkillLevels.push(new AxCheck(this.identifierSkillLevel + id, obj));\r\n });\r\n }\r\n\r\n // setChangeListeners\r\n setChangeListeners() {\r\n $('.compPack_filter_item').change(() => {\r\n this.loadFilteredResults();\r\n });\r\n }\r\n // loadFilteredResults\r\n loadFilteredResults() {\r\n let data = this.prepareData();\r\n\r\n let compPacksResultsContainer = $('#compPacksResultsContainer')[0];\r\n let compPacksResultsSearchButton = $('.compPacks_input_mask_icon')[0];\r\n\r\n this.axLoading.ShowLoadingIndicatorTop(compPacksResultsContainer);\r\n //this.axLoading.ShowLoadingIndicatorButtonPrimary(compPacksResultsSearchButton);\r\n\r\n AxessViewer.loadPartialView('/ComplexPackagesSelection/GetFilterResults', data, result => {\r\n\r\n $('#compPacksResultsContainer').html(result);\r\n\r\n this.refreshFilterItemCounts();\r\n this.complexPackageSelectionModule.setClickEvents();\r\n\r\n this.axLoading.HideLoadingIndicator(compPacksResultsContainer);\r\n //this.axLoading.HideLoadingIndicator(compPacksResultsSearchButton);\r\n }, {\r\n dataType: 'html'\r\n });\r\n }\r\n //refreshFilterItemCounts\r\n refreshFilterItemCounts() {\r\n AxessViewer.loadPartialView('/ComplexPackagesSelection/GetFilterItemCount', '', resultFilter => {\r\n for (let i = 0; i < resultFilter.activities.length; i++) {\r\n const element = resultFilter.activities[i];\r\n const name = this.identifierActivity + element.Item1;\r\n this.setActivitySpanValues(name, element.Item2);\r\n }\r\n\r\n for (let i = 0; i < resultFilter.contents.length; i++) {\r\n const element = resultFilter.contents[i];\r\n const name = this.identifierContent + element.Item1;\r\n this.setContentSpanValues(name, element.Item2);\r\n }\r\n\r\n for (let i = 0; i < resultFilter.durations.length; i++) {\r\n const element = resultFilter.durations[i];\r\n const name = this.identifierDuration + element.Item1;\r\n this.setDurationSpanValues(name, element.Item2);\r\n }\r\n\r\n for (let i = 0; i < resultFilter.ageGroups.length; i++) {\r\n const element = resultFilter.ageGroups[i];\r\n const name = this.identifierAgeGroup + element.Item1;\r\n this.setAgeGroupSpanValues(name, element.Item2);\r\n }\r\n\r\n for (let i = 0; i < resultFilter.skillLevels.length; i++) {\r\n const element = resultFilter.skillLevels[i];\r\n const name = this.identifierSkillLevel + element.Item1;\r\n this.setSkillLevelSpanValues(name, element.Item2);\r\n }\r\n }, {\r\n dataType: 'json'\r\n });\r\n }\r\n\r\n // prepareData\r\n prepareData() {\r\n\r\n let fromDate = '';\r\n\r\n if (this.complexPackageSearchBarModule.dateFrom != undefined) {\r\n fromDate = this.complexPackageSearchBarModule.dateFrom.format('YYYY-MM-DD');\r\n }\r\n\r\n let toDate = '';\r\n\r\n if (this.complexPackageSearchBarModule.dateTo != undefined) {\r\n toDate = this.complexPackageSearchBarModule.dateTo.format('YYYY-MM-DD');\r\n }\r\n\r\n let data = {\r\n Activities: [],\r\n Durations: [],\r\n AgeGroups: [],\r\n SkillLevels: [],\r\n Contents: [],\r\n PriceRangeMin: this.priceRangeMin,\r\n PriceRangeMax: this.priceRangeMax,\r\n FromDate: fromDate,\r\n ToDate: toDate\r\n }\r\n\r\n $('.compPack_filter_item_activity').each((i, obj) => {\r\n let check = $(obj).prop('checked');\r\n let id = $(obj).attr('data-activity-id');\r\n\r\n if (check) {\r\n data.Activities.push(id);\r\n }\r\n });\r\n\r\n $('.compPack_filter_item_content').each((i, obj) => {\r\n let check = $(obj).prop('checked');\r\n let id = $(obj).attr('data-content-id');\r\n\r\n if (check) {\r\n data.Contents.push(id);\r\n }\r\n });\r\n\r\n $('.compPack_filter_item_duration').each((i, obj) => {\r\n let check = $(obj).prop('checked');\r\n let id = $(obj).attr('data-duration-id');\r\n\r\n if (check) {\r\n data.Durations.push(id);\r\n }\r\n });\r\n\r\n $('.compPack_filter_item_ageGroup').each((i, obj) => {\r\n let check = $(obj).prop('checked');\r\n let id = $(obj).attr('data-ageGroup-id');\r\n\r\n if (check) {\r\n data.AgeGroups.push(id);\r\n }\r\n });\r\n\r\n $('.compPack_filter_item_skillLevel').each((i, obj) => {\r\n let check = $(obj).prop('checked');\r\n let id = $(obj).attr('data-skillLevel-id');\r\n\r\n if (check) {\r\n data.SkillLevels.push(id);\r\n }\r\n });\r\n\r\n return data;\r\n }\r\n //setActivitySpanValues\r\n setActivitySpanValues(identifier: string, newValue: string) {\r\n for (let i = 0; i < this.checkBoxesActivity.length; i++) {\r\n if (this.checkBoxesActivity[i].identifier == identifier) {\r\n this.checkBoxesActivity[i].setSpanValue(newValue);\r\n //this.hideZeroCounts(this.checkBoxesActivity[i], newValue); --> don´t hide activites\r\n }\r\n }\r\n }\r\n //setActivitySpanValues\r\n setContentSpanValues(identifier: string, newValue: string) {\r\n for (let i = 0; i < this.checkBoxesContent.length; i++) {\r\n if (this.checkBoxesContent[i].identifier == identifier) {\r\n this.checkBoxesContent[i].setSpanValue(newValue);\r\n this.hideZeroCounts(this.checkBoxesContent[i], newValue);\r\n }\r\n }\r\n }\r\n //setDurationSpanValues\r\n setDurationSpanValues(identifier: string, newValue: string) {\r\n for (let i = 0; i < this.checkBoxesDuration.length; i++) {\r\n if (this.checkBoxesDuration[i].identifier == identifier) {\r\n this.checkBoxesDuration[i].setSpanValue(newValue);\r\n this.hideZeroCounts(this.checkBoxesDuration[i], newValue);\r\n }\r\n }\r\n }\r\n //setAgeGroupSpanValues\r\n setAgeGroupSpanValues(identifier: string, newValue: string) {\r\n for (let i = 0; i < this.checkBoxesAgeGroups.length; i++) {\r\n if (this.checkBoxesAgeGroups[i].identifier == identifier) {\r\n this.checkBoxesAgeGroups[i].setSpanValue(newValue);\r\n this.hideZeroCounts(this.checkBoxesAgeGroups[i], newValue);\r\n }\r\n }\r\n }\r\n //setSkillLevelSpanValues\r\n setSkillLevelSpanValues(identifier: string, newValue: string) {\r\n for (let i = 0; i < this.checkBoxesSkillLevels.length; i++) {\r\n if (this.checkBoxesSkillLevels[i].identifier == identifier) {\r\n this.checkBoxesSkillLevels[i].setSpanValue(newValue);\r\n this.hideZeroCounts(this.checkBoxesSkillLevels[i], newValue);\r\n }\r\n }\r\n }\r\n // hideZeroCounts\r\n hideZeroCounts(axCheckBox: AxCheck, newValue: string) {\r\n let i: number = + newValue;\r\n\r\n if (i == 0) {\r\n axCheckBox.hideCheckBox();\r\n } else {\r\n axCheckBox.showCheckBox();\r\n }\r\n }\r\n // setupResetButtons\r\n setupResetButtons() {\r\n this.setupDesktopResetButton();\r\n this.setupMobileResetButton();\r\n }\r\n // setupDesktopResetButton\r\n setupDesktopResetButton() {\r\n document.querySelector('.compPack_filter_reset_btn_activity').addEventListener('click', (e: Event) => this.resetActivityFilter(true));\r\n document.querySelector('.compPack_filter_reset_btn_content').addEventListener('click', (e: Event) => this.resetContentFilter(true));\r\n document.querySelector('.compPack_filter_reset_btn_duration').addEventListener('click', (e: Event) => this.resetDurationFilter(true));\r\n document.querySelector('.compPack_filter_reset_btn_age').addEventListener('click', (e: Event) => this.resetAgeFilter(true));\r\n document.querySelector('.compPack_filter_reset_btn_skiLevel').addEventListener('click', (e: Event) => this.resetSkiLevelFilter(true));\r\n document.querySelector('.compPack_filter_reset_btn_price').addEventListener('click', (e: Event) => this.resetPriceFilter());\r\n document.querySelector('.compPack_filter_reset_btn_all').addEventListener('click', (e: Event) => this.resetAllFilters());\r\n }\r\n // setupMobileResetButton\r\n setupMobileResetButton() {\r\n document.querySelector('.compack_filter_mobile_content .compPack_filter_reset_btn_activity').addEventListener('click', (e: Event) => this.resetActivityFilter(true));\r\n document.querySelector('.compack_filter_mobile_content .compPack_filter_reset_btn_content').addEventListener('click', (e: Event) => this.resetContentFilter(true));\r\n document.querySelector('.compack_filter_mobile_content .compPack_filter_reset_btn_duration').addEventListener('click', (e: Event) => this.resetDurationFilter(true));\r\n document.querySelector('.compack_filter_mobile_content .compPack_filter_reset_btn_age').addEventListener('click', (e: Event) => this.resetAgeFilter(true));\r\n document.querySelector('.compack_filter_mobile_content .compPack_filter_reset_btn_skiLevel').addEventListener('click', (e: Event) => this.resetSkiLevelFilter(true));\r\n document.querySelector('.compack_filter_mobile_content .compPack_filter_reset_btn_price').addEventListener('click', (e: Event) => this.resetPriceFilter());\r\n document.querySelector('.lessones_filter_mobile_holder .lessons_filter_molbile_close_button').addEventListener('click', (e: Event) => this.resetAllFilters());\r\n }\r\n // resetActivityFilter\r\n resetActivityFilter(reload: boolean) {\r\n for (let i = 0; i < this.checkBoxesActivity.length; i++) {\r\n this.checkBoxesActivity[i].resetCheckBox();\r\n }\r\n\r\n if (reload) {\r\n this.loadFilteredResults();\r\n }\r\n }\r\n // resetContentFilter\r\n resetContentFilter(reload: boolean) {\r\n for (let i = 0; i < this.checkBoxesContent.length; i++) {\r\n this.checkBoxesContent[i].resetCheckBox();\r\n }\r\n\r\n if (reload) {\r\n this.loadFilteredResults();\r\n }\r\n }\r\n // resetDurationFilter\r\n resetDurationFilter(reload: boolean) {\r\n for (let i = 0; i < this.checkBoxesDuration.length; i++) {\r\n this.checkBoxesDuration[i].resetCheckBox();\r\n }\r\n\r\n if (reload) {\r\n this.loadFilteredResults();\r\n }\r\n }\r\n // resetAgeFilter\r\n resetAgeFilter(reload: boolean) {\r\n for (let i = 0; i < this.checkBoxesAgeGroups.length; i++) {\r\n this.checkBoxesAgeGroups[i].resetCheckBox();\r\n }\r\n\r\n if (reload) {\r\n this.loadFilteredResults();\r\n }\r\n }\r\n // resetSkiLevelFilter\r\n resetSkiLevelFilter(reload: boolean) {\r\n for (let i = 0; i < this.checkBoxesSkillLevels.length; i++) {\r\n this.checkBoxesSkillLevels[i].resetCheckBox();\r\n }\r\n\r\n if (reload) {\r\n this.loadFilteredResults();\r\n }\r\n }\r\n // resetPriceFilter\r\n resetPriceFilter() {\r\n this.rangeSliderDesktop.data(\"ionRangeSlider\").reset();\r\n this.rangeSliderMobile.data(\"ionRangeSlider\").reset();\r\n }\r\n // resetAllFilters\r\n resetAllFilters() {\r\n this.resetActivityFilter(false);\r\n this.resetContentFilter(false);\r\n this.resetDurationFilter(false);\r\n this.resetAgeFilter(false);\r\n this.resetSkiLevelFilter(false);\r\n this.resetPriceFilter();\r\n }\r\n}\r\n", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\n\r\n@ModuleName(\"ComplexPackageSelection\")\r\nexport class ComplexPackageSelection implements AxInit {\r\n\r\n axLoading: AxLoading;\r\n private url: string;\r\n\r\n AxInit(init: any): void {\r\n this.axLoading = new AxLoading();\r\n this.url = init.url;\r\n\r\n this.setClickEvents();\r\n }\r\n\r\n setClickEvents() {\r\n $('.compPack_result_item').click((e) => {\r\n $('.compPack_result_item').each((i, obj) => {\r\n this.axLoading.HideLoadingIndicator(obj);\r\n });\r\n\r\n let body = $('.compPacks_selection_body')[0];\r\n\r\n this.axLoading.ShowLoadingIndicatorFixed(body);\r\n\r\n const packageId = $(e.currentTarget).attr('data-packageId');\r\n const tariffSheetId = $(e.currentTarget).attr('data-tariffSheetId');\r\n\r\n window.location.href = this.url + '?tariffSheetId=' + tariffSheetId + '&packageId=' + packageId;\r\n });\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxDatePicker, Cell, Mode } from \"../../Components/AxDatepicker/AxDatepicker\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport Swal from \"sweetalert2\";\r\n\r\n@ModuleName(\"ComplexPackageDetails\")\r\nexport class ComplexPackageDetails implements AxInit {\r\n\r\n protected axLoading: AxLoading;\r\n\r\n protected datePicker: AxDatePicker;\r\n protected datePickerMobile: AxDatePicker;\r\n\r\n protected dateDropdown: AxDropdown = new AxDropdown();\r\n protected dateMobileDropdown: AxDropdown = new AxDropdown();\r\n\r\n protected activateDate: moment.Moment = null;\r\n protected datePattern: string;\r\n protected projNr: number;\r\n protected packageId: number;\r\n protected tariffSheetId: number;\r\n protected selectedSoapDate: string;\r\n protected userLoggedIn: boolean;\r\n\r\n private selectedBookingDateKey: string = \"selectedCompackBookingDate\";\r\n\r\n constructor(private _I18nHelper = new I18nHelper()) { }\r\n\r\n AxInit(initData: ICompPackDetailsInitData): void {\r\n this.axLoading = new AxLoading();\r\n\r\n const that = this;\r\n\r\n window.addEventListener('pageshow', function (event) {\r\n if (event.persisted) {\r\n that.axLoading.HideLoadingIndicator($('.compPack_details_body')[0]);\r\n }\r\n });\r\n\r\n this.dateDropdown.init('.prod_selection__date-selection .ax-dropdown');\r\n this.dateMobileDropdown.init('.compPack-searchbar__date-selection-mobile .ax-dropdown');\r\n\r\n this.datePattern = initData.datePatternYear;\r\n this.projNr = initData.projNr;\r\n this.packageId = initData.packageId;\r\n this.tariffSheetId = initData.tariffSheetId;\r\n this.userLoggedIn = JSON.parse(initData.userLoggedIn);\r\n\r\n let selectedCompackBookingDate = localStorage.getItem(this.selectedBookingDateKey);\r\n\r\n // check if this is a redirect after login\r\n // if yes -> use date from localstorage and proceed to booking options\r\n if (selectedCompackBookingDate) {\r\n\r\n let selectedDateMoment = moment(selectedCompackBookingDate);\r\n this.activateDate = selectedDateMoment;\r\n const formattedDate = selectedDateMoment.format(this.datePattern);\r\n this.dateDropdown.setValue(formattedDate);\r\n this.dateMobileDropdown.setValue(formattedDate);\r\n\r\n const selectedSoapDateTemp = this.activateDate.format('YYYY-MM-DD');\r\n this.selectedSoapDate = selectedSoapDateTemp;\r\n\r\n localStorage.removeItem(this.selectedBookingDateKey);\r\n\r\n this.bookingOptions();\r\n }\r\n\r\n $('[data-booking-btn]').prop(\"disabled\", true); \r\n\r\n // if no first valid date was found\r\n if (initData.startDate === '') {\r\n Swal.fire({\r\n title: 'Problem occurred',\r\n text: 'Product not availeable. Please contact the support.',\r\n icon: 'error',\r\n showCancelButton: false,\r\n confirmButtonText: 'Ok'\r\n }).then((result) => {\r\n\r\n });\r\n\r\n return;\r\n }\r\n\r\n this.addDatePickerListener(initData);\r\n\r\n $('[data-booking-btn]').on('click', () => this.bookingOptions());\r\n\r\n window.addEventListener('mouseup', event => {\r\n const target = event.target as HTMLInputElement;\r\n this.closeOpenSelectors(target);\r\n });\r\n }\r\n\r\n // addDatePickerListener\r\n addDatePickerListener(initData: ICompPackDetailsInitData) {\r\n const endDate = initData.endDate != null ? moment(initData.endDate, \"YYYY-MM-DD\") : null;\r\n const startDate = moment(initData.startDate, \"YYYY-MM-DD\");\r\n\r\n $('.prod_selection__date-selection').click(x => {\r\n\r\n this.initDatePicker(initData, endDate, startDate);\r\n $('.compPack_details_package_includes_datePickerWrapper').addClass('active');\r\n $('.prod_selection__date-wrapper').toggleClass('active');\r\n });\r\n\r\n $('.compPack-searchbar__date-selection-mobile').click(x => {\r\n this.initDatePickerMobile(initData, endDate, startDate);\r\n\r\n $('.compPack_searchBar-datePicker-wrapper-mobile').toggleClass('active');\r\n $('body').addClass('overflow-hidden');\r\n });\r\n\r\n $('.compPack-datePicker-close-btn').click(x => {\r\n $('.compPack_searchBar-datePicker-wrapper-mobile').removeClass('active');\r\n });\r\n }\r\n\r\n // initDatePicker\r\n initDatePicker(initData: ICompPackDetailsInitData, endDate: moment.Moment, startDate: moment.Moment) {\r\n if (this.datePicker != null) {\r\n return;\r\n }\r\n\r\n this.datePicker = new AxDatePicker();\r\n\r\n this.datePicker.Init({\r\n StartOfWeek: initData.startOfWeek,\r\n Lang: initData.lang,\r\n StartDate: startDate,\r\n Target: '#arrival_date',\r\n Mode: Mode.Inline,\r\n EndDate: endDate,\r\n OnChange: (x, y) => { return this.onChangeDate(x, y) },\r\n OnlySelectDates: true\r\n });\r\n\r\n this.datePicker.ActivationSubject.subscribe(x => this.checkDate(x));\r\n }\r\n\r\n\r\n // compPack_searchBar-datePicker-wrapper-mobile\r\n\r\n // initDatePickerMobile\r\n initDatePickerMobile(initData: ICompPackDetailsInitData, endDate: moment.Moment, startDate: moment.Moment) {\r\n if (this.datePickerMobile != null) {\r\n return;\r\n }\r\n\r\n this.datePickerMobile = new AxDatePicker();\r\n\r\n this.datePickerMobile.Init({\r\n StartOfWeek: initData.startOfWeek,\r\n Lang: initData.lang,\r\n StartDate: moment(initData.startDate, \"YYYY-MM-DD\"),\r\n DayRange: 2,\r\n Target: '#tariff_date_mobile',\r\n Mode: Mode.Endless,\r\n LegendTarget: '#tariff_date_mobile__legend',\r\n EndDate: endDate,\r\n OnChange: (x, y) => { return this.onChangeMobileDate(x, y) },\r\n OnlySelectDates: true\r\n });\r\n\r\n this.datePickerMobile.ActivationSubject.subscribe(x => this.checkDateMobile(x));\r\n }\r\n\r\n // closeOpenSelectors\r\n closeOpenSelectors(clickedElement: HTMLElement) {\r\n const locationSelect = $(\".compPack_details_package_includes_datePickerWrapper\");\r\n if (!locationSelect.is(clickedElement) && locationSelect.has(clickedElement).length === 0) {\r\n if ($('.compPack_details_package_includes_datePickerWrapper').hasClass('active')) {\r\n $('.compPack_details_package_includes_datePickerWrapper').removeClass('active');\r\n }\r\n\r\n $('body').removeClass('overflow-hidden');\r\n }\r\n }\r\n\r\n // onChangeDate\r\n onChangeDate(startDate: moment.Moment, endDate: moment.Moment): Promise<void> {\r\n return new Promise<void>((res, rej) => {\r\n const availableDates: moment.Moment[] = [];\r\n this.checkAvailability(startDate, endDate);\r\n this.datePicker.Options.AvailableDates = availableDates;\r\n res();\r\n });\r\n }\r\n\r\n // onChangeMobileDate\r\n onChangeMobileDate(startDate: moment.Moment, endDate: moment.Moment): Promise<void> {\r\n return new Promise<void>((res, rej) => {\r\n const availableDates: moment.Moment[] = [];\r\n this.checkAvailability(startDate, endDate);\r\n this.datePickerMobile.Options.AvailableDates = availableDates;\r\n res();\r\n });\r\n }\r\n\r\n // bookingOptions\r\n bookingOptions() {\r\n let body = $('.compPack_details_body')[0];\r\n this.axLoading.ShowLoadingIndicatorFixed(body);\r\n\r\n let url = $(\"#bookingOptionsLinkHidden\").val().toString();\r\n url = url.replace('_soaPDate', this.selectedSoapDate);\r\n window.location.href = url;\r\n }\r\n\r\n // checkDate\r\n checkDate(x: Cell) {\r\n if (x != null) {\r\n this.activateDate = x.Date;\r\n const formattedDate = this.activateDate.format(this.datePattern);\r\n this.dateDropdown.setValue(formattedDate);\r\n\r\n $('.compPack_details_package_includes_datePickerWrapper').removeClass('active');\r\n\r\n const selectedSoapDateTemp = this.activateDate.format('YYYY-MM-DD');\r\n\r\n $('[data-booking-btn=\"desktop\"]').html(`${this._I18nHelper.GetTranslation(Translations.BookNow)}`);\r\n $('[data-booking-btn=\"desktop\"]').prop(\"disabled\", false); \r\n this.selectedSoapDate = selectedSoapDateTemp;\r\n\r\n } else {\r\n this.dateDropdown.resetSelection();\r\n this.activateDate = null;\r\n }\r\n }\r\n\r\n // checkDateMobile\r\n checkDateMobile(cell: Cell) {\r\n if (cell != null) {\r\n this.activateDate = cell.Date;\r\n const formattedDate = this.activateDate.format(this.datePattern);\r\n this.dateMobileDropdown.setValue(formattedDate);\r\n\r\n $('.compPack_searchBar-datePicker-wrapper-mobile').removeClass('active');\r\n\r\n const selectedSoapDateTemp = this.activateDate.format('YYYY-MM-DD');\r\n\r\n $('[data-booking-btn=\"mobile\"]').html(`${this._I18nHelper.GetTranslation(Translations.BookNow)}`);\r\n $('[data-booking-btn=\"mobile\"]').prop(\"disabled\", false);\r\n this.selectedSoapDate = selectedSoapDateTemp;\r\n\r\n this.dateMobileDropdown.jumpToElement();\r\n } else {\r\n this.dateMobileDropdown.jumpToElement();\r\n this.activateDate = null;\r\n }\r\n }\r\n\r\n // checkAvailability\r\n checkAvailability(fromDate: moment.Moment, toDate: moment.Moment) {\r\n const data = {\r\n arcNr: null,\r\n soapFromDate: fromDate.format('YYYY-MM-DD'),\r\n soapToDate: toDate.format('YYYY-MM-DD'),\r\n projNr: this.projNr,\r\n tariffSheetId: this.tariffSheetId,\r\n packageId: this.packageId\r\n };\r\n\r\n this.axLoading.ShowLoadingIndicator($('.compPack_details_package_includes_datePickerWrapper')[0]);\r\n this.axLoading.ShowLoadingIndicator($('.prod_selection__scrollable')[0]);\r\n\r\n AxessViewer.ajaxRequest('/api/ComplexPackagesValidDaysApi/GetValidDaysCompPack', data, response => {\r\n for (let i = 0; i < response.Days.length; i++) {\r\n\r\n const dateTemp = response.Days[i];\r\n\r\n if (!dateTemp.IsValid || !dateTemp.IsStartDay || dateTemp.TicketsAvailable < 1) {\r\n\r\n const momentDate = moment(dateTemp.Date);\r\n\r\n if (this.datePicker != null) {\r\n this.datePicker.BlockDate(momentDate);\r\n }\r\n\r\n if (this.datePickerMobile != null) {\r\n this.datePickerMobile.BlockDate(momentDate);\r\n }\r\n }\r\n }\r\n\r\n this.axLoading.HideLoadingIndicator($('.compPack_details_package_includes_datePickerWrapper')[0]);\r\n this.axLoading.HideLoadingIndicator($('.prod_selection__scrollable')[0]);\r\n\r\n }, null);\r\n }\r\n}\r\n\r\nexport interface ICompPackDetailsInitData {\r\n startOfWeek: number;\r\n lang: string;\r\n startDate: string;\r\n endDate?: string;\r\n postUrl: string;\r\n datePattern: string;\r\n datePatternYear: string;\r\n checkDateLink: string;\r\n projNr: number;\r\n packageId: number;\r\n tariffSheetId: number;\r\n userLoggedIn: string;\r\n}", "import { AxDropdown } from \"@axess/limestone\";\r\nimport Swal from \"sweetalert2\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { CompPackBookingValues } from \"../../Models/ComplexPackages/BookingOptions/CompPackBookingValues\";\r\nimport { BookingTimeSlotInfo } from \"../../Models/ComplexPackages/BookingTimeSlotInfo\";\r\nimport { CompPackBookingPersonOptions } from \"./BookingOptions/CompPackBookingPersonOptions\";\r\nimport { ComplexPackageBookingTicketsOptions } from \"./BookingOptions/ComplexPackageBookingTicketsOptions\";\r\n\r\n@ModuleName(\"ComplexPackageBookingOptions\")\r\nexport class ComplexPackageBookingOptions implements AxInit {\r\n dropDowns = new Array<AxDropdown>();\r\n bookingValues: CompPackBookingValues;\r\n\r\n private axLoading: AxLoading;\r\n private i18NHelper: I18nHelper;\r\n private shoppingCartUrl: string;\r\n\r\n AxInit(init: initData): void {\r\n this.axLoading = new AxLoading();\r\n this.i18NHelper = new I18nHelper();\r\n this.shoppingCartUrl = init.shoppingCartUrl;\r\n\r\n // object for addToCart\r\n this.bookingValues = new CompPackBookingValues(init.projNr, init.packageId, init.tariffSheetId, init.startSoapDate, init.endSoapDate);\r\n\r\n $('#compPackAddToCartBtn').on('click', () => this.addToCart(this.bookingValues));\r\n }\r\n\r\n getDropDownBySelector(selector: string): AxDropdown {\r\n return this.dropDowns.find((i) => i.getSelector() === selector);\r\n }\r\n\r\n validateInputs() {\r\n const bookingModule = AxLoad.GetModule<ComplexPackageBookingTicketsOptions>(\"ComplexPackageBookingTicketsOptions\");\r\n const $personDropdown = this.getDropDownBySelector('.prod_selection__person-selection .ax-dropdown');\r\n const $lessonOptionHolder = $(document).find('#lessonOptionsHolder');\r\n const $lessonProgramDropdown = this.getDropDownBySelector('.prod_selection__lessonProgramSlot-selection .ax-dropdown');\r\n const isLesson = $('#lessonOptionsHolder').children().length > 0 && $('#optionTimeslotSelectButton').length > 0;\r\n const isRentalOptionsHolder = $('#rentalOptionsHolder').length > 0;\r\n const $skillLevelPillHolder = $('.compPack_User_SkillLevel_pillHolder');\r\n const $genderDropdown = this.getDropDownBySelector('.prod_selection__gender-selection .ax-dropdown');\r\n const $heightDropdown = this.getDropDownBySelector('.prod_selection__height-selection .ax-dropdown');\r\n const $weightDropdown = this.getDropDownBySelector('.prod_selection__weight-selection .ax-dropdown');\r\n const $shoeSizeDropdown = this.getDropDownBySelector('.prod_selection__shoeSize-selection .ax-dropdown');\r\n let valid: boolean = true;\r\n\r\n // person select\r\n if (!$personDropdown || !$personDropdown.validate()) {\r\n valid = false;\r\n }\r\n\r\n // Timeslots ticket\r\n this.bookingValues?.ticketOrderValues?.forEach((ticket) => {\r\n const elementName = `#compPack_products_ticket_holder_${ticket.projNr}_${ticket.poolNr}_${ticket.ticketTypeNr}`;\r\n const $element = $(elementName);\r\n\r\n const bookingRequiredList: BookingTimeSlotInfo = bookingModule.bookingTimeSlotInfos.find((timeSlot) => (\r\n timeSlot.packagePositionNr === ticket.packagePositionNr\r\n ));\r\n\r\n if (bookingRequiredList && ticket.selectedTimeSlots?.length !== bookingRequiredList.requiredTimeSlots?.length) {\r\n $element.addClass('ax-form-group invalid-form');\r\n valid = false;\r\n this.jumpToSelector(elementName);\r\n } else {\r\n $element.removeClass('ax-form-group invalid-form');\r\n }\r\n });\r\n\r\n if ($lessonOptionHolder.length > 0 && $lessonProgramDropdown && this.bookingValues.lessonProgramOrderValues?.length == 0) {\r\n valid = false;\r\n this.jumpToSelector('.prod_selection__lessonProgramSlot-selection .ax-dropdown');\r\n }\r\n\r\n if ($('[data-cp-lessons=\"out\"]').length > 0) {\r\n valid = false;\r\n }\r\n \r\n // timeslots lesson\r\n if (isLesson) {\r\n const $timeSlotSelectButton = $('#optionTimeslotSelectButton');\r\n const isTimeSlotSelected = $timeSlotSelectButton.find('span.ax-dropdown__selection').text().length > 0;\r\n valid = valid && isTimeSlotSelected;\r\n }\r\n\r\n // rental pills\r\n if (isRentalOptionsHolder && !this.bookingValues.skillLevel) {\r\n $skillLevelPillHolder.addClass('ax-form-group invalid-form');\r\n valid = false;\r\n this.jumpToSelector('#rentalOptionsHolder');\r\n } else {\r\n $skillLevelPillHolder.removeClass('ax-form-group invalid-form');\r\n }\r\n\r\n // rental dropdowns\r\n if ($genderDropdown && !$genderDropdown?.validate()) {\r\n valid = false;\r\n this.jumpToSelector('.prod_selection__gender-selection .ax-dropdown');\r\n }\r\n\r\n if ($heightDropdown && !$heightDropdown.validate()) {\r\n valid = false;\r\n this.jumpToSelector('.prod_selection__height-selection .ax-dropdown');\r\n }\r\n\r\n if ($weightDropdown && !$weightDropdown?.validate()) {\r\n valid = false;\r\n this.jumpToSelector('.prod_selection__weight-selection .ax-dropdown');\r\n }\r\n\r\n if ($shoeSizeDropdown && !$shoeSizeDropdown.validate()) {\r\n valid = false;\r\n this.jumpToSelector('.prod_selection__shoeSize-selection .ax-dropdown');\r\n }\r\n\r\n return valid;\r\n }\r\n\r\n jumpToSelector(selector: string) {\r\n $([document.documentElement, document.body]).animate({\r\n scrollTop: $(selector).offset()?.top - 100\r\n }, 100);\r\n }\r\n\r\n addToCart(bookingValues: CompPackBookingValues) {\r\n if (!this.validateInputs()) {\r\n return;\r\n }\r\n\r\n const personModule = AxLoad.GetModule<CompPackBookingPersonOptions>(\"CompPackBookingPersonOptions\");\r\n personModule.setLessonPropsToBookingOptions();\r\n\r\n this.axLoading.ShowLoadingIndicatorFixed($('.compPack_bookingOptions_body')?.get(0));\r\n\r\n bookingValues.ticketOrderValues.forEach((ticketEntry) => {\r\n ticketEntry.timeSlotKeys = ticketEntry?.selectedTimeSlots?.map((timeSlot) => timeSlot.timeSlotKey) || [];\r\n });\r\n\r\n const data = JSON.parse(JSON.stringify(bookingValues || {}) || '{}');\r\n AxessViewer.loadPartialView('/ComplexPackagesBooking/AddComplexPackageToCart', data, (result: any) => {\r\n const comPackBookingResult: ComPackBookingResult = JSON.parse(result || '{}');\r\n\r\n if (!comPackBookingResult.success) {\r\n this.axLoading.HideLoadingIndicator($('.compPack_bookingOptions_body')?.get(0));\r\n Swal.fire({\r\n title: this.i18NHelper.GetTranslation(Translations.Error),\r\n icon: 'warning',\r\n html: comPackBookingResult.errorMsg,\r\n });\r\n } else {\r\n AxLoad.LoadModule('AxGA4Module', {\r\n caller: 'Add to Cart',\r\n event: 'Add to Cart',\r\n }).then(() => window.location.href = this.shoppingCartUrl);\r\n }\r\n }, {\r\n dataType: 'html',\r\n });\r\n }\r\n}\r\n\r\nclass ComPackBookingResult {\r\n success: boolean;\r\n errorMsg: string;\r\n}\r\n\r\nexport interface initData {\r\n projNr: number;\r\n packageId: number;\r\n tariffSheetId: number;\r\n startSoapDate: string;\r\n endSoapDate: string;\r\n shoppingCartUrl: string;\r\n lessonOrderValues: string;\r\n}\r\n", "import { CompPackOrderTicketValues } from \"./CompPackOrderTicketValues\";\r\nimport { CompPackOrderRentalValues } from \"./CompPackOrderRentalValues\";\r\nimport { CompPackOrderLessonProgramValues } from \"./CompPackOrderLessonProgramValues\";\r\nimport { CompPackOrderLessonValues } from \"./CompPackOrderLessonValues\";\r\nimport { LessonProperty } from \"../../../Modules/Account/CustomerLessonProperties\";\r\n\r\nexport class CompPackBookingValues {\r\n constructor(projNr: number, packageId: number, tariffSheetId: number, soapDateStart: string, soapDateEnd: string) {\r\n this.projNr = projNr;\r\n this.packageId = packageId;\r\n this.tariffSheetId = tariffSheetId;\r\n this.soapDateStart = soapDateStart;\r\n this.soapDateEnd = soapDateEnd;\r\n this.ticketOrderValues = new Array<CompPackOrderTicketValues>();\r\n this.rentalOrderValues = new Array<CompPackOrderRentalValues>();\r\n this.additionalRentalOrderValues = new Array<CompPackOrderRentalValues>();\r\n this.lessonProgramOrderValues = new Array<CompPackOrderLessonProgramValues>();\r\n this.lessonOrderValues = new Array<CompPackOrderLessonValues>();\r\n }\r\n\r\n projNr: number;\r\n packageId: number;\r\n tariffSheetId: number;\r\n soapDateStart: string;\r\n soapDateEnd: string;\r\n\r\n accountId: number;\r\n gender: string;\r\n height: number;\r\n weight: number;\r\n shoeSize: number;\r\n skillLevel: number;\r\n pickupLocationId: number;\r\n\r\n lessonAllergies: LessonProperty[] = [];\r\n lessonMedicals: LessonProperty[] = [];\r\n lessonLanguages: LessonProperty[] = [];\r\n lessonLevels: LessonProperty[] = [];\r\n\r\n ticketOrderValues: CompPackOrderTicketValues[];\r\n rentalOrderValues: CompPackOrderRentalValues[];\r\n additionalRentalOrderValues: CompPackOrderRentalValues[];\r\n lessonProgramOrderValues: CompPackOrderLessonProgramValues[];\r\n lessonOrderValues: CompPackOrderLessonValues[];\r\n}", "import { ITimeSlot } from \"../../Reservation/TimeSlot\";\r\nimport { TimeSlotKey } from \"../../Reservation/TimeSlotKey\";\r\n\r\nexport class CompPackOrderTicketValues {\r\n\r\n constructor(projNr: number, ticketTypeNr: number, poolNr: number, personTypeNr: number, packagePositionNr: number, hasTimeSlots?: boolean, timeSlotKeys?: TimeSlotKey[]) {\r\n this.projNr = projNr;\r\n this.ticketTypeNr = ticketTypeNr;\r\n this.poolNr = poolNr;\r\n this.personTypeNr = personTypeNr;\r\n this.packagePositionNr = packagePositionNr;\r\n this.selectedTimeSlots = [];\r\n this.hasTimeSlots = hasTimeSlots;\r\n this.timeSlotKeys = timeSlotKeys;\r\n }\r\n\r\n projNr: number;\r\n ticketTypeNr: number;\r\n poolNr: number;\r\n personTypeNr: number;\r\n packagePositionNr: number;\r\n hasTimeSlots: boolean;\r\n selectedTimeSlots?: ITimeSlot[];\r\n timeSlotKeys?: TimeSlotKey[];\r\n}", "import { BehaviorSubject, Subject } from 'rxjs';\r\nimport { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { AxLimeStone } from \"../../../Limestone/AxLimeStone\";\r\nimport { AxTab } from \"../../../Limestone/AxPortlet/AxTab\";\r\nimport { CompPackOrderTicketValues } from \"../../../Models/ComplexPackages/BookingOptions/CompPackOrderTicketValues\";\r\nimport { BookingTimeSlotInfo } from \"../../../Models/ComplexPackages/BookingTimeSlotInfo\";\r\nimport { ITimeSlot, TimeSlotEntry } from \"../../../Models/Reservation/TimeSlot\";\r\nimport { TimeSlotDay } from \"../../../Models/Reservation/TimeSlotDay\";\r\nimport { TimeSlotKey } from \"../../../Models/Reservation/TimeSlotKey\";\r\nimport { TicketType } from \"../../../Models/Tickets/TicketType\";\r\nimport { ComplexPackageBookingOptions } from \"../ComplexPackageBookingOptions\";\r\n\r\n@ModuleName(\"ComplexPackageBookingTicketsOptions\")\r\nexport class ComplexPackageBookingTicketsOptions implements AxInit {\r\n protected ticketTypes: TicketType[];\r\n protected datePattern: string;\r\n protected complexPackageBookingOptions: ComplexPackageBookingOptions;\r\n\r\n public InteractionSubject: BehaviorSubject<Element> = new BehaviorSubject(null);\r\n public SubmitSubject: Subject<Element> = new Subject<Element>();\r\n public bookingTimeSlotInfos: BookingTimeSlotInfo[] = [];\r\n\r\n constructor(\r\n private _AxLimestone = new AxLimeStone(),\r\n private _AxTab = new AxTab(),\r\n ) { }\r\n\r\n AxInit(init: initData): void {\r\n this.datePattern = init.datePattern;\r\n this.ticketTypes = JSON.parse(init.ticketTypes !== '' ? init.ticketTypes : '[{}]');\r\n\r\n this.complexPackageBookingOptions = AxLoad.GetModule<ComplexPackageBookingOptions>(\"ComplexPackageBookingOptions\");\r\n\r\n this.ticketTypes.forEach((ticketType: TicketType) => this.loadTicket.call(this, ticketType));\r\n }\r\n\r\n nextTab(): void {\r\n let activeTab = $('.tv4_contingent__selection-portlet .ax-tabs li.active');\r\n $('.prod_selection__summary-next').fadeOut('fast');\r\n\r\n this._AxTab.ActivateTab(activeTab.next().attr('data-target'));\r\n }\r\n\r\n loadTicket(ticketType: TicketType): void {\r\n const {\r\n projNr,\r\n poolNr,\r\n ticketTypeNr,\r\n personTypeNr,\r\n hasTimeSlots,\r\n packagePositionNr,\r\n } = ticketType;\r\n const ticketValues = new CompPackOrderTicketValues(projNr, ticketTypeNr, poolNr, personTypeNr, packagePositionNr, hasTimeSlots);\r\n const timeSlotDayList: TimeSlotDay[] = [];\r\n const timeSlotGroupKeyList: number[] = [];\r\n const ticketsSlotsTag = `#compPack_products_ticket_holder_${ticketType.projNr}_${ticketType.poolNr}_${ticketType.ticketTypeNr}`;\r\n const $hiddenViewDataHolder = $(ticketsSlotsTag).find('.timeSlots_ViewData');\r\n const timeSlotsViewData = $($hiddenViewDataHolder).val()?.toString() || '';\r\n const timeSlotList: TimeSlotEntry[] = JSON.parse(timeSlotsViewData !== '' ? timeSlotsViewData : '[{}]');\r\n const selector: string = '.tv4_contingent__selection-portlet .ax-tabs';\r\n\r\n if (!ticketType.hasTimeSlots) {\r\n this.complexPackageBookingOptions.bookingValues.ticketOrderValues.push(ticketValues);\r\n return;\r\n }\r\n if ($(selector).length > 0) {\r\n this._AxTab.Init(selector);\r\n $('.prod_selection__selection-next-submit').on('click', () => this.nextTab());\r\n }\r\n\r\n //call constructor for class methods\r\n for (let entry of timeSlotList) {\r\n const { timeSlotKey } = entry;\r\n entry.timeSlotKey = new TimeSlotKey(timeSlotKey?.timeSlotGroupKey, timeSlotKey?.timeSlotKey1, timeSlotKey?.timeSlotKey2);\r\n }\r\n \r\n this.initTimeSlotListeners(ticketTypeNr, packagePositionNr, ticketValues.selectedTimeSlots, timeSlotList, timeSlotDayList, timeSlotGroupKeyList);\r\n\r\n this.complexPackageBookingOptions.bookingValues.ticketOrderValues.push(ticketValues);\r\n\r\n $('.product_selection__allotment_lang button').on('click', (e) => {\r\n this.activateLanguage($(e.target).data('langid'));\r\n });\r\n\r\n this.activateLanguage($('.product_selection__allotment_lang button')?.first()?.data('langid') ?? $('.product_selection__allotment_selection')?.first()?.data('langid') ?? 0);\r\n }\r\n\r\n initTimeSlotListeners(\r\n ticketTypeNo: number,\r\n packagePosNr: number,\r\n selectedTimeSlots: ITimeSlot[],\r\n timeSlotList: TimeSlotEntry[],\r\n timeSlotDayList: TimeSlotDay[],\r\n timeSlotKeyList: number[],\r\n ): void {\r\n //Only Multicontingent stuff\r\n if ($('.tv4_contingent__selection-header').length > 0) {\r\n $(`.product_selection__timeSlot_switch`).on('click', (e) => {\r\n const $currentTarget = $(e.currentTarget);\r\n const timeSlotGroupKey = Number($currentTarget.attr('data-target'));\r\n\r\n if ($currentTarget.is(':checked')) {\r\n const selectedIndex = selectedTimeSlots.findIndex((i) => i.timeSlotKey.timeSlotGroupKey == timeSlotGroupKey);\r\n\r\n if (selectedIndex > -1) {\r\n const tmpSlot = selectedTimeSlots[selectedIndex];\r\n const tmpSlotEntryTemp = this.getTimeSlot(tmpSlot.timeSlotKey, timeSlotList);\r\n this.selectNearestTimeSlots(tmpSlotEntryTemp, ticketTypeNo, selectedTimeSlots, timeSlotList, timeSlotDayList);\r\n }\r\n } else {\r\n $(`.product_selection__timeSlot_danger[data-target=\"${timeSlotGroupKey}\"]`).addClass('d-none');\r\n }\r\n });\r\n }\r\n\r\n for (let slot of timeSlotList) {\r\n const $timeButton = $('.product_selection__allotment_selection .product_selection__allotment_time-container button'\r\n + `[data-ticketNo=\"${ticketTypeNo}\"]`\r\n + `[data-timeSlotGroupKey=\"${slot.timeSlotKey.timeSlotGroupKey}\"]`\r\n + `[data-timeSlotKey1=\"${slot.timeSlotKey.timeSlotKey1}\"]`\r\n + `[data-timeSlotKey2=\"${slot.timeSlotKey.timeSlotKey2}\"]`);\r\n slot.day = moment(slot.date, 'YYYY-MM-DD');\r\n slot.elem = $timeButton?.get(0);\r\n const dayData: TimeSlotDay = {\r\n day: slot.day,\r\n timeSlotGroupKey: slot.timeSlotKey?.timeSlotGroupKey,\r\n };\r\n const selectedTimeSlot = timeSlotDayList.findIndex((timeSlotDay) => (\r\n timeSlotDay.timeSlotGroupKey == dayData.timeSlotGroupKey && timeSlotDay.day.isSame(slot.day)\r\n ));\r\n const groupKey = timeSlotKeyList.findIndex((timeSlotKey)=> timeSlotKey == dayData.timeSlotGroupKey);\r\n const oldStatus: string = $timeButton.attr('data-contingentstatus');\r\n let newStatus: string = '';\r\n\r\n if (selectedTimeSlot === -1) {\r\n timeSlotDayList.push(dayData);\r\n }\r\n if (groupKey === -1) {\r\n timeSlotKeyList.push(dayData.timeSlotGroupKey);\r\n }\r\n\r\n $timeButton.removeClass(`ax-fill-${oldStatus}-500`);\r\n $timeButton.removeClass(`ax-outline-${oldStatus}-500`);\r\n\r\n if (slot.availableSlots != 0 && slot.availableSlots >= 1) {\r\n if ((slot.availableSlots - 1) <= slot.warningThreshold) {\r\n newStatus = 'red';\r\n } else if ((slot.availableSlots - 1) <= slot.limitedThreshold) {\r\n newStatus = 'orange';\r\n } else {\r\n newStatus = 'green';\r\n }\r\n $timeButton.attr('data-contingentstatus', newStatus);\r\n\r\n if (selectedTimeSlots.filter(x => x.timeSlotKey.equal(slot.timeSlotKey)).length > 0) {\r\n $timeButton.addClass(`ax-fill-${newStatus}-500`);\r\n } else {\r\n $timeButton.addClass(`ax-outline-${newStatus}-500`);\r\n }\r\n } else {\r\n $timeButton.removeAttr('data-contingentstatus');\r\n\r\n if (selectedTimeSlots.filter(x => x.timeSlotKey.equal(slot.timeSlotKey)).length > 0) {\r\n this.deactivateContingent(slot.timeSlotKey, ticketTypeNo, selectedTimeSlots, timeSlotDayList, timeSlotList);\r\n }\r\n }\r\n }\r\n\r\n this.bookingTimeSlotInfos.push({\r\n packagePositionNr: packagePosNr,\r\n requiredTimeSlots: timeSlotDayList\r\n });\r\n\r\n $('.product_selection__allotment_selection button.ax-chip').on('click', (e) => {\r\n this.selectionContingent(e.target, ticketTypeNo, selectedTimeSlots, timeSlotList, timeSlotDayList);\r\n });\r\n }\r\n\r\n activateLanguage(langID: number): void {\r\n $(`.product_selection__allotment_lang button`).removeClass('ax-chip--active');\r\n $(`.product_selection__allotment_lang button[data-langid=${langID}]`).addClass('ax-chip--active');\r\n\r\n $('.product_selection__allotment_selection').addClass('d-none');\r\n $(`.product_selection__allotment_selection[data-langid=${langID}]`).removeClass('d-none');\r\n }\r\n\r\n deactivateContingent(\r\n timeSlotKey: TimeSlotKey,\r\n ticketTypeNo: number,\r\n selectedTimeslots: ITimeSlot[],\r\n timeSlotDayList: TimeSlotDay[],\r\n timeSlotList: TimeSlotEntry[],\r\n ): void {\r\n const index: number = selectedTimeslots.findIndex(x => x.timeSlotKey.equal(timeSlotKey));\r\n if (index > -1) {\r\n selectedTimeslots.splice(index, 1);\r\n }\r\n\r\n $('.product_selection__allotment_selection button'\r\n + `[data-ticketNo=\"${ticketTypeNo}\"]`\r\n + `[data-timeSlotGroupKey=\"${timeSlotKey.timeSlotGroupKey}\"]`\r\n + `[data-timeSlotKey1=\"${timeSlotKey.timeSlotKey1}\"]`\r\n + `[data-timeSlotKey2=\"${timeSlotKey.timeSlotKey2}\"]`).each((i, el) => {\r\n const $button: JQuery<Element> = $(el);\r\n const color: string = $button.attr('data-contingentstatus');\r\n $button.removeClass(`ax-fill-${color}-500`);\r\n });\r\n\r\n this.printSelectedContingents(selectedTimeslots, timeSlotDayList, timeSlotList);\r\n }\r\n\r\n printSelectedContingents(selectedTimeslots: ITimeSlot[], timeSlotDayList: TimeSlotDay[], timeSlotList: TimeSlotEntry[]): void {\r\n const $template = $('.product_selection__setting_timeslot--entry');\r\n $(`.product_selection__setting_timeslot`).html('');\r\n $('.product_selection__setting_timeslot--placeholder').removeClass('d-none');\r\n\r\n for (let timeSlotDay of timeSlotDayList) {\r\n const isMultiDay: boolean = timeSlotDayList.filter(x => x.timeSlotGroupKey == timeSlotDay.timeSlotGroupKey).length > 1;\r\n const selectedSlot = selectedTimeslots.filter((timeSlot) => (\r\n timeSlot.timeSlotKey.timeSlotGroupKey == timeSlotDay.timeSlotGroupKey && timeSlot.day.isSame(timeSlotDay.day)\r\n ));\r\n\r\n if (selectedSlot.length > 0) {\r\n const $entry = $template.clone();\r\n let label = '';\r\n $(`#tv4_side__selection-tab > div[data-target=\"${timeSlotDay.timeSlotGroupKey}\"] .product_selection__setting_timeslot--placeholder`).addClass('d-none');\r\n const timeslot = this.getTimeSlot(selectedSlot[0].timeSlotKey, timeSlotList);\r\n if (isMultiDay) {\r\n label += `${timeslot.day.format(this.datePattern)}, `;\r\n }\r\n label += timeslot.elem.innerHTML;\r\n\r\n $entry.removeClass('d-none product_selection__setting_timeslot--entry').html(label);\r\n $(`#tv4_side__selection-tab > div[data-target=\"${timeSlotDay.timeSlotGroupKey}\"] .product_selection__setting_timeslot`).append($entry);\r\n }\r\n }\r\n }\r\n\r\n getTimeSlot(timeSlotKey: TimeSlotKey, timeSlotList: TimeSlotEntry[]): TimeSlotEntry {\r\n return timeSlotList.find((el) => el.timeSlotKey.equal(timeSlotKey));\r\n }\r\n\r\n checkSuballotmentQuantity(timeSlotKey: TimeSlotKey, timeSlotList: TimeSlotEntry[]): boolean {\r\n const sumQuantity: number = 1;\r\n const subC = this.getTimeSlot(timeSlotKey, timeSlotList);\r\n\r\n return subC?.availableSlots >= sumQuantity;\r\n }\r\n\r\n selectNearestTimeSlots(\r\n timeslot: TimeSlotEntry,\r\n ticketTypeNo: number,\r\n selectedTimeSlots: ITimeSlot[],\r\n timeSlotList: TimeSlotEntry[],\r\n timeSlotDayList: TimeSlotDay[],\r\n ): void {\r\n const time = timeslot.time;\r\n const timeSlotByDay = timeSlotDayList.filter((timeSlot) => (\r\n timeSlot.timeSlotGroupKey == timeslot?.timeSlotKey.timeSlotGroupKey\r\n && timeSlot?.day?.format('YYYY-MM-DD') !== timeslot.date\r\n ));\r\n let nearestTimeSlot: TimeSlotEntry;\r\n let alwaysSame = true;\r\n\r\n for (let slotDay of timeSlotByDay) {\r\n const timeSlotGroupSameDay = timeSlotList.filter((slot) => (\r\n slot?.timeSlotKey.timeSlotGroupKey == slotDay.timeSlotGroupKey && slot?.day?.isSame(slotDay?.day)\r\n ));\r\n let currentOffset = 9999;\r\n\r\n for (let tmpSlot of timeSlotGroupSameDay) {\r\n let offset = time - tmpSlot.time;\r\n if (offset < 0) {\r\n offset = offset * -1;\r\n }\r\n\r\n if (offset < currentOffset && this.checkSuballotmentQuantity(tmpSlot.timeSlotKey, timeSlotList)) {\r\n nearestTimeSlot = tmpSlot;\r\n currentOffset = offset;\r\n\r\n if (offset == 0) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (currentOffset != 0) {\r\n alwaysSame = false;\r\n }\r\n\r\n this.selectionContingent(nearestTimeSlot.elem, ticketTypeNo, selectedTimeSlots, timeSlotList, timeSlotDayList, false);\r\n }\r\n $(`.product_selection__timeslot_danger[data-target=\"${timeslot.timeSlotKey.timeSlotGroupKey}\"]`).toggleClass('d-none', alwaysSame);\r\n }\r\n\r\n selectionContingent(\r\n e: Element,\r\n ticketTypeNo: number,\r\n selectedTimeSlots: ITimeSlot[],\r\n timeSlotList: TimeSlotEntry[],\r\n timeSlotDayList: TimeSlotDay[],\r\n triggerChecks: boolean = true,\r\n ): void {\r\n const $elem: JQuery<Element> = $(e);\r\n const color: string = $elem.attr('data-contingentstatus');\r\n const timeSlotGroupKey: number = Number($elem.attr('data-timeSlotGroupKey'));\r\n const timeSlotKey1: string = $elem.attr('data-timeSlotKey1');\r\n const timeSlotKey2: number = Number($elem.attr('data-timeSlotKey2'));\r\n const timeSlotKey: TimeSlotKey = new TimeSlotKey(timeSlotGroupKey, timeSlotKey1, timeSlotKey2);\r\n const checkSuballotmentQuantity = this.checkSuballotmentQuantity(timeSlotKey, timeSlotList);\r\n const $activeTab = $('.tv4_contingent__selection-portlet .ax-tabs li.active');\r\n\r\n if (checkSuballotmentQuantity) {\r\n const currentTimeSlot = this.getTimeSlot(timeSlotKey, timeSlotList);\r\n selectedTimeSlots\r\n .filter((selected) => (\r\n selected?.timeSlotKey.timeSlotGroupKey == timeSlotGroupKey && selected?.day?.isSame(currentTimeSlot.day))\r\n )\r\n .forEach((timeSlot) => {\r\n const $productSelection = $('.product_selection__allotment_selection button'\r\n + `[data-timeSlotGroupKey=\"${timeSlot.timeSlotKey.timeSlotGroupKey}\"]`\r\n + `[data-timeSlotKey1=\"${timeSlot.timeSlotKey.timeSlotKey1}\"]`\r\n + `[data-timeSlotKey2=\"${timeSlot.timeSlotKey.timeSlotKey2}\"]`);\r\n const productSelectionColor: string = $productSelection.attr('data-contingentstatus');\r\n $productSelection.removeClass(`ax-fill-${productSelectionColor}-500`).addClass(`ax-outline-${productSelectionColor}-500`);\r\n });\r\n\r\n const index: number = selectedTimeSlots.findIndex((selected) => (\r\n selected.timeSlotKey?.timeSlotGroupKey == timeSlotGroupKey && selected?.day?.isSame(currentTimeSlot.day))\r\n );\r\n if (index > -1) {\r\n selectedTimeSlots.splice(index, 1);\r\n }\r\n\r\n selectedTimeSlots.push({\r\n timeSlotKey: timeSlotKey,\r\n day: currentTimeSlot.day,\r\n time: currentTimeSlot.time\r\n });\r\n\r\n this.printSelectedContingents(selectedTimeSlots, timeSlotDayList, timeSlotList);\r\n $elem.removeClass(`ax-outline-${color}-500`).addClass(`ax-fill-${color}-500`);\r\n\r\n const isChecked = $(`.product_selection__timeSlot_switch[data-target=\"${timeSlotGroupKey}\"]`).prop('checked');\r\n if (isChecked && triggerChecks) {\r\n this.selectNearestTimeSlots(currentTimeSlot, ticketTypeNo, selectedTimeSlots, timeSlotList, timeSlotDayList);\r\n }\r\n }\r\n \r\n if ($activeTab.length > 0) {\r\n if (!$activeTab.is(':last-child')) {\r\n const configActiveTab = Number($activeTab.attr('data-target'));\r\n const timeSlotSelected = selectedTimeSlots.filter((timeSlot) => timeSlot.timeSlotKey.timeSlotGroupKey === configActiveTab);\r\n const timeSlotDay = timeSlotDayList.filter((timeSlot) => timeSlot.timeSlotGroupKey === configActiveTab);\r\n if (timeSlotSelected.length === timeSlotDay.length) {\r\n $('.prod_selection__summary-next').fadeIn('fast');\r\n }\r\n } else {\r\n $('.prod_selection__summary-next').fadeOut('fast');\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport interface initData {\r\n ticketTypes: string;\r\n datePattern: string;\r\n}\r\n", "export class CompPackOrderLessonProgramValues {\r\n\r\n constructor(lessonProjNr: number, lessonGroupNr: number, lessonDefNr: number, lessonProgramNr: number, lessonProgramProjNr: number, lessonProgramGroupNr: number) {\r\n this.lessonProjNr = lessonProjNr;\r\n this.lessonGroupNr = lessonGroupNr;\r\n this.lessonDefNr = lessonDefNr;\r\n this.lessonProgramNr = lessonProgramNr;\r\n this.lessonProgramProjNr = lessonProgramProjNr;\r\n this.lessonProgramGroupNr = lessonProgramGroupNr;\r\n }\r\n\r\n lessonProjNr: number;\r\n lessonGroupNr: number;\r\n lessonDefNr: number;\r\n lessonProgramNr: number;\r\n lessonProgramProjNr: number;\r\n lessonProgramGroupNr: number;\r\n}", "import { AxDropdown } from \"@axess/limestone\";\r\nimport { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { AxLoading } from \"../../../Limestone/AxLoading/AxLoading\";\r\nimport { CompPackOrderLessonProgramValues } from \"../../../Models/ComplexPackages/BookingOptions/CompPackOrderLessonProgramValues\";\r\nimport { ComplexPackageBookingOptions } from \"../ComplexPackageBookingOptions\";\r\n\r\n@ModuleName(\"CompPackBookingLessonProgramOptions\")\r\nexport class CompPackBookingLessonProgramOptions implements AxInit {\r\n private complexPackageBookingOptions: ComplexPackageBookingOptions;\r\n private lessonProgramSlotDropdown = new AxDropdown();\r\n private axLoading: AxLoading = new AxLoading();\r\n\r\n AxInit(init: initData): void {\r\n this.complexPackageBookingOptions = AxLoad.GetModule<ComplexPackageBookingOptions>('ComplexPackageBookingOptions');\r\n const lessonPrograms = JSON.parse(init.lessonPrograms !== '' ? init.lessonPrograms : '[{}]');\r\n lessonPrograms.forEach(() => {\r\n this.lessonProgramSlotDropdown.init('.prod_selection__lessonProgramSlot-selection .ax-dropdown', {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: () => {\r\n const $selected = this.lessonProgramSlotDropdown.getSelected();\r\n this.onLessonProgramSlotSelected($selected);\r\n },\r\n });\r\n this.complexPackageBookingOptions.dropDowns.push(this.lessonProgramSlotDropdown);\r\n });\r\n }\r\n\r\n onLessonProgramSlotSelected($currentSelected) {\r\n if ($currentSelected.length === 0) {\r\n return;\r\n }\r\n const lessonProjNr = Number($currentSelected.attr('data-lessonProjNr'));\r\n const lessonGroupNr = Number($currentSelected.attr('data-lessonGroupNr'));\r\n const lessonGroupDefNr = Number($currentSelected.attr('data-lessonGroupDefNr'));\r\n const lessonProgramProjNr = Number($currentSelected.attr('data-lessonProgramProjNr'));\r\n const lessonProgramGroupNr = Number($currentSelected.attr('data-lessonProgramGroupNr'));\r\n const lessonProgramNr = Number($currentSelected.attr('data-lessonProgramNr'));\r\n\r\n const lessonProgramValues = new CompPackOrderLessonProgramValues(\r\n lessonProjNr, lessonGroupNr, lessonGroupDefNr,\r\n lessonProgramNr, lessonProgramProjNr, lessonProgramGroupNr\r\n );\r\n\r\n this.loadSelectedLessonProgramSlots(lessonProgramValues);\r\n this.complexPackageBookingOptions.bookingValues.lessonProgramOrderValues = [lessonProgramValues];\r\n }\r\n\r\n loadSelectedLessonProgramSlots(lessonProgramValues: CompPackOrderLessonProgramValues) {\r\n const data = {\r\n lessonProjNr: lessonProgramValues.lessonProjNr,\r\n lessonGroupNr: lessonProgramValues.lessonGroupNr,\r\n lessonDefNr: lessonProgramValues.lessonDefNr,\r\n lessonProgramNr: lessonProgramValues.lessonProgramNr,\r\n lessonProgramProjNr: lessonProgramValues.lessonProgramProjNr,\r\n lessonProgramGroupNr: lessonProgramValues.lessonProgramGroupNr\r\n }\r\n const timeSlotData = '.selectedSlotHolder';\r\n this.axLoading.ShowLoadingIndicator($(timeSlotData)?.get(0));\r\n AxessViewer.loadPartialView('/ComplexPackagesBooking/GetSelectedLessonProgramSlotsPartial', data, (result: string) => {\r\n $(timeSlotData).html(result);\r\n this.axLoading.HideLoadingIndicator($(timeSlotData)?.get(0));\r\n }, {\r\n dataType: 'html',\r\n });\r\n }\r\n}\r\n\r\nexport interface initData {\r\n languageId: number;\r\n lessonPrograms: string;\r\n}\r\n", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { ComplexPackageBookingOptions } from \"../ComplexPackageBookingOptions\";\r\nimport { AxLoading } from \"../../../Limestone/AxLoading/AxLoading\";\r\nimport { CustomerLessonProperties, InitCustomerProps } from \"../../Account/CustomerLessonProperties\";\r\n\r\n@ModuleName(\"CompPackBookingPersonOptions\")\r\nexport class CompPackBookingPersonOptions implements AxInit {\r\n protected axLoading: AxLoading;\r\n protected isTextInput: boolean;\r\n\r\n protected complexPackageBookingOptions: ComplexPackageBookingOptions;\r\n\r\n protected personDropdown: AxDropdown = new AxDropdown();\r\n protected genderDropdown: AxDropdown = new AxDropdown();\r\n protected heightDropdown: AxDropdown = new AxDropdown();\r\n protected weightDropdown: AxDropdown = new AxDropdown();\r\n protected shoeSizeDropdown: AxDropdown = new AxDropdown();\r\n\r\n private _customerLessonProps: CustomerLessonProperties = new CustomerLessonProperties();\r\n \r\n AxInit(init: initData): void {\r\n this.axLoading = new AxLoading();\r\n this.isTextInput = init.isTextInput;\r\n\r\n this.complexPackageBookingOptions = AxLoad.GetModule<ComplexPackageBookingOptions>(\"ComplexPackageBookingOptions\");\r\n\r\n this.personDropdown.init('.prod_selection__person-selection .ax-dropdown', {\r\n multiSelect: false,\r\n searchBar: false,\r\n onSelect: (_, value) => {\r\n this.loadPersonPartialAfterSelect(value as string);\r\n }\r\n });\r\n this.personDropdown.resetSelection();\r\n\r\n this.complexPackageBookingOptions.dropDowns.push(this.personDropdown);\r\n }\r\n\r\n setLessonPropsToBookingOptions() {\r\n this.complexPackageBookingOptions.bookingValues.lessonAllergies = this._customerLessonProps.allergies;\r\n this.complexPackageBookingOptions.bookingValues.lessonLanguages = this._customerLessonProps.languages;\r\n this.complexPackageBookingOptions.bookingValues.lessonMedicals = this._customerLessonProps.medicalStates;\r\n this.complexPackageBookingOptions.bookingValues.lessonLevels = this._customerLessonProps.lessonLevels;\r\n }\r\n\r\n // loadPersonPartialAfterSelect\r\n loadPersonPartialAfterSelect(value: string) {\r\n const accountId = Number(value);\r\n this.complexPackageBookingOptions.bookingValues.accountId = accountId;\r\n\r\n this.loadPersonPartial(accountId);\r\n }\r\n\r\n // loadPersonPartial\r\n loadPersonPartial(accountId, unitInt = undefined) {\r\n const data = {\r\n accountNr: accountId,\r\n unitInt: unitInt,\r\n };\r\n\r\n this.axLoading.ShowLoadingIndicator($('#personOptionsHolder')[0]);\r\n\r\n AxessViewer.loadPartialView('/ComplexPackagesBooking/GetPersonOptionsPartial', data, (result) => {\r\n $('#personOptionsHolder').html(result);\r\n this.initPersonDataPartial();\r\n\r\n this._customerLessonProps.AxInit(new InitCustomerProps('#lessonPropsHolder', ''));\r\n\r\n this.axLoading.HideLoadingIndicator($('#personOptionsHolder')[0]);\r\n }, {\r\n dataType: 'html'\r\n });\r\n }\r\n\r\n // reloadPersonPartial\r\n reloadPersonPartial(unitInt) {\r\n this.loadPersonPartial(this.complexPackageBookingOptions.bookingValues.accountId, unitInt);\r\n }\r\n\r\n // initPersonDataPartial\r\n initPersonDataPartial() {\r\n // unit selection\r\n $('input[type=radio][name=DataUnitSystem]').on('change', (e) => {\r\n const unitInt = $(e.currentTarget).val();\r\n this.reloadPersonPartial(unitInt);\r\n });\r\n\r\n // gender\r\n this.genderDropdown.init('.prod_selection__gender-selection .ax-dropdown', {\r\n multiSelect: false,\r\n searchBar: false,\r\n onSelect: ($parent, value) => {\r\n this.complexPackageBookingOptions.bookingValues.gender = value as string;\r\n }\r\n });\r\n this.complexPackageBookingOptions.dropDowns.push(this.genderDropdown);\r\n\r\n // height\r\n if (this.isTextInput) {\r\n $('[name=\"height\"]').on('keyup',\r\n (e) => {\r\n this.complexPackageBookingOptions.bookingValues.height = Number($(e.target).val());\r\n });\r\n\r\n $('[name=heightFeet],[name=heightInch]').on('input', e => {\r\n\r\n let feet = parseInt($('[name=heightFeet]').val() as string);\r\n let inches = parseInt($('[name=heightInch]').val() as string);\r\n\r\n let totalInches = feet * 12;\r\n totalInches += inches;\r\n\r\n const meters = parseFloat((totalInches / 39.370).toFixed(2));\r\n this.complexPackageBookingOptions.bookingValues.height = meters;\r\n });\r\n } else {\r\n this.heightDropdown.init('.prod_selection__height-selection .ax-dropdown', {\r\n multiSelect: false,\r\n searchBar: false,\r\n onSelect: (_, value) => {\r\n this.complexPackageBookingOptions.bookingValues.height = Number(value);\r\n }\r\n });\r\n this.complexPackageBookingOptions.dropDowns.push(this.heightDropdown);\r\n }\r\n\r\n // weight\r\n if (this.isTextInput) {\r\n $('[name=\"weight\"]').on('keyup', (e) => {\r\n let weight = parseInt($(e.target).val() as string);\r\n\r\n if ($('[name=DataUnitSystem]:checked').val() === '1') {\r\n weight = Math.round(weight / 2.20462);\r\n }\r\n this.complexPackageBookingOptions.bookingValues.weight = weight;\r\n })\r\n } else {\r\n this.weightDropdown.init('.prod_selection__weight-selection .ax-dropdown', {\r\n multiSelect: false,\r\n searchBar: false,\r\n onSelect: ($parent, value) => {\r\n this.complexPackageBookingOptions.bookingValues.weight = Number(value);\r\n }\r\n });\r\n this.complexPackageBookingOptions.dropDowns.push(this.weightDropdown);\r\n }\r\n\r\n // shoeSize\r\n this.shoeSizeDropdown.init('.prod_selection__shoeSize-selection .ax-dropdown', {\r\n multiSelect: false,\r\n searchBar: false,\r\n onSelect: (_, value) => {\r\n this.complexPackageBookingOptions.bookingValues.shoeSize = Number(value);\r\n }\r\n });\r\n this.complexPackageBookingOptions.dropDowns.push(this.shoeSizeDropdown);\r\n\r\n // skillLevel selection\r\n const userSkillLevel = $('#compPackUserSkillLevel').val();\r\n\r\n if (userSkillLevel != 0) {\r\n this.complexPackageBookingOptions.bookingValues.skillLevel = Number(userSkillLevel);\r\n $(`.compPack-skillLevel-pill[data-skillLevelId=\"${userSkillLevel}\"]`).addClass('active ax-fill-primary');\r\n }\r\n\r\n $('.compPack-skillLevel-pill').on('click', (x) => {\r\n const $target = $(x.delegateTarget);\r\n\r\n $target.parent().find('.active').each((i, e) => {\r\n this.toggleQuestionChip($(e));\r\n });\r\n\r\n this.toggleQuestionChip($target);\r\n\r\n const skillLevelId = $target.attr('data-skillLevelId');\r\n this.complexPackageBookingOptions.bookingValues.skillLevel = Number(skillLevelId);\r\n });\r\n\r\n this.setLessonPropsToBookingOptions();\r\n }\r\n\r\n toggleQuestionChip($target: JQuery<HTMLElement>) {\r\n $target.toggleClass('active').toggleClass('ax-fill-primary');\r\n $target.find('i.las').toggleClass('color-white').toggleClass('ax-color-primary');\r\n $target.find('i.lar').toggleClass('color-white').toggleClass('ax-color-primary--light');\r\n }\r\n}\r\n\r\nexport interface initData {\r\n isTextInput: boolean;\r\n}\r\n", "export class CompPackOrderRentalValues {\r\n\r\n constructor(rentalItemNr: number, rentalPersTypeNr: number, packagePositionNr: number) {\r\n this.rentalItemNr = rentalItemNr;\r\n this.rentalPersTypeNr = rentalPersTypeNr;\r\n this.packagePositionNr = packagePositionNr;\r\n }\r\n\r\n rentalItemNr: number;\r\n rentalPersTypeNr: number;\r\n packagePositionNr: number;\r\n}", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { ComplexPackageBookingOptions } from \"../ComplexPackageBookingOptions\";\r\nimport { CompPackOrderRentalValues } from \"../../../Models/ComplexPackages/BookingOptions/CompPackOrderRentalValues\";\r\nimport { RentalItem } from \"../../../Models/Rental/RentalItem\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\nimport { AxCheck } from \"../../../Components/AxForm/AxCheck\";\r\nimport { PriceHelper } from \"../../../Lib/Helper/PriceHelper\";\r\nimport { CultureInfo } from \"../../../Models/Culture/CultureInfo\";\r\n\r\nexport interface ICompPackBookingRentalOptionsInitData {\r\n rentalItems: RentalItem[];\r\n cultureInfo: CultureInfo;\r\n}\r\n\r\n@ModuleName(\"CompPackBookingRentalOptions\")\r\nexport class CompPackBookingRentalOptions implements AxInit {\r\n protected rentalItems: RentalItem[];\r\n protected complexPackageBookingOptions: ComplexPackageBookingOptions;\r\n protected pickUpLocationDropdown: AxDropdown = new AxDropdown();\r\n protected checkBoxesAdditionalRentalItems: AxCheck[];\r\n protected priceHelper: PriceHelper;\r\n\r\n private identifierAdditionalRentalCheckbox = \"identifierAdditionalRentalCheckbox_\";\r\n\r\n AxInit(init: ICompPackBookingRentalOptionsInitData): void {\r\n\r\n this.priceHelper = new PriceHelper(init.cultureInfo, false);\r\n\r\n this.complexPackageBookingOptions = AxLoad.GetModule<ComplexPackageBookingOptions>(\"ComplexPackageBookingOptions\");\r\n\r\n this.checkBoxesAdditionalRentalItems = [];\r\n\r\n // not used currently but needed in the future\r\n //this.setUpPickupLocationDropdown();\r\n\r\n this.rentalItems = JSON.parse(init.rentalItems.toString());\r\n\r\n this.addRentalValues();\r\n\r\n this.initCheckBoxesAdditionalItems();\r\n }\r\n\r\n // addRentalValues\r\n addRentalValues() {\r\n for (let rentalItem of this.rentalItems) {\r\n if (!rentalItem.isOptional) {\r\n const rentalValues = new CompPackOrderRentalValues(rentalItem.rentalItemNr, rentalItem.rentalPersTypeNr, rentalItem.packagePositionNr);\r\n this.complexPackageBookingOptions.bookingValues.rentalOrderValues.push(rentalValues);\r\n }\r\n }\r\n }\r\n\r\n // initCheckBoxes\r\n initCheckBoxesAdditionalItems() {\r\n $('.compPack_additionalRental_item_check').parent().each((i, obj) => {\r\n let id = $(obj).find('.compPack_additionalRental_item_check').attr('data-rentalItem-id');\r\n this.checkBoxesAdditionalRentalItems.push(new AxCheck(this.identifierAdditionalRentalCheckbox + id, obj));\r\n });\r\n\r\n $('.compPack_additionalRental_item_check').change((object) => {\r\n this.checkAdditionalItemsChecked();\r\n });\r\n\r\n // initial check\r\n this.checkAdditionalItemsChecked();\r\n }\r\n\r\n // checkAdditionalItemsChecked\r\n checkAdditionalItemsChecked() {\r\n this.complexPackageBookingOptions.bookingValues.additionalRentalOrderValues = new Array<CompPackOrderRentalValues>();\r\n\r\n const packagePrice: number = + $('#compPackBookingPackagePrice').attr('data-packagePrice') / 100;\r\n let additionalPrice = 0;\r\n\r\n let additionalItemsSelected = 0;\r\n\r\n $('.compPack_additionalRental_item_check').each((i, obj) => {\r\n let check = $(obj).prop('checked');\r\n let rentalItemId: number = + $(obj).attr('data-rentalItem-id');\r\n let personType: number = + $(obj).attr('data-rental-personType');\r\n let packagePositionNr: number = + $(obj).attr('data-rental-packagePositionNr');\r\n\r\n let additionalRentalItem = $(`#additionalRentalItem_${rentalItemId}_${personType}_${packagePositionNr}`);\r\n\r\n if (check) {\r\n let additionalRentalOrder = new CompPackOrderRentalValues(rentalItemId, personType, packagePositionNr);\r\n this.complexPackageBookingOptions.bookingValues.additionalRentalOrderValues.push(additionalRentalOrder);\r\n\r\n $(additionalRentalItem).show();\r\n\r\n if (!$(additionalRentalItem).hasClass('d-flex')) {\r\n $(additionalRentalItem).addClass('d-flex');\r\n }\r\n\r\n let rentalItemPrice: number = + $(additionalRentalItem).attr('data-rentalItem-price') / 100;\r\n additionalPrice += rentalItemPrice;\r\n\r\n additionalItemsSelected++;\r\n } else {\r\n $(additionalRentalItem).hide();\r\n $(additionalRentalItem).removeClass('d-flex');\r\n }\r\n });\r\n\r\n if (additionalItemsSelected > 0) {\r\n $('#additionalRentalItemsDivider').show();\r\n } else {\r\n $('#additionalRentalItemsDivider').hide();\r\n }\r\n\r\n if (additionalPrice > 0) {\r\n let newPrice = additionalPrice + packagePrice;\r\n\r\n $('#compPackBookingPriceSum').html('' + this.priceHelper.GetPriceStringWithCurrencySymbol(newPrice));\r\n } else {\r\n $('#compPackBookingPriceSum').html('' + this.priceHelper.GetPriceStringWithCurrencySymbol(packagePrice));\r\n }\r\n }\r\n\r\n // setUpPickupLocationDropdown\r\n setUpPickupLocationDropdown() {\r\n this.pickUpLocationDropdown.init('.prod_selection__pickup-selection .ax-form-select');\r\n this.complexPackageBookingOptions.dropDowns.push(this.pickUpLocationDropdown);\r\n\r\n // Pickup\r\n $('.prod_selection__pickup-selection').on('click', (x) => {\r\n $('.compPack_bookingOption_pickup_select').toggleClass('active');\r\n });\r\n\r\n $('.compPack_bookingOption_rentalLocation_option').on('click', (x) => {\r\n let locationId = $(x.target).attr('data-value');\r\n this.complexPackageBookingOptions.bookingValues.pickupLocationId = Number(locationId);\r\n $('.compPack_bookingOption_pickup_select').removeClass('active');\r\n });\r\n }\r\n\r\n\r\n}", "export class CompPackOrderLessonValues {\r\n constructor(lessonsNr: number, lessonWebNr: number, lessonArcNr: number, lessonDefNr: number, packagePositionNr: number) {\r\n this.lessonNr = lessonsNr;\r\n this.lessonsNr = lessonsNr;\r\n this.lessonWebNr = lessonWebNr;\r\n this.lessonArcNr = lessonArcNr;\r\n this.lessonDefNr = lessonDefNr;\r\n this.packagePositionNr = packagePositionNr;\r\n }\r\n\r\n /*\r\n * TODO: get rid of the duality of lessonsNr/lessonNr throughout all TS/C#\r\n * In the final C# request lessonNr (lesson in singular) is the one that's used.\r\n */\r\n lessonNr: number;\r\n lessonsNr: number;\r\n lessonWebNr: number;\r\n lessonArcNr: number;\r\n lessonDefNr: number;\r\n packagePositionNr: number;\r\n}", "import { AxDropdown } from \"@axess/limestone\";\r\nimport { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { CompPackOrderLessonValues } from \"../../../Models/ComplexPackages/BookingOptions/CompPackOrderLessonValues\";\r\nimport { Lesson } from \"../../../Models/Lesson/Lesson\";\r\nimport { ComplexPackageBookingOptions } from \"../ComplexPackageBookingOptions\";\r\n\r\n@ModuleName(\"CompPackBookingLessonOptions\")\r\nexport class CompPackBookingLessonOptions implements AxInit {\r\n protected complexPackageBookingOptions: ComplexPackageBookingOptions;\r\n private lessonSelectionDropdown: AxDropdown = new AxDropdown();\r\n\r\n AxInit(init: initData): void {\r\n this.complexPackageBookingOptions = AxLoad.GetModule<ComplexPackageBookingOptions>(\"ComplexPackageBookingOptions\");\r\n const lessonOrderValues: Lesson[] = JSON.parse(init.lessonOrderValues !== '' ? init.lessonOrderValues : '[]');\r\n\r\n lessonOrderValues.forEach((lesson: Lesson) => this.addTimeSlotSelectListener.call(this, lesson));\r\n }\r\n\r\n // addTimeSlotSelectListener\r\n addTimeSlotSelectListener(lesson: Lesson) {\r\n const opener = $('#optionTimeslotSelectButton');\r\n\r\n if (opener.length > 0) {\r\n this.lessonSelectionDropdown.init('#optionTimeslotSelectButton', {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: () => {\r\n const $target = this.lessonSelectionDropdown.getSelected();\r\n\r\n const lessonsNr = Number($target.attr(\"data-lessonsNr\"));\r\n const lessonWebNr = Number($target.attr(\"data-lessonWebNr\"));\r\n const lessonArcNr = Number($target.attr(\"data-lessonArcNr\"));\r\n const lessonDefNr = Number($target.attr(\"data-lessonDefNr\"));\r\n const packagePositionNr = Number($target.attr(\"data-packagePositionNr\"));\r\n\r\n this.addLessonValues(lessonsNr, lessonWebNr, lessonArcNr, lessonDefNr, packagePositionNr);\r\n }\r\n });\r\n } else {\r\n this.addLessonValues(lesson.lessonsNr, lesson.lessonWebNr, lesson.lessonArcNr, lesson.lessonDefNr, lesson.packagePositionNr);\r\n }\r\n }\r\n\r\n // addRentalValues\r\n addLessonValues(lessonsNr: number, lessonWebNr: number, lessonArcNr: number, lessonDefNr: number, packagePositionNr: number) {\r\n const lessonValues = new CompPackOrderLessonValues(lessonsNr, lessonWebNr, lessonArcNr, lessonDefNr, packagePositionNr);\r\n this.complexPackageBookingOptions.bookingValues.lessonOrderValues.push(lessonValues);\r\n }\r\n}\r\n\r\nexport interface initData {\r\n lessonOrderValues: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\n\r\n@ModuleName(\"Redirect\")\r\nexport class Redirect implements AxInit {\r\n private InitData: RedirectInitData;\r\n\r\n private RedirectTimeout;\r\n\r\n constructor(private _AxLoading = new AxLoading()) {\r\n }\r\n\r\n AxInit(init: RedirectInitData): void {\r\n this.InitData = init;\r\n this._AxLoading.ShowLoadingIndicator(document.querySelector('.redirect__loading'));\r\n\r\n this.RedirectTimeout = setTimeout(() => {\r\n this.Redirect();\r\n }, 2000);\r\n\r\n $('.redirect__page a').click(e => {\r\n e.preventDefault();\r\n clearTimeout(this.RedirectTimeout);\r\n this.Redirect();\r\n });\r\n }\r\n\r\n Redirect() {\r\n window.location.href = this.InitData.Link;\r\n\r\n setTimeout(() => {\r\n //window.location.href = \"https://google.com\";\r\n }, 500);\r\n\r\n setTimeout(() => {\r\n $('.redirect_content').addClass('d-none');\r\n $('.redirect_alt').addClass('d-none');\r\n $('.redirect_failed').removeClass('d-none');\r\n }, 2000);\r\n }\r\n}\r\n\r\ninterface RedirectInitData {\r\n Link: string;\r\n AfterRedirect: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxDatePicker, Cell, Mode } from \"../../Components/AxDatepicker/AxDatepicker\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\n\r\n\r\n@ModuleName(\"ComplexPackageSearchBar\")\r\nexport class ComplexPackageSearchBar implements AxInit {\r\n\r\n protected datePickerFrom: AxDatePicker;\r\n protected datePickerTo: AxDatePicker;\r\n\r\n protected datePickerFromMobile: AxDatePicker;\r\n protected datePickerToMobile: AxDatePicker;\r\n\r\n protected dateFromDropdown: AxDropdown = new AxDropdown();\r\n protected dateToDropdown: AxDropdown = new AxDropdown();\r\n\r\n dateFrom: moment.Moment;\r\n dateTo: moment.Moment;\r\n\r\n protected datePattern: string;\r\n\r\n protected allDropDownsSet: boolean = false;\r\n\r\n constructor(private _I18nHelper = new I18nHelper()) { }\r\n\r\n AxInit(initData: ICompPackSearchBarInitData): void {\r\n $(() => {\r\n this.datePattern = initData.datePattern;\r\n this.setUpDatePickerDropDowns(initData);\r\n this.setupDatePickers(initData);\r\n this.setupClickListeners();\r\n });\r\n }\r\n\r\n // setupClickListeners\r\n setupClickListeners() {\r\n // closeOpenSelectors\r\n window.addEventListener('mouseup', event => {\r\n const target = event.target as HTMLInputElement;\r\n this.closeOpenSelectors(target);\r\n });\r\n\r\n // doSearBarSearch\r\n document.querySelector('#compPackSearchBar-search-btn').addEventListener('click', (e: Event) => this.doSearBarSearch());\r\n\r\n // close mobile datePicker\r\n $('.prod_selection__prod-save').click(x => {\r\n $('.prod_selection__prod-close').click();\r\n });\r\n\r\n // close mobile datePicker\r\n $('.prod_selection__prod-close').click(x => {\r\n this.closeFromDatePickerDesktop();\r\n this.closeToDatePickerDesktop();\r\n });\r\n }\r\n\r\n // setUpDatePickers\r\n setUpDatePickerDropDowns(initData: ICompPackSearchBarInitData) {\r\n // from date stuff\r\n this.dateFromDropdown.init('.compPack-searchbar__from-date-selection .ax-dropdown');\r\n $('.compPack-searchbar__from-date-selection').click(x => {\r\n this.openFromDatePickerDesktop();\r\n this.openFromDatePickerMobile();\r\n });\r\n\r\n // to date stuff\r\n this.dateToDropdown.init('.compPack-searchbar__to-date-selection .ax-dropdown');\r\n $('.compPack-searchbar__to-date-selection').click(x => {\r\n this.openToDatePickerDesktop();\r\n this.openFromDatePickerMobile();\r\n });\r\n }\r\n\r\n // setupDatePickers\r\n setupDatePickers(initData: ICompPackSearchBarInitData) {\r\n\r\n let currentFromDate = null;\r\n\r\n if (initData.toDate && initData.fromDate !== '') {\r\n currentFromDate = moment(initData.fromDate, \"YYYY-MM-DD\");\r\n this.dateFrom = currentFromDate;\r\n\r\n const formattedDate = this.dateFrom.format(this.datePattern);\r\n this.dateFromDropdown.setValue(formattedDate);\r\n } else {\r\n this.dateFromDropdown.resetSelection();\r\n }\r\n\r\n // from\r\n this.initDatePickerCompackSearchBar(initData, '#compack-searchBar-from', null, this.datePickerFrom, this.onChangeFromDate,\r\n this.checkDateFrom, Mode.Inline, this.dateFromDropdown, currentFromDate);\r\n\r\n // mobile from\r\n this.initDatePickerCompackSearchBar(initData, '#tariff_date_mobile_from', '#tariff_date_mobile__legend_from', this.datePickerFromMobile,\r\n this.onChangeFromDate, this.checkDateFrom, Mode.Endless, this.dateFromDropdown, currentFromDate);\r\n\r\n let currentToDate = null;\r\n\r\n if (initData.toDate && initData.toDate !== '') {\r\n currentToDate = moment(initData.toDate, \"YYYY-MM-DD\");\r\n this.dateTo = currentToDate;\r\n\r\n const formattedDate = this.dateTo.format(this.datePattern);\r\n this.dateToDropdown.setValue(formattedDate);\r\n } else {\r\n this.dateToDropdown.resetSelection();\r\n }\r\n\r\n // to\r\n this.initDatePickerCompackSearchBar(initData, '#compack-searchBar-to', null, this.datePickerTo, this.onChangeToDate,\r\n this.checkDateTo, Mode.Inline, this.dateToDropdown, currentToDate);\r\n\r\n // mobile to\r\n this.initDatePickerCompackSearchBar(initData, '#tariff_date_mobile_to', '#tariff_date_mobile__legend_to', this.datePickerToMobile,\r\n this.onChangeToDate, this.checkDateTo, Mode.Endless, this.dateToDropdown, currentToDate);\r\n\r\n $('.compPack-datePicker-close-btn').click(x => {\r\n this.closeFromDatePickerMobile();\r\n this.closeToDatePickerMobile();\r\n });\r\n }\r\n\r\n // initDatePickerCompackSearchBar\r\n initDatePickerCompackSearchBar(initData: ICompPackSearchBarInitData, target: string, legendTarget: string, axDatePicker: AxDatePicker,\r\n onChange: Function, checkDate: Function, mode: Mode, dropDown: AxDropdown, currentDate: moment.Moment) {\r\n\r\n const endDate = initData.endDate != null ? moment(initData.endDate, \"YYYY-MM-DD\") : null;\r\n\r\n axDatePicker = new AxDatePicker();\r\n\r\n axDatePicker.Init({\r\n StartOfWeek: initData.startOfWeek,\r\n Lang: initData.lang,\r\n StartDate: moment(initData.startDate, \"YYYY-MM-DD\"),\r\n Target: target,\r\n LegendTarget: legendTarget,\r\n Mode: mode,\r\n EndDate: endDate,\r\n OnChange: (x, y) => { return onChange(x, y, axDatePicker) },\r\n OnlySelectDates: true,\r\n //CurrentDate: currentDate\r\n });\r\n\r\n axDatePicker.ActivationSubject.subscribe(x => checkDate(x, axDatePicker, dropDown, this));\r\n }\r\n\r\n // checkDateFrom\r\n checkDateFrom(cell: Cell, datePicker: AxDatePicker, dropDown: AxDropdown, that: any) {\r\n if (cell != null) {\r\n const formattedDate = cell.Date.format(that.datePattern);\r\n that.dateFrom = cell.Date;\r\n dropDown.setValue(formattedDate);\r\n\r\n // set startDate for datePickerTo\r\n datePicker.CurrentStartDate = that.dateFrom;\r\n that.openToDatePickerDesktop();\r\n that.openToDatePickerMobile();\r\n }\r\n\r\n $('.prod_selection__prod-save').removeAttr('disabled');\r\n that.closeFromDatePickerDesktop();\r\n that.closeFromDatePickerMobile();\r\n that.activateSearchButton();\r\n }\r\n\r\n // checkDateTo\r\n checkDateTo(cell: Cell, datePicker: AxDatePicker, dropDown: AxDropdown, that: any) {\r\n if (cell != null) {\r\n const formattedDate = cell.Date.format(that.datePattern);\r\n dropDown.setValue(formattedDate);\r\n that.dateTo = cell.Date;\r\n }\r\n\r\n $('.prod_selection__prod-save').removeAttr('disabled');\r\n\r\n that.closeToDatePickerDesktop();\r\n that.closeToDatePickerMobile();\r\n that.activateSearchButton();\r\n }\r\n\r\n // onChangeFromDate\r\n onChangeFromDate(startDate: moment.Moment, endDate: moment.Moment, axDatePicker: AxDatePicker): Promise<void> {\r\n return new Promise<void>((res, rej) => {\r\n const availableDates: moment.Moment[] = [];\r\n axDatePicker.Options.AvailableDates = availableDates;\r\n res();\r\n });\r\n }\r\n\r\n // onChangeToDate\r\n onChangeToDate(startDate: moment.Moment, endDate: moment.Moment, axDatePicker: AxDatePicker): Promise<void> {\r\n return new Promise<void>((res, rej) => {\r\n const availableDates: moment.Moment[] = [];\r\n axDatePicker.Options.AvailableDates = availableDates;\r\n res();\r\n });\r\n }\r\n\r\n // doSearBarSearch\r\n doSearBarSearch() {\r\n if (this.allDropDownsSet) {\r\n let currentUrl: string = window.location.href;\r\n\r\n if (currentUrl.includes(\"fromDate\")) {\r\n currentUrl = currentUrl.substr(0, currentUrl.indexOf(\"?fromDate\"));\r\n }\r\n\r\n const newUrl = `${currentUrl}?fromDate=${this.dateFrom.format('YYYY-MM-DD')}&toDate=${this.dateTo.format('YYYY-MM-DD')}&locationId=${0}`;\r\n\r\n window.location.href = newUrl;\r\n }\r\n }\r\n\r\n // openFromDatePicker\r\n openFromDatePickerDesktop() {\r\n if (!$('.compPack_searchBar_datePickerFromWrapper').hasClass('active')) {\r\n $('.compPack_searchBar_datePickerFromWrapper').addClass('active');\r\n }\r\n }\r\n\r\n // openToDatePicker\r\n protected openToDatePickerDesktop() {\r\n if (!$('.compPack_searchBar_datePickerToWrapper').hasClass('active')) {\r\n $('.compPack_searchBar_datePickerToWrapper').addClass('active');\r\n }\r\n }\r\n\r\n // closeFromDatePicker\r\n closeFromDatePickerDesktop() {\r\n if ($('.compPack_searchBar_datePickerFromWrapper').hasClass('active')) {\r\n $('.compPack_searchBar_datePickerFromWrapper').removeClass('active');\r\n }\r\n }\r\n\r\n // closeToDatePicker\r\n closeToDatePickerDesktop() {\r\n if ($('.compPack_searchBar_datePickerToWrapper').hasClass('active')) {\r\n $('.compPack_searchBar_datePickerToWrapper').removeClass('active');\r\n }\r\n }\r\n\r\n // openFromDatePicker\r\n openFromDatePickerMobile() {\r\n if (!$('.compPack_searchBar_datePickerMobileWrapper_from').hasClass('active')) {\r\n $('.compPack_searchBar_datePickerMobileWrapper_from').addClass('active');\r\n }\r\n\r\n if (!$('body').hasClass('overflow-hidden')) {\r\n $('body').addClass('overflow-hidden');\r\n }\r\n }\r\n\r\n // openToDatePicker\r\n openToDatePickerMobile() {\r\n if (!$('.compPack_searchBar_datePickerMobileWrapper_to').hasClass('active')) {\r\n $('.compPack_searchBar_datePickerMobileWrapper_to').addClass('active');\r\n }\r\n\r\n if (!$('body').hasClass('overflow-hidden')) {\r\n $('body').addClass('overflow-hidden');\r\n }\r\n }\r\n\r\n // closeFromDatePicker\r\n closeFromDatePickerMobile() {\r\n if ($('.compPack_searchBar_datePickerMobileWrapper_from').hasClass('active')) {\r\n $('.compPack_searchBar_datePickerMobileWrapper_from').removeClass('active');\r\n }\r\n\r\n if ($('body').hasClass('overflow-hidden')) {\r\n $('body').removeClass('overflow-hidden');\r\n }\r\n }\r\n\r\n // closeToDatePicker\r\n closeToDatePickerMobile() {\r\n if ($('.compPack_searchBar_datePickerMobileWrapper_to').hasClass('active')) {\r\n $('.compPack_searchBar_datePickerMobileWrapper_to').removeClass('active');\r\n }\r\n\r\n if ($('body').hasClass('overflow-hidden')) {\r\n $('body').removeClass('overflow-hidden');\r\n }\r\n }\r\n\r\n // closeOpenSelectors\r\n closeOpenSelectors(clickedElement: HTMLElement) {\r\n const locationSelect = $(\".compPack-searchbar-location_select.compack_select\");\r\n\r\n if (!clickedElement.classList.contains(\"axp__month-navigator\")) {\r\n this.closeFromDatePickerDesktop();\r\n this.closeToDatePickerDesktop();\r\n\r\n if (locationSelect.hasClass('active')) {\r\n locationSelect.removeClass('active');\r\n }\r\n\r\n if ($('body').hasClass('overflow-hidden')) {\r\n $('body').removeClass('overflow-hidden');\r\n }\r\n }\r\n }\r\n\r\n // activateSearchButton\r\n activateSearchButton() {\r\n let fromDateString = \"\";\r\n let toDateString = \"\";\r\n\r\n if (this.dateFrom != undefined) {\r\n fromDateString = this.dateFrom.format('YYYY-MM-DD');\r\n }\r\n\r\n if (this.dateTo != undefined) {\r\n toDateString = this.dateTo.format('YYYY-MM-DD');\r\n }\r\n\r\n this.allDropDownsSet = fromDateString !== \"\" && toDateString !== \"\";\r\n\r\n if (this.allDropDownsSet && this.dateTo >= this.dateFrom) {\r\n $('.compPacks_teaser_input_search_button').removeClass('disabled');\r\n } else {\r\n if (!$('.compPacks_teaser_input_search_button').hasClass('disabled')) {\r\n $('.compPacks_teaser_input_search_button').addClass('disabled');\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport interface ICompPackSearchBarInitData {\r\n startOfWeek: number;\r\n lang: string;\r\n startDate: string;\r\n endDate?: string;\r\n postUrl: string;\r\n datePattern: string;\r\n datePatternYear: string;\r\n fromDate: string;\r\n toDate: string;\r\n locationId: number;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\n\r\n@ModuleName(\"LessonsLoadingSpinner\")\r\nexport class LessonsLoadingSpinner implements AxInit {\r\n public AxLoading: AxLoading;\r\n\r\n AxInit(init: any): void {\r\n this.AxLoading = new AxLoading();\r\n }\r\n\r\n StartLoadingSpinner(element) {\r\n let key = element;\r\n this.AxLoading.ShowLoadingIndicator($(key)[0]);\r\n }\r\n\r\n EndLoadingSpinner(element) {\r\n let key = element;\r\n this.AxLoading.HideLoadingIndicator($(key)[0]);\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { PriceHelper } from \"../../Lib/Helper/PriceHelper\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { CultureInfo } from \"../../Models/Culture/CultureInfo\";\r\n\r\n@ModuleName(\"Eguma\")\r\nexport class Eguma implements AxInit {\r\n constructor(private _AxLimestone = new AxLimeStone()) { }\r\n\r\n private PriceHelper: PriceHelper;\r\n\r\n AxInit(init: EgumaInitData): void {\r\n this.PriceHelper = new PriceHelper(init.CultureInfo, false);\r\n\r\n $('#kt_portlet__resort_charge').on('click', '.btn_payment__eguma-redeem', x => {\r\n let egumaVoucher = $('.payment__eguma-voucher').val();\r\n this._AxLimestone.LockButton(x.currentTarget);\r\n\r\n AxessViewer.loadPartialView('/Eguma/CheckEgumaVoucher/' + egumaVoucher, {}, (resp: EgumaBalanceResult) => {\r\n $('.payment__eguma-form ~ .ax-form-group-assistence').html('');\r\n\r\n if (resp.IsRedeemable) {\r\n $('.payment__eguma-value').html(this.PriceHelper.GetPriceString(this.PriceHelper.GetPrice(resp.BalanceInCents)));\r\n } else {\r\n $('.payment__eguma-value').html(this.PriceHelper.GetPriceString(this.PriceHelper.GetPrice(0)));\r\n }\r\n $('.payment__bank-value').html(this.PriceHelper.GetPriceString(this.PriceHelper.GetPrice(resp.RestAmount)));\r\n if (resp.Message) {\r\n $('.payment__eguma-form ~ .ax-form-group-assistence').html(resp.Message);\r\n $('.payment__eguma-form ~ .ax-form-group-assistence').toggleClass('success', resp.IsRedeemable);\r\n }\r\n this._AxLimestone.UnlockButton(x.currentTarget);\r\n }, {});\r\n });\r\n }\r\n}\r\n\r\ninterface EgumaInitData {\r\n CultureInfo: CultureInfo\r\n}\r\n\r\ninterface EgumaBalanceResult {\r\n Code: string;\r\n BalanceInCents: number;\r\n TotalAmountInCents: number;\r\n Message: string;\r\n IsRedeemable: boolean;\r\n RestAmount: number;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxAlert } from \"../../Limestone/AxAlert/AxAlert\";\r\n\r\n@ModuleName(\"ShoppingCartPersonalisation\")\r\nexport class ShoppingCartPersonalisation implements AxInit {\r\n AxInit(init: any): void {\r\n\r\n\r\n\r\n }\r\n\r\n\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxReloadable } from \"../../Lib/AxSystem/AxReloadable\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\n\r\n@ModuleName(\"ShoppingCartReservationTimer\")\r\nexport class ShoppingCartReservationTimer implements AxInit, AxReloadable {\r\n private axLoading: AxLoading;\r\n private companyDateTime: moment.Moment;\r\n private countDown: number;\r\n\r\n AxInit(init: any): void {\r\n this.axLoading = new AxLoading();\r\n this.loadReservationTimes();\r\n }\r\n\r\n AxReload(init: any): void {\r\n clearInterval(this.countDown);\r\n this.loadReservationTimes();\r\n }\r\n\r\n // loadReservationTimes\r\n public loadReservationTimes() {\r\n const reservationTimeHolders = $('.cartEntryCd');\r\n\r\n for (let i = 0; i < reservationTimeHolders.length; i++) {\r\n this.axLoading.ShowLoadingIndicator(reservationTimeHolders[i]);\r\n }\r\n\r\n AxessViewer.ajaxRequest('/api/ShoppingCartReservationTimeApi/getReservationTimes', null, (result: ShoppingCartReservationTimes) => {\r\n this.companyDateTime = moment(result.CompanyTime, 'YYYY-MM-DD HH:mm');\r\n\r\n this.setCountDownsFromResult(result);\r\n for (let i = 0; i < reservationTimeHolders.length; i++) {\r\n this.axLoading.HideLoadingIndicator(reservationTimeHolders[i]);\r\n }\r\n }, null);\r\n }\r\n\r\n // setCountDownsFromResult\r\n setCountDownsFromResult(result: ShoppingCartReservationTimes) {\r\n for (let i = 0; i < result.CartEntryReservationTimes.length; i++) {\r\n this.momentCountDown(result.CartEntryReservationTimes[i].ReservedUntil, '.cartEntryReservationCd_' + result.CartEntryReservationTimes[i].CartEntryId);\r\n }\r\n }\r\n\r\n // momentCountDown\r\n momentCountDown(reservationEndTimeString: string, reservationHolderElem: string) {\r\n const eventTime = moment(reservationEndTimeString);\r\n const diffTime = eventTime.diff(this.companyDateTime, 'milliseconds');\r\n let duration = moment.duration(diffTime, 'milliseconds');\r\n let interval = 1000;\r\n\r\n\r\n let temp = setInterval((x) => {\r\n let durationNumber = duration.asMilliseconds();\r\n duration = moment.duration(durationNumber - interval, 'milliseconds');\r\n\r\n if (duration.asMilliseconds() === 0) {\r\n clearInterval(this.countDown);\r\n $(reservationHolderElem).html(\"Reservation expired\");\r\n window.location.reload();\r\n } else {\r\n const minutes = duration.minutes() < 10 ? `0${duration.minutes()}` : duration.minutes();\r\n const seconds = duration.seconds() < 10 ? `0${duration.seconds()}` : duration.seconds();\r\n $(reservationHolderElem).html(`${duration.hours()}:${minutes}:${seconds}`);\r\n }\r\n }, interval);\r\n\r\n this.countDown = temp;\r\n }\r\n}\r\n\r\nexport class ShoppingCartReservationTimes {\r\n CompanyTime: string;\r\n CartEntryReservationTimes: CartEntryReservationTime[]\r\n}\r\n\r\nexport class CartEntryReservationTime {\r\n CartEntryId: number;\r\n ReservedUntil: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport Swal from \"sweetalert2\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\n\r\n@ModuleName(\"B2BHistory\")\r\nexport class B2BHistory implements AxInit {\r\n constructor(private _I18nHelper = new I18nHelper(), private _axLoading = new AxLoading()) { }\r\n private initData: B2BHistoryInitData;\r\n\r\n AxInit(init: B2BHistoryInitData): void {\r\n this.initData = init;\r\n\r\n $('#b2bSalesHistoryListContainer').on('click', '.b2b-download__details-btn', x => {\r\n let $x = $(x.target);\r\n\r\n let posNr = parseInt($x.attr('data-pos'));\r\n let transNr = parseInt($x.attr('data-trans'));\r\n\r\n $(`.b2b__history-detail[data-pos=${posNr}][data-trans=${transNr}]`).html('');\r\n\r\n if (!$x.hasClass('active')) {\r\n this._axLoading.ShowLoadingIndicator($('#b2bSalesHistoryListContainer')[0]);\r\n\r\n AxessViewer.loadPartialView('/B2B/_Details',\r\n {\r\n transNr: transNr,\r\n posNr: posNr\r\n },\r\n resp => {\r\n $x.addClass('active');\r\n $(`.b2b__history-detail[data-pos=${posNr}][data-trans=${transNr}]`).html(resp.returnView);\r\n $(`.b2b__history-detail[data-pos=${posNr}][data-trans=${transNr}] .history__ax-cancel-btn`)\r\n .click(e => {\r\n this.confirmCancel($(e.delegateTarget));\r\n });\r\n this._axLoading.HideLoadingIndicator($('#b2bSalesHistoryListContainer')[0]);\r\n },\r\n {});\r\n } else {\r\n $x.removeClass('active');\r\n }\r\n });\r\n }\r\n\r\n confirmCancel($elem: JQuery<HTMLElement>) {\r\n let transNr = parseInt($elem.attr('data-trans'));\r\n let serialNr = parseInt($elem.attr('data-serial'));\r\n let poolNr = parseInt($elem.attr('data-pool'));\r\n let posNr = parseInt($elem.attr('data-pos'));\r\n\r\n let data = {\r\n transNr: transNr,\r\n serialNr: serialNr,\r\n poolNr: poolNr,\r\n posNr: posNr\r\n };\r\n\r\n AxessViewer.loadPartialView('/B2B/GetCancelSweetAlertHtml', data, (result) => {\r\n Swal.fire({\r\n title: '',\r\n footer: this.initData.text,\r\n html: result,\r\n showCancelButton: true,\r\n confirmButtonText: this._I18nHelper.GetTranslation(Translations.Confirmation),\r\n cancelButtonText: this._I18nHelper.GetTranslation(Translations.Cancel),\r\n heightAuto: true,\r\n icon: 'warning'\r\n }).then(resp => {\r\n if (resp.value) {\r\n this.cancelTicket(transNr, posNr, serialNr);\r\n } else if (result.isDenied) {\r\n\r\n }\r\n });\r\n }, { dataType: 'html' });\r\n }\r\n\r\n cancelTicket(transNr, posNr, serialNr) {\r\n const data = {\r\n transNr: transNr,\r\n serialNr: serialNr,\r\n posNr: posNr\r\n };\r\n\r\n AxessViewer.loadPartialView('/B2B/CancelTicket', data, (resp) => {\r\n if (resp[\"error\"] == false) {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Success) + '!',\r\n text: resp['message'],\r\n confirmButtonText: 'Ok',\r\n showConfirmButton: true,\r\n icon: 'success'\r\n }).then((result) => {\r\n location.reload();\r\n });\r\n } else {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Error) + '!',\r\n text: resp['message'],\r\n confirmButtonText: 'OK',\r\n icon: 'error'\r\n }).then((resp) => {\r\n location.reload();\r\n });\r\n }\r\n }, {\r\n silent: true\r\n });\r\n }\r\n}\r\n\r\ninterface B2BHistoryInitData {\r\n text: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\n\r\n@ModuleName(\"ShoppingCartEntryRetail\")\r\nexport class ShoppingCartEntryRetail implements AxInit {\r\n private quantitySelections: AxDropdown = new AxDropdown();\r\n constructor(private _axLoading = new AxLoading()) { }\r\n\r\n AxInit(init): void {\r\n }\r\n\r\n initDropDown() {\r\n this.quantitySelections.init('.cart-position__retail .ax-dropdown',\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent, value) => {\r\n this.switchQuantity($parent, value as string);\r\n }\r\n });\r\n }\r\n\r\n switchQuantity($parent: JQuery<HTMLElement>, value: string) {\r\n let cartEntryID = parseInt($parent.attr('data-targetID'));\r\n\r\n let quantity = parseInt(value);\r\n let orgQuantity = parseInt($parent.find('.retail__quantitySelection').html());\r\n\r\n if (quantity !== orgQuantity) {\r\n this._axLoading.ShowLoadingIndicator($(`.cart-position__retail[data-targetID=${cartEntryID}]`)[0]);\r\n AxessViewer.loadPartialView('/SCRetail/UpdateQuantity',\r\n {\r\n cartEntryID: cartEntryID,\r\n quantity: quantity\r\n },\r\n x => {\r\n if (x.success) {\r\n $parent.find('.retail__quantitySelection').html(value);\r\n $('#total_price_holder').html(x.total);\r\n $(`.retail__subtotal[data-targetID=${cartEntryID}]`).html(x.groupTotal);\r\n $(`.cart_portlet_prodType_5-subtotal`).html(x.subTotal);\r\n }\r\n this._axLoading.HideLoadingIndicator($(`.cart-position__retail[data-targetID=${cartEntryID}]`)[0]);\r\n },\r\n {});\r\n }\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxDropdown } from \"@axess/limestone\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxAlert } from \"../../Limestone/AxAlert/AxAlert\";\r\nimport { inputMaskHelper } from '../../Lib/Helper/InputMaskHelper';\r\n\r\n@ModuleName(\"FindMyTicket\")\r\nexport class FindMyTicket implements AxInit {\r\n private cardSelection: AxDropdown = new AxDropdown();\r\n private currentWtp: string;\r\n\r\n //private currentSelection: selectionReturn;\r\n\r\n private keyList = {\r\n listClass: '.findMyTickets__ticketList',\r\n detailClass: '.findMyTickets__details',\r\n searchClass: '.findMyTickets__input-search',\r\n formAssistantClass: '.findMyTickets__wrapper .ax-form-group-assistence'\r\n };\r\n\r\n constructor(private _i18nHelper = new I18nHelper()) { }\r\n\r\n AxInit(init): void {\r\n this.cardSelection.init('.findMyTickets__wrapper .ax-dropdown',\r\n {\r\n multiSelect: false,\r\n searchBar: false,\r\n onSelect: ($x, y) => {\r\n this.searchDropdown($x, y as string);\r\n }\r\n });\r\n\r\n $(this.keyList.searchClass).inputmask(inputMaskHelper.wtpNumberMask(), inputMaskHelper.wtpMaskOptions());\r\n\r\n $('input[name=findMyTickets__input-type]').change(x => {\r\n let target = $('input[name=findMyTickets__input-type]:checked').attr('data-target');\r\n $(`.findMyTickets__input-content > div`).removeClass('active');\r\n $(`.findMyTickets__input-content > div[data-target=${target}]`).addClass('active');\r\n\r\n $(this.keyList.listClass).addClass('d-none');\r\n });\r\n\r\n $('.findMyTickets__input-find-btn').click(x => {\r\n let target = $('input[name=findMyTickets__input-type]:checked').attr('data-target');\r\n\r\n if (target === '1') {\r\n if ($(this.keyList.listClass).html() === '') return;\r\n this.switchTab();\r\n } else {\r\n this.searchText(true);\r\n }\r\n });\r\n\r\n $(this.keyList.searchClass).keyup(x => {\r\n let $target = $(x.delegateTarget);\r\n let value = $target.val();\r\n $(this.keyList.searchClass).parent().removeClass('invalid-form');\r\n $(this.keyList.formAssistantClass).html('');\r\n\r\n $(this.keyList.searchClass).not($target).val(value);\r\n });\r\n\r\n $('.findMyTickets__input-btn').click(x => {\r\n this.searchText(false);\r\n });\r\n }\r\n\r\n searchText(mobileTriggered: boolean) {\r\n this.loadChipCardData($(this.keyList.searchClass).val() as string, mobileTriggered);\r\n }\r\n\r\n searchDropdown($parent: JQuery<HTMLElement>, value: string) {\r\n $(this.keyList.searchClass).val('');\r\n this.loadChipCardData(value, false);\r\n }\r\n\r\n loadChipCardData(wtpNr: string, mobileTriggered: boolean) {\r\n this.currentWtp = wtpNr;\r\n AxessViewer.loadPartialView('/FindMyTicket/_GetChipCard',\r\n {\r\n wtpNr: wtpNr\r\n },\r\n resp => {\r\n if (resp.success) {\r\n $(this.keyList.detailClass).html('');\r\n $(this.keyList.listClass).removeClass('d-none');\r\n $(this.keyList.listClass).html(resp.view);\r\n this.registerListEvents();\r\n\r\n if (mobileTriggered) {\r\n this.switchTab();\r\n }\r\n } else {\r\n $(this.keyList.searchClass).parent().addClass('invalid-form');\r\n $(this.keyList.formAssistantClass).html(resp.message);\r\n }\r\n },\r\n { silent: true });\r\n }\r\n\r\n switchTab() {\r\n $('.findMyTickets__wrapper').toggleClass('d-none');\r\n $('.findMyTickets__result-wrapper').toggleClass('d-none');\r\n }\r\n\r\n registerListEvents() {\r\n $('.findMyTickets__list_return-btn').click(x => {\r\n this.switchTab();\r\n });\r\n\r\n $('.findMyTickets__ticketList-details').click(x => {\r\n let $target = $(x.delegateTarget);\r\n let data = {\r\n wtpNr: this.currentWtp,\r\n projNr: $target.attr('data-projNr'),\r\n posNr: $target.attr('data-posNr'),\r\n serialNr: $target.attr('data-serialNr'),\r\n validFrom: $target.attr('data-valid'),\r\n }\r\n\r\n AxessViewer.loadPartialView('/FindMyTicket/_Details',\r\n data,\r\n resp => {\r\n $('body, main').addClass('ax-bg-white');\r\n $(this.keyList.listClass).addClass('d-none');\r\n $(this.keyList.detailClass).html(resp.view);\r\n this.registerDetailEvents();\r\n },\r\n {});\r\n });\r\n }\r\n\r\n registerDetailEvents() {\r\n new AxAlert('.findMyTickets__details .ax-alert-banner');\r\n $('.findMyTickets__details-button').click(x => {\r\n $('body, main').removeClass('ax-bg-white');\r\n $(this.keyList.detailClass).html('');\r\n $(this.keyList.listClass).removeClass('d-none');\r\n });\r\n }\r\n}", "const QrScanner = require('qr-scanner');\r\n\r\nexport class wtpScanner {\r\n private qrScanner: any;\r\n private options: QrScannerOptions;\r\n\r\n detectWebcam(callback: (result: boolean) => void) {\r\n let md = navigator.mediaDevices;\r\n if (!md || !md.enumerateDevices) return callback(false);\r\n md.enumerateDevices().then((devices) => {\r\n callback(devices.some((device) => { return 'videoinput' === device.kind }));\r\n });\r\n }\r\n\r\n initQrCodeScanner(options: QrScannerOptions) {\r\n this.options = options;\r\n this.detectWebcam((hasWebcam) => {\r\n if (!hasWebcam) {\r\n return;\r\n }\r\n this.options.$activationButton.removeClass('d-none').addClass('d-block');\r\n\r\n this.qrScanner = new QrScanner(options.videoElem, (result) => {\r\n let wtpMatch = result.match('[A-Z0-9]{8}\\-[A-Z0-9]{3}\\-[A-Z0-9]{3}');\r\n if (wtpMatch.length > 0) {\r\n this.options.resultTarget.value = wtpMatch[0];\r\n this.options.$modal.modal('hide');\r\n }\r\n });\r\n\r\n options.$modal.on('hidden.bs.modal', (e) => {\r\n this.qrScanner.stop();\r\n });\r\n\r\n this.options.$activationButton.find('button').click(e => {\r\n this.startQrCodeScan();\r\n });\r\n });\r\n }\r\n\r\n startQrCodeScan() {\r\n this.qrScanner.start();\r\n this.options.$modal.modal('show');\r\n }\r\n}\r\n\r\nexport interface QrScannerOptions {\r\n videoElem: HTMLVideoElement;\r\n resultTarget: HTMLInputElement;\r\n $modal: JQuery<HTMLElement>;\r\n $activationButton: JQuery<HTMLElement>;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxAlert } from \"../../Limestone/AxAlert/AxAlert\";\r\nimport { wtpScanner } from \"../../Lib/Helper/wtpScanner\";\r\nimport { inputMaskHelper } from \"../../Lib/Helper/InputMaskHelper\";\r\n\r\n@ModuleName(\"MyChipCards\")\r\nexport class MyChipCards implements AxInit {\r\n\r\n private keyList = {\r\n listClass: '.myChipCards__list',\r\n detailClass: '.myChipCards__details'\r\n };\r\n\r\n constructor(private _wtpScanner = new wtpScanner()) {}\r\n\r\n AxInit(init): void {\r\n this.subNavEvents();\r\n \r\n $('.myChipCards__ticketList-details').click(x => {\r\n let $target = $(x.delegateTarget);\r\n let data = {\r\n wtpNr: $target.attr('data-wtpNr'),\r\n projNr: $target.attr('data-projNr'),\r\n posNr: $target.attr('data-posNr'),\r\n serialNr: $target.attr('data-serialNr'),\r\n validFrom: $target.attr('data-valid'),\r\n }\r\n\r\n AxessViewer.loadPartialView('/FindMyTicket/_Details',\r\n data,\r\n resp => {\r\n $('body, main').addClass('ax-bg-white');\r\n $(this.keyList.listClass).addClass('d-none');\r\n $(this.keyList.detailClass).html(resp.view);\r\n this.registerDetailEvents();\r\n },\r\n {});\r\n });\r\n \r\n this._wtpScanner.initQrCodeScanner({\r\n $activationButton: $('.scan-qr-button'),\r\n $modal: $('#webcam_modal'),\r\n resultTarget: document.querySelector('.wtp-input'),\r\n videoElem: document.getElementById('qr-video') as HTMLVideoElement\r\n });\r\n\r\n $('.myChipCards__ticketList-details-btn').click(x => {\r\n let target = $(x.delegateTarget).attr('data-target');\r\n $(x.delegateTarget).find('i').toggleClass('la-angle-down').toggleClass('la-angle-up');\r\n $(`.myChipCards__ticketList-details-block[data-target=${target}]`).toggleClass('d-none');\r\n });\r\n \r\n $('.openPass-input').inputmask(\"9999 9999 9999 9999 9999-999\", inputMaskHelper.openpassMaskOptions());\r\n $('.wtp-input').inputmask(inputMaskHelper.wtpNumberMask(), inputMaskHelper.wtpMaskOptions());\r\n }\r\n\r\n\r\n subNavEvents() {\r\n $('.myChipCards__subNav li').click(x => {\r\n $('.myChipCards__subNav li').removeClass('active');\r\n $(x.delegateTarget).addClass('active');\r\n let target = $(x.delegateTarget).attr('data-target');\r\n $('.myChipCards__content > div').removeClass('active');\r\n $(`.myChipCards__content > div[data-target=${target}]`).addClass('active');\r\n });\r\n }\r\n\r\n registerDetailEvents() {\r\n new AxAlert('.myChipCards__details .ax-alert-banner');\r\n $('.findMyTickets__details-button').click(x => {\r\n $(this.keyList.detailClass).html('');\r\n $('body, main').removeClass('ax-bg-white');\r\n $(this.keyList.listClass).removeClass('d-none');\r\n });\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport tippy, { Instance, Props } from \"tippy.js\";\r\n\r\n@ModuleName(\"UtilityInit\")\r\nexport class UtilityInit implements AxInit {\r\n AxInit(init: UtilityInitData): void {\r\n tippy('.wtp-input__hint-btn',\r\n {\r\n content: `<img src=\"${init.wtpImageSamplePath}\">`,\r\n allowHTML: true,\r\n placement: 'bottom',\r\n });\r\n }\r\n}\r\n\r\ninterface UtilityInitData {\r\n wtpImageSamplePath: string;\r\n}", "import Swal from 'sweetalert2';\r\nimport { AxInit, ModuleName } from '../../Lib/AxSystem/AxInit';\r\nimport { AxLoad } from '../../Lib/AxSystem/AxLoad';\r\nimport { I18nHelper, Translations } from '../../Lib/Helper/I18nHelper';\r\nimport { AxLimeStone } from '../../Limestone/AxLimeStone';\r\nimport { AxStaticConfigModule } from '../../Modules/AxConfig/AxStaticConfigModule';\r\n\r\n@ModuleName(\"AxFireShoppingCartModal\")\r\nexport class AxFireShoppingCartModal implements AxInit {\r\n private _i18nHelper = new I18nHelper();\r\n private result: any;\r\n private continueShoppingPath: any;\r\n private btn: any;\r\n private resetQuantity: boolean;\r\n private static sArray: string[] = window.location.pathname.split('/');\r\n private static baseUrl: string = `${window.location.protocol}//${window.location.host}/${AxFireShoppingCartModal.sArray[1]}/`;\r\n private static shoppingCartUrl: string = AxFireShoppingCartModal.baseUrl + 'ShoppingCart';\r\n private queryAddition: string;\r\n\r\n constructor(private LimeStone = new AxLimeStone()) { }\r\n\r\n AxInit(init: AxFireShoppingCartInitData): void {\r\n this.resetQuantity = init.resetQuantity;\r\n this.result = init.result;\r\n this.continueShoppingPath = init.continueShoppingPath;\r\n this.btn = init.btn;\r\n this.queryAddition = init.queryAddition || '';\r\n this.LimeStone.LockButton(this.btn);\r\n this.fireShoppingCart(this.result, this.resetQuantity ? false : true, this.continueShoppingPath);\r\n this.LimeStone.UnlockButton(this.btn);\r\n }\r\n\r\n fireShoppingCart(result, resetQuantity, continueShoppingPath) {\r\n resetQuantity = resetQuantity || false;\r\n continueShoppingPath = continueShoppingPath || '';\r\n let configModule = AxLoad.GetModule<AxStaticConfigModule>('AxStaticConfigModule');\r\n\r\n $('body').on('goToShoppingCartRedirect', (_, route) => {\r\n window.location.href = route;\r\n });\r\n\r\n if (result.success == true) {\r\n const redirect = AxFireShoppingCartModal.shoppingCartUrl + this.queryAddition;\r\n\r\n AxLoad.LoadModule('AxGA4Module', {\r\n caller: 'Add to Cart',\r\n event: 'Add to Cart',\r\n redirect,\r\n });\r\n\r\n if (resetQuantity) {\r\n $(\".store-checkbox\").val($('.store-checkbox option:first').val());\r\n }\r\n\r\n if (!configModule.skipAddedToCartPopup) {\r\n $('.cartConfirmation-modal').modal({ backdrop: 'static', keyboard: false })\r\n $('.cartConfirmation-modal').modal(\"show\");\r\n\r\n $('.ax-shoppingcart-goto-btn').on('click', () => {\r\n $('body').trigger('goToShoppingCartRedirect', redirect);\r\n });\r\n $('.ax-addmore-goto-btn').on('click', () => {\r\n window.location.href = this.getContinueShoppingUrl(continueShoppingPath);\r\n });\r\n }\r\n } else {\r\n this.LimeStone.UnlockAllButtons();\r\n let title = this._i18nHelper.GetTranslation(Translations.Error);\r\n if (typeof result.ErrorTitle !== 'undefined') {\r\n title = result.ErrorTitle;\r\n }\r\n Swal.fire({\r\n title,\r\n text: 'error',\r\n html: result.message,\r\n customClass: {\r\n closeButton: 'ax-btn ax-btn-secondary',\r\n confirmButton: 'ax-btn ax-btn-primary',\r\n },\r\n confirmButtonText: 'Ok',\r\n width: \"40%\",\r\n });\r\n }\r\n }\r\n\r\n getContinueShoppingUrl(continuePath) {\r\n switch (continuePath) {\r\n case 'Tickets':\r\n return AxFireShoppingCartModal.baseUrl + 'Tickets';\r\n case 'Rental':\r\n return AxFireShoppingCartModal.baseUrl + 'Rental';\r\n case 'Lessons':\r\n return AxFireShoppingCartModal.baseUrl + 'Lessons';\r\n case 'Retail':\r\n return AxFireShoppingCartModal.baseUrl + 'Retail';\r\n case 'GiftCards':\r\n return AxFireShoppingCartModal.baseUrl + 'GiftCards';\r\n case 'Packages':\r\n return AxFireShoppingCartModal.baseUrl + 'Packages';\r\n case 'Products':\r\n return AxFireShoppingCartModal.baseUrl + 'Products';\r\n default:\r\n return AxFireShoppingCartModal.baseUrl + 'Home';\r\n }\r\n }\r\n}\r\n\r\ninterface AxFireShoppingCartInitData {\r\n result: any;\r\n continueShoppingPath: any;\r\n queryAddition: string;\r\n btn: any;\r\n resetQuantity?: boolean;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"AxStaticConfigModule\")\r\nexport class AxStaticConfigModule implements AxInit {\r\n static GA4Enabled: boolean;\r\n skipAddedToCartPopup: boolean;\r\n skipSummary: boolean;\r\n\r\n AxInit(init: IAxStaticConfigInitData): void {\r\n AxStaticConfigModule.GA4Enabled = init.ga4Enabled;\r\n this.skipAddedToCartPopup = init.skipAddedToCartPopup;\r\n this.skipSummary = init.skipSummary;\r\n }\r\n}\r\n\r\nexport interface IAxStaticConfigInitData {\r\n ga4Enabled: boolean;\r\n skipAddedToCartPopup: boolean;\r\n skipSummary: boolean;\r\n}", "import { AxInit, ModuleName } from '../../Lib/AxSystem/AxInit';\r\nimport { AxLoad } from '../../Lib/AxSystem/AxLoad';\r\nimport { AxStaticConfigModule } from '../AxConfig/AxStaticConfigModule';\r\n\r\nconst silent = { silent: true };\r\n\r\n@ModuleName(\"AxGA4Module\")\r\nexport class AxGA4Module implements AxInit {\r\n public initData: AxGA4initDataListIdAndListName;\r\n AxInit(init: AxGA4initDataListIdAndListName) {\r\n if (!AxStaticConfigModule.GA4Enabled) { return };\r\n this.initData = init;\r\n if (this.initData.caller == 'ThankYou') {\r\n this.purchase(this.initData.items);\r\n };\r\n\r\n const calls: {action: string, caller: string, data?: AxGA4initDataListIdAndListName | any[]}[] = [\r\n { action: 'purchase', caller: 'ThankYou', data: this.initData.items },\r\n { action: 'sendData', caller: 'Category', data: this.initData },\r\n { action: 'sendData', caller: 'TicketsV4Index', data: this.initData },\r\n { action: 'sendData', caller: 'TicketTypes', data: this.initData },\r\n { action: 'sendData', caller: 'Rental', data: this.initData },\r\n { action: 'sendData', caller: 'Date', data: this.initData },\r\n { action: 'sendData', caller: 'TicketNonPredateAble', data: this.initData },\r\n { action: 'sendData', caller: 'TicketPredateAble', data: this.initData },\r\n { action: 'sendData', caller: 'PackagePredateAble', data: this.initData },\r\n { action: 'sendData', caller: 'PackageNonPredateAble', data: this.initData },\r\n { action: 'sendData', caller: 'TicketsDescription', data: this.initData },\r\n { action: 'lessonsInfo', caller: 'Lessons', data: this.initData.items },\r\n { action: 'lessonsInfo', caller: 'Lesson', data: this.initData.items },\r\n { action: 'quantityBookNow', caller: 'TicketsQuantityBookNow', data: this.initData.items },\r\n { action: 'quantityBookNow', caller: 'PackageQuantityBookNow', data: this.initData.items },\r\n { action: 'calendarBookNow', caller: 'TicketsCalendarBookNow', data: this.initData.items },\r\n { action: 'calendarBookNow', caller: 'PackagesCalendarBookNow', data: this.initData.items },\r\n { action: 'goToBag', caller: 'Go To Bag' },\r\n { action: 'getPaymentInfo', caller: 'Resort charge' },\r\n { action: 'addToCart', caller: 'Add to Cart' },\r\n ];\r\n calls.forEach((call) => {\r\n if (this.initData.caller === call.caller) {\r\n this[call.action](call.data);\r\n }\r\n });\r\n\r\n if (this.initData.caller == 'Go To Bag' || this.initData.caller == 'Refresh ShoppingCart entries') {\r\n let proceedToCheckout = document.querySelector('[data-shoppingcart=\"proceed\"]');\r\n if (proceedToCheckout != null) {\r\n proceedToCheckout.addEventListener('click', onclick, false);\r\n $('[data-shoppingcart=\"proceed\"]').on('click', () => {\r\n this.proceedToCheckoutGA4();\r\n });\r\n let deleteItem = document.querySelector('.delete-position');\r\n document.querySelector('.delete-position');\r\n if (deleteItem != null) {\r\n let elem = document.querySelectorAll('a[data-position-id]');\r\n elem.forEach(e => {\r\n if (e.classList.contains('delete-position')) {\r\n e.addEventListener('click', onclick, false);\r\n $(e).click((x) => {\r\n this.removeItemFromCart(x.currentTarget.getAttribute(\"data-position-id\"));\r\n });\r\n }\r\n })\r\n }\r\n }\r\n };\r\n\r\n if (this.initData.caller == 'RentalIndex') {\r\n this.sendData(this.initData);\r\n let rentalIndexMenu = document.querySelector('.ticketGroupCollapse');\r\n rentalIndexMenu.addEventListener('click', onclick, false);\r\n $('.ticketGroupCollapse').on('click', (e) => {\r\n let dataTarget = document.querySelector(e.currentTarget.getAttribute(\"data-target\"));\r\n if (dataTarget != null) {\r\n if (dataTarget.hasAttribute('package')) {\r\n this.rentalMenuGA4(dataTarget.getAttribute(\"data-item\"), \"package\");\r\n }\r\n else {\r\n this.rentalMenuGA4(dataTarget.getAttribute(\"data-item\"), \"rental\");\r\n }\r\n }\r\n });\r\n };\r\n\r\n $('.package-selection').on('click', (e) => {\r\n this.getGridderDataForPackage(e.currentTarget.getAttribute(\"data-packageNr\"), e.currentTarget.getAttribute(\"data-TariffSheetNrriff\"));\r\n });\r\n $('.rental-selection').on('click', (e) => {\r\n this.getGridderDataForRental(e.currentTarget.getAttribute(\"data-rental\"));\r\n });\r\n }\r\n\r\n getPaymentInfo() {\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4AddPaymentInfoResult', \"\", (resp) => {\r\n let data: AxGA4initDataExtendedWithPaymentType = {\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'GA4AddPaymentInfoResult',\r\n value: resp.gTMEcommerce.ecommerceData.value,\r\n currency: resp.gTMEcommerce.ecommerceData.currency,\r\n payment_type: resp.gTMEcommerce.ecommerceData.paymentType,\r\n coupon: resp.gTMEcommerce.ecommerceData.coupon\r\n };\r\n this.sendDataExtendedWithPayment(data);\r\n }, silent);\r\n }\r\n\r\n addToCart() {\r\n let data = {};\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4AddItemToCartResult', data, (resp) => {\r\n let data: AxGA4initDataExtendedCurAndVal = {\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'AddToCart',\r\n value: resp.gTMEcommerce.ecommerceData.value,\r\n currency: resp.gTMEcommerce.ecommerceData.currency\r\n };\r\n this.sendDataExtended(data);\r\n }, silent);\r\n }\r\n\r\n parseRentalItem(rentalItemParam: RentalSingleItemParam): RentalSingleItemParam {\r\n let param: RentalSingleItemParam = { RentalNr: rentalItemParam.RentalNr, ValidFrom: JSON.parse(rentalItemParam.ValidFrom), ValidTo: JSON.parse(rentalItemParam.ValidTo) }\r\n return param;\r\n }\r\n\r\n rentalMenuGA4(value: string, packOrRental: string) {\r\n if (packOrRental == 'package') {\r\n let jsonObj: RentalPackageParamCollection;\r\n jsonObj = JSON.parse(value);\r\n let data = {\r\n itemParamCollection: jsonObj\r\n };\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4RentalPackagesResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'RentalPackagesViewList'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n } else {\r\n let jsonObj: RentalItemParamCollection = JSON.parse(value);\r\n let parsedObject: RentalItemParamCollection = { ItemParams: [] };\r\n jsonObj.ItemParams.forEach(e => {\r\n parsedObject.ItemParams.push(this.parseRentalItem(e));\r\n });\r\n let data = {\r\n itemParamCollection: parsedObject\r\n };\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4RentalItemsResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'RentalViewList'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n }\r\n\r\n proceedToCheckoutGA4() {\r\n let data = {};\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4ProceedToCheckoutResult', data, (resp) => {\r\n let respData: AxGA4initDataExtendedCurAndVal = {\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'ProceedToCheckout',\r\n value: resp.gTMEcommerce.ecommerceData.value,\r\n currency: resp.gTMEcommerce.ecommerceData.currency\r\n };\r\n this.sendDataExtended(respData);\r\n }, silent);\r\n }\r\n\r\n lessonsInfo(value: any[]) {\r\n let data = value;\r\n if (this.initData.caller == 'Lessons') {\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4LessonsResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'Lessons'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n if (this.initData.caller == 'Lesson') {\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4LessonResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'Lesson'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n }\r\n\r\n calendarBookNow(value: any[]) {\r\n let data = { item: value };\r\n if (this.initData.caller == 'TicketsCalendarBookNow') {\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4CalendarTicketsResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'TicketsCalendarBookNow'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n if (this.initData.caller == 'PackagesCalendarBookNow') {\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4CalendarPackagesResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'PackagesCalendarBookNow'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n }\r\n\r\n quantityBookNow(value: any[]) {\r\n let data = { item: value };\r\n if (this.initData.caller == 'TicketsQuantityBookNow') {\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4QuantityTicketsResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'TicketsQuantityBookNow'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n if (this.initData.caller == 'PackagesQuantityBookNow') {\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4QuantityPackagesResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'PackagesQuantityBookNow'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n }\r\n\r\n purchase(value: any[]) {\r\n let data = { orderNr: value };\r\n AxessViewer.loadPartialView('/GA4TagManager/Purchase', data, (resp) => {\r\n let respData: AxGA4initDataExtendedWithTransactionID = {\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'GA4Payment',\r\n value: resp.gTMEcommerce.ecommerceData.value,\r\n currency: resp.gTMEcommerce.ecommerceData.currency,\r\n transaction_id: resp.gTMEcommerce.ecommerceData.transactionId,\r\n tax: resp.gTMEcommerce.ecommerceData.tax,\r\n shipping: resp.gTMEcommerce.ecommerceData.shipping,\r\n coupon: resp.gTMEcommerce.ecommerceData.coupon\r\n };\r\n this.sendDataExtendedWithTransactionID(respData);\r\n }, silent);\r\n }\r\n\r\n goToBag() {\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4GoToBagResult', \"\", (resp) => {\r\n let data: AxGA4initDataExtendedCurAndVal = {\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event,\r\n caller: 'GA4GoToBagResult',\r\n value: resp.gTMEcommerce.ecommerceData.value,\r\n currency: resp.gTMEcommerce.ecommerceData.currency\r\n };\r\n this.sendDataExtended(data);\r\n }, silent);\r\n }\r\n\r\n removeItemFromCart(value: any) {\r\n let data = { targetPositionId: value };\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4RemoveItemFromCartResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event, caller: 'GetGA4RemoveItemFromCart'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n\r\n getGridderDataForPackage(argPackageNr: string, argTariffSheetNr: string) {\r\n let packageData: RentalPackageParam = { PackNr: argPackageNr, TariffsheetNr: argTariffSheetNr };\r\n let data = { itemParam: packageData };\r\n\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4RentalPackageResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event, caller: 'GetGA4RentalPackage'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n\r\n getGridderDataForRental(rentalItem: string) {\r\n let jsonObj: RentalSingleItemParam = JSON.parse(rentalItem);\r\n let itemParam: RentalSingleItemParam = this.parseRentalItem(jsonObj);\r\n let data = { itemParam };\r\n AxessViewer.loadPartialView('/GA4TagManager/GA4RentalItemResult', data, (resp) => {\r\n this.initData = {\r\n item_list_id: resp.gTMEcommerce.ecommerceData.item_list_id,\r\n item_list_name: resp.gTMEcommerce.ecommerceData.item_list_name,\r\n items: resp.gTMEcommerce.ecommerceData.items,\r\n event: resp.gTMEcommerce.Event, caller: 'GetGA4RentalRentalItem'\r\n };\r\n this.sendData(this.initData);\r\n }, silent);\r\n }\r\n\r\n sendData(init: AxGA4initDataListIdAndListName) {\r\n this.showLog(init);\r\n if (init.event == '') { return; }\r\n window.dataLayer = window.dataLayer || [];\r\n window.dataLayer.push(function () { this.reset(); }); // Clear the previous ecommerce object.\r\n window.dataLayer.push({\r\n event: init.event,\r\n ecommerce:\r\n {\r\n item_list_id: init.item_list_id,\r\n item_list_name: init.item_list_name,\r\n items: init.items\r\n }\r\n });\r\n }\r\n\r\n sendDataExtended(init: AxGA4initDataExtendedCurAndVal) {\r\n const configModule = AxLoad.GetModule<AxStaticConfigModule>('AxStaticConfigModule');\r\n this.showLog(init);\r\n if (init.event == '') { return; }\r\n window.dataLayer = window.dataLayer || [];\r\n window.dataLayer.push(function () { this.reset(); }); // Clear the previous ecommerce object.\r\n window.dataLayer.push({\r\n event: init.event,\r\n ecommerce:\r\n {\r\n currency: init.currency,\r\n value: init.value,\r\n items: init.items\r\n }\r\n });\r\n if (this.initData.redirect && configModule.skipAddedToCartPopup) {\r\n $('body').trigger('goToShoppingCartRedirect', this.initData.redirect);\r\n }\r\n }\r\n\r\n sendDataExtendedWithPayment(init: AxGA4initDataExtendedWithPaymentType) {\r\n this.showLog(init);\r\n if (init.event == '') { return; }\r\n window.dataLayer = window.dataLayer || [];\r\n window.dataLayer.push(function () { this.reset(); }); // Clear the previous ecommerce object.\r\n window.dataLayer.push({\r\n event: init.event,\r\n ecommerce:\r\n {\r\n payment_type: init.payment_type,\r\n currency: init.currency,\r\n value: init.value,\r\n coupon: init.coupon,\r\n items: init.items\r\n }\r\n });\r\n }\r\n\r\n sendDataExtendedWithTransactionID(init: AxGA4initDataExtendedWithTransactionID) {\r\n this.showLog(init);\r\n if (init.event == '') { return; }\r\n window.dataLayer = window.dataLayer || [];\r\n window.dataLayer.push(function () { this.reset(); }); // Clear the previous ecommerce object.\r\n window.dataLayer.push({\r\n event: init.event,\r\n ecommerce:\r\n {\r\n transaction_id: init.transaction_id,\r\n tax: init.tax,\r\n shipping: init.shipping,\r\n coupon: init.coupon,\r\n currency: init.currency,\r\n value: init.value,\r\n items: init.items\r\n }\r\n });\r\n }\r\n\r\n showLog(init: AxGA4initData) {\r\n /*console.log(init);*/\r\n }\r\n}\r\n\r\ninterface AxGA4initData {\r\n event: string;\r\n caller: string;\r\n items: any[];\r\n redirect?: string;\r\n}\r\ninterface AxGA4initDataListIdAndListName extends AxGA4initData {\r\n item_list_id: string;\r\n item_list_name: string;\r\n}\r\ninterface AxGA4initDataExtendedCurAndVal extends AxGA4initData {\r\n currency: string;\r\n value: number;\r\n}\r\ninterface AxGA4initDataExtendedWithTransactionID extends AxGA4initDataExtendedCurAndVal {\r\n transaction_id: string;\r\n tax: number;\r\n shipping: string;\r\n coupon: string;\r\n}\r\ninterface AxGA4initDataExtendedWithPaymentType extends AxGA4initDataExtendedCurAndVal {\r\n payment_type: string;\r\n coupon: string;\r\n}\r\ninterface RentalSingleItemParam {\r\n RentalNr: string;\r\n ValidFrom: string;\r\n ValidTo: string;\r\n}\r\ninterface RentalItemParamCollection {\r\n ItemParams: RentalSingleItemParam[];\r\n}\r\ninterface RentalPackageParam {\r\n PackNr: string;\r\n TariffsheetNr: string;\r\n}\r\ninterface RentalPackageParamCollection {\r\n ItemParams: RentalPackageParam[];\r\n}\r\n\r\ndeclare global {\r\n export interface Window {\r\n dataLayer?: object[];\r\n }\r\n}", "import Swal from \"sweetalert2\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\n\r\nexport interface IServerErrorPopUpInit {\r\n xhr: any;\r\n thrownError: any;\r\n}\r\n\r\n@ModuleName(\"ServerErrorPopUp\")\r\nexport class ServerErrorPopUp implements AxInit {\r\n\r\n private i18NHelper = new I18nHelper();\r\n\r\n AxInit(init: IServerErrorPopUpInit): void {\r\n let errorText = `<div>${this.i18NHelper.GetTranslation(Translations.ServerErrorText1)}</div>\r\n <div>${this.i18NHelper.GetTranslation(Translations.ServerErrorText2)}</div>`;\r\n\r\n if (init == null || typeof init == 'undefined') {\r\n return;\r\n }\r\n\r\n Swal.fire({\r\n title: this.i18NHelper.GetTranslation(Translations.Oops),\r\n icon: 'warning',\r\n html: errorText\r\n }).then(() => {\r\n location.reload();\r\n });\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { CultureInfo } from \"../../Models/Culture/CultureInfo\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { PriceHelper } from \"../../Lib/Helper/PriceHelper\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\n\r\n@ModuleName(\"VoucherPayment\")\r\nexport class VoucherPayment implements AxInit {\r\n constructor(private _AxLimestone = new AxLimeStone(),\r\n private _i18nHelper = new I18nHelper()) { }\r\n\r\n private PriceHelper: PriceHelper;\r\n\r\n AxInit(init: VoucherPaymentInitData): void {\r\n this.PriceHelper = new PriceHelper(init.CultureInfo, false);\r\n\r\n $('#kt_portlet__resort_charge').on('click', '.payment__voucherPayment-redeem', x => {\r\n $('.payment__voucherPayment-info').addClass('d-none');\r\n let voucherData = $('#payment__voucherPayment-form').serialize();\r\n this._AxLimestone.LockButton(x.currentTarget);\r\n\r\n AxessViewer.loadPartialView('/VoucherPayment/CheckVoucher', voucherData, (resp: BalanceResult) => {\r\n $('#payment__voucherPayment-form .ax-form-group-assistance').html('');\r\n $('.payment__voucherPayment-message').html('');\r\n\r\n if (resp.IsRedeemable) {\r\n $('.payment__voucherPayment-info').removeClass('d-none');\r\n $('.payment__voucherPayment-value').html(this.PriceHelper.GetPriceString(this.PriceHelper.GetPrice(resp.UsedAmount) * -1));\r\n $('.payment__voucherPayment-available').html(this.PriceHelper.GetPriceString(this.PriceHelper.GetPrice(resp.BalanceInCents)));\r\n\r\n if (!resp.PartlyRedeemable) {\r\n $('.payment__voucherPayment-addition')\r\n .html(this._i18nHelper.GetTranslation(Translations.VoucherNotPartlyRedeemable));\r\n }\r\n } else {\r\n $('.payment__voucherPayment-value').html(this.PriceHelper.GetPriceString(this.PriceHelper.GetPrice(0)));\r\n $('.payment__voucherPayment-available').html(this.PriceHelper.GetPriceString(this.PriceHelper.GetPrice(0)));\r\n }\r\n\r\n $('.payment__bank-value').html(this.PriceHelper.GetPriceString(this.PriceHelper.GetPrice(resp.RestAmount)));\r\n if (resp.Message !== '') {\r\n $('.payment__voucherPayment-info').removeClass('d-none');\r\n\r\n $('#payment__voucherPayment-form .ax-form-group-assistance').html(resp.Message);\r\n $('#payment__voucherPayment-form .ax-form-group-assistance').toggleClass('success', resp.IsRedeemable);\r\n\r\n $('.payment__voucherPayment-message').html(resp.Message);\r\n $('.payment__voucherPayment-message').toggleClass('ax-color-red-400', !resp.IsRedeemable);\r\n }\r\n this._AxLimestone.UnlockButton(x.currentTarget);\r\n }, {});\r\n });\r\n }\r\n}\r\n\r\ninterface VoucherPaymentInitData {\r\n CultureInfo: CultureInfo\r\n}\r\n\r\ninterface BalanceResult {\r\n Code: string;\r\n BalanceInCents: number;\r\n TotalAmountInCents: number;\r\n Message: string;\r\n IsRedeemable: boolean;\r\n RestAmount: number;\r\n PartlyRedeemable: boolean;\r\n UsedAmount: number;\r\n}", "import { Console } from \"console\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"Unsubscribe\")\r\nexport class Unsubscribe implements AxInit {\r\n\r\n private token: string;\r\n\r\n AxInit(token: string): void {\r\n console.log(token);\r\n\r\n this.token = token;\r\n\r\n let that = this;\r\n\r\n $(\".ax-btn.ax-btn-primary\").on(\"click\", function () {\r\n that.Unsubscribe();\r\n });\r\n }\r\n\r\n Unsubscribe() {\r\n let urlPath = window.location.pathname.toLowerCase().replace(\"manage\", \"unsubscribe\");\r\n let unsubscribeUrl = urlPath + window.location.search;\r\n window.location.href = unsubscribeUrl;\r\n }\r\n\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { CookieHelper } from \"../../Lib/Helper/CookieHelper\";\r\n\r\n@ModuleName(\"Banner\")\r\nexport class Banner implements AxInit {\r\n constructor(private _cookieHelper = new CookieHelper()){}\r\n\r\n AxInit(init: IBannerInitData): void {\r\n const $alertBanner = $('.ax-alert-banner-holder');\r\n const $infoBanner = $('.ax-info-banner-holder');\r\n\r\n if ($alertBanner.length > 0) {\r\n const bannerId = $alertBanner.attr('data-id');\r\n this._cookieHelper.setCookie('ax_abv_' + bannerId, true, 7);\r\n\r\n if (init.alertConfig.alertBannerAllowClosing) {\r\n $('.ax-alert-banner-holder .closeButtonBanner').click(x => {\r\n this._cookieHelper.setCookie('ax_abc_' + bannerId, true, 7);\r\n\r\n $alertBanner.remove();\r\n $('body').removeClass('ax-head-banner_a');\r\n });\r\n }\r\n\r\n $('body').addClass('ax-head-banner_a');\r\n }\r\n\r\n if ($infoBanner.length > 0) {\r\n let bannerId = $infoBanner.attr('data-id');\r\n this._cookieHelper.setCookie('ax_ibv_' + bannerId, true, 7);\r\n\r\n if (init.infoConfig.infoBannerAllowClosing) {\r\n $('.ax-info-banner-holder .ax-info-banner-close-btn').click(x => {\r\n this._cookieHelper.setCookie('ax_ibc_' + bannerId, true, 7);\r\n\r\n $infoBanner.remove();\r\n });\r\n }\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\ninterface IBannerInitData {\r\n alertConfig: IAlertConfig;\r\n infoConfig: IInfoConfig;\r\n}\r\n\r\ninterface IAlertConfig {\r\n alertBannerAllowClosing: boolean;\r\n}\r\n\r\ninterface IInfoConfig {\r\n infoBannerAllowClosing: boolean;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\ninterface IHeroModuleInitData {\r\n\r\n}\r\n\r\n@ModuleName(\"HeroModule\")\r\nexport class HeroModule implements AxInit {\r\n\r\n AxInit(init: IHeroModuleInitData): void {\r\n this.initScrollListener();\r\n }\r\n\r\n initScrollListener() {\r\n $(window).scroll(function () {\r\n let scroll = $(window).scrollTop();\r\n \r\n $(\".ax-store-hero__background\").css({\r\n filter: \"blur(\" + (scroll/25) + \"px)\"\r\n });\r\n });\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxAlert } from \"../../Limestone/AxAlert/AxAlert\";\r\nimport { ProgressBarMode, ProgressBar } from \"../Global/Progressbar\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { TicketList } from \"../../Components/ProductList/TicketList\";\r\nimport { Translations, I18nHelper } from \"../../Lib/Helper/I18nHelper\";\r\nimport Swal from \"sweetalert2\";\r\n\r\n@ModuleName(\"Payment\")\r\nexport class Payment implements AxInit {\r\n constructor(\r\n protected _Progressbar = new ProgressBar(),\r\n private _I18nHelper = new I18nHelper()\r\n ) { }\r\n\r\n AxInit(init: PaymentInit): void {\r\n this.checkSelectedDate(init.postData, init.ticketDefIsKGT23);\r\n $('.input-consent-doc-submit-button').on('click', () => {\r\n this.checkSelectedDate(init.postData, init.ticketDefIsKGT23);\r\n });\r\n\r\n if (init.processIndicatorActive) {\r\n let progress: number = init.progressBarMode == ProgressBarMode.Suballotment ? 4 : 3;\r\n\r\n this._Progressbar.Init({\r\n Mode: init.progressBarMode,\r\n Progress: progress\r\n });\r\n }\r\n\r\n $(document).on('click', '.btn__waiver_agree', (e) => {\r\n e.preventDefault();\r\n let waiverId = $(e.currentTarget).attr('waiver_id');\r\n this.checkReleaseOfLiability(waiverId);\r\n });\r\n }\r\n\r\n checkSelectedDate(postData, ticketDefIsKGT23) {\r\n const currentDate = new Date();\r\n const momentInstance = moment(currentDate);\r\n postData.forEach((value, index) => {\r\n const cartEntryDate = value?.Ticket?.ValidTo?.split('T')[0];\r\n if (cartEntryDate && cartEntryDate < momentInstance.format('YYYY-MM-DD') && !ticketDefIsKGT23) {\r\n $('#kt_portlet__overview').hide();\r\n $('#kt_portlet__resort_charge').hide();\r\n $('#kt_portlet__payment').hide();\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.WrongDay),\r\n text: this._I18nHelper.GetTranslation(Translations.WrongSelectedDay),\r\n icon: 'warning',\r\n showCancelButton: false,\r\n confirmButtonText: this._I18nHelper.GetTranslation(Translations.AdminClose)\r\n }).then((result) => {\r\n if (result.isConfirmed) {\r\n window.location.href = '/';\r\n }\r\n });\r\n }\r\n });\r\n }\r\n\r\n checkReleaseOfLiability(waiverModalNr) {\r\n let name = $('input[name=waiver-acceptance-name_' + waiverModalNr + ']').val();\r\n if (name != '') {\r\n AxessViewer.loadPartialView(\"/AxessWaiver/CheckLiability\", {\r\n cartEntryID: $('#rel_liab_entryID').val(),\r\n name: name\r\n }, (result) => {\r\n if (result.success) {\r\n $('input[name=relOfLiab_' + $('#rel_liab_entryID').val() + ']').prop('checked', true);\r\n this.hideAllModals();\r\n } else {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Error),\r\n html: this._I18nHelper.GetTranslation(Translations.WaiverSaveFail),\r\n icon: 'error',\r\n customClass: {\r\n closeButton: 'btn btn-secondary',\r\n confirmButton: 'btn btn-primary',\r\n },\r\n confirmButtonText: this._I18nHelper.GetTranslation(Translations.Ok),\r\n });\r\n }\r\n }, {\r\n lockButtonSelector: '.btn__waiver_agree'\r\n });\r\n\r\n } else {\r\n $('input[name=waiver-acceptance-name]').addClass('invalid');\r\n }\r\n }\r\n\r\n hideAllModals() {\r\n $('#kt_modal_sm').modal('hide');\r\n $('#kt_modal_md').modal('hide');\r\n $('#kt_modal_lg').modal('hide');\r\n $('#kt_modal_xl').modal('hide');\r\n $('.modal-body').html('');\r\n }\r\n}\r\nclass PaymentInit {\r\n processIndicatorActive: boolean;\r\n ticketDefIsKGT23: boolean;\r\n progressBarMode: ProgressBarMode;\r\n postData: any;\r\n}", "import * as ls from \"local-storage\";\r\nimport { LocalStorageKeyCollection } from \"../../Lib/Constants/KeyCollection/LocalStorageKeyCollection\";\r\n\r\nexport class AccountStorageService {\r\n constructor() { }\r\n\r\n init(formData?: any) {\r\n if (document.referrer == null || document.referrer === '') {\r\n ls.remove(LocalStorageKeyCollection.accountLoginStorage);\r\n return;\r\n }\r\n\r\n let referrer = new URL(document.referrer);\r\n let currentUrl = new URL(window.location.href);\r\n\r\n let params = currentUrl.searchParams;\r\n let refParam = params.get(\"ref\");\r\n\r\n let cleanUp = refParam != null && refParam.toLowerCase() === \"clean\";\r\n\r\n if (cleanUp || (this.cleanStorage(referrer, currentUrl) && formData == null)) {\r\n ls.remove(LocalStorageKeyCollection.accountLoginStorage);\r\n }\r\n\r\n if (referrer.hostname === currentUrl.hostname && !this.isAccountPage(referrer) && formData != null) {\r\n ls.set<IAccountStorageObject>(LocalStorageKeyCollection.accountLoginStorage,\r\n {\r\n referrer: referrer.pathname,\r\n data: formData,\r\n target: currentUrl.pathname + currentUrl.search\r\n });\r\n }\r\n }\r\n\r\n getStorage() {\r\n return ls.get<IAccountStorageObject>(LocalStorageKeyCollection.accountLoginStorage);\r\n }\r\n \r\n cleanStorage(referrer: URL, currentUrl: URL) {\r\n if (referrer.hostname !== currentUrl.hostname) return true;\r\n let data = this.getStorage();\r\n\r\n if (data?.referrer === referrer.pathname) return false;\r\n if (this.isAccountPage(referrer)) return false;\r\n\r\n return true;\r\n }\r\n\r\n isAccountPage(url: URL) {\r\n const pathChunks = url.pathname.split('/')?.filter(x => x.trim() !== '');\r\n\r\n if ((pathChunks.length > 1 && pathChunks[1].toLowerCase() === 'account') || (pathChunks.length > 0 && pathChunks[0].toLowerCase() === 'account')) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n\r\ninterface IAccountStorageObject {\r\n data: any;\r\n referrer: string;\r\n target: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { IAxBirthDateInitData } from \"../Global/AxBirthDateInputTriple\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { AxDropdown, AxFormValidation, IAxDropdownOptions } from \"@axess/limestone\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AccountStorageService } from \"../../Service/Account/AccountStorageService\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\n\r\n@ModuleName(\"Registration\")\r\nexport class Registration implements AxInit {\r\n constructor(private _storage = new AccountStorageService(),\r\n private _requestHelper = new RequestHelper()) { }\r\n\r\n private _CountryDropDown: AxDropdown = new AxDropdown();\r\n private _CommunicationLanguage: AxDropdown = new AxDropdown();\r\n private _RentalWeightDropDown: AxDropdown = new AxDropdown();\r\n private _RentalHeightDropDown: AxDropdown = new AxDropdown();\r\n private _RentalShowSizeDropDown: AxDropdown = new AxDropdown();\r\n private _RentalSkiLevelDropDown: AxDropdown = new AxDropdown();\r\n private _GenderDropdown: AxDropdown = new AxDropdown();\r\n\r\n\r\n private countryList: CountryList[] = [];\r\n private parentSelector;\r\n\r\n private subDivisionSearchTimeout: NodeJS.Timeout;\r\n private _I18nHelper = new I18nHelper;\r\n\r\n AxInit(init: IRegistrationData): void {\r\n this._storage.init(init.formData);\r\n this.parentSelector = init.parentId;\r\n\r\n AxLoad.LoadModule('AxBirthDateInputTriple', init);\r\n AxLoad.LoadModule('RegisterForm', init);\r\n\r\n let currentUrl = new URL(window.location.href);\r\n if (!this._storage.isAccountPage(currentUrl)) {\r\n history.replaceState({}, $(document).find(\"title\").text(), init.loginUrl);\r\n }\r\n let currentStorage = this._storage.getStorage();\r\n if (currentStorage?.referrer != null && currentStorage.referrer.toLowerCase().indexOf('shoppingcart') !== -1) {\r\n $('[data-login=\"guest\"]').removeClass('d-none');\r\n }\r\n\r\n this._GenderDropdown.init(`${init.parentId} .accountsettings__gender`);\r\n\r\n this._CountryDropDown.init(`${init.parentId} .register__countryCode`,\r\n {\r\n searchBar: true,\r\n multiSelect: false,\r\n onSelect: (x, y) => {\r\n this.subDivisionSearchTimeout = setTimeout(() => {\r\n this.searchSubDivision();\r\n }, 200);\r\n $('#RegCountryCode').val(y)\r\n }\r\n });\r\n\r\n this._CommunicationLanguage.init('.register__language', {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: (x, y) => {\r\n $('#Language').val(y);\r\n }\r\n });\r\n\r\n $(`.accountsettings__postalCode`).on(\"keyup\", () => {\r\n if (typeof this.subDivisionSearchTimeout != 'undefined') {\r\n clearTimeout(this.subDivisionSearchTimeout);\r\n }\r\n\r\n this.subDivisionSearchTimeout = setTimeout(() => {\r\n this.searchSubDivision();\r\n }, 200);\r\n });\r\n\r\n $(init.rental_parentId).on(\"change\", \"input[type=radio]\", (e) => {\r\n let rentalViewModel = {\r\n Height: $(\"#RentalHeight\").val(),\r\n Weight: $(\"#RentalWeight\").val(),\r\n ShoeSize: $(\"#RentalShoeSize\").val(),\r\n SkiLevel: $(\"#RentalSkiLevel\").val()\r\n };\r\n\r\n AxessViewer.loadPartialView('/Account/GetAccRentalInfo', {\r\n rentalViewModel: rentalViewModel,\r\n unit: e.currentTarget.value\r\n }, (resp) => {\r\n $('#registration__rentalContainer').html(resp.view);\r\n this.initRentDropdowns(this);\r\n }, null);\r\n });\r\n this.initRentDropdowns(this);\r\n\r\n //GuestForm\r\n new AxFormValidation({\r\n selector: '#guestForm',\r\n rules: {\r\n guestEmail: {\r\n required: true,\r\n email: true,\r\n regex: /^\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b$/i,\r\n },\r\n guestConfirmEmail: {\r\n required: true,\r\n equalTo: \"#guestEmail\"\r\n },\r\n }\r\n }).init();\r\n\r\n $('[data-checkout=\"guest\"]').on('click', () => {\r\n this.guestCheckout();\r\n });\r\n }\r\n\r\n guestCheckout() {\r\n let currentStorage = this._storage.getStorage();\r\n if (currentStorage?.referrer != null && currentStorage.referrer.toLowerCase().indexOf('shoppingcart') !== -1) {\r\n $('[data-login=\"guest\"]').removeClass('d-none');\r\n }\r\n const hasValues = $('#guestEmail').val() !== '' && $('#guestConfirmEmail').val() !== '';\r\n const hasSameValue = $('#guestConfirmEmail').length == 0 || $('#guestEmail').val() === $('#guestConfirmEmail').val();\r\n const hasGuestFieldErrors = $('#guestEmail').hasClass('field-error') || $('#guestConfirmEmail').hasClass('field-error');\r\n\r\n if (hasValues && hasSameValue && !hasGuestFieldErrors) {\r\n currentStorage.data.BuyerEmail = $('#guestEmail').val();\r\n this._requestHelper.postToUrl(currentStorage.target, currentStorage.data);\r\n }\r\n }\r\n\r\n searchSubDivision() {\r\n let $selected: JQuery<HTMLElement> = this._CountryDropDown.getSelected();\r\n\r\n if (typeof $selected == \"undefined\" || $selected.length === 0) return;\r\n\r\n let isoCode = $selected.attr('data-iso') as string;\r\n\r\n if (isoCode === '') return;\r\n\r\n let countryEntry: CountryList = this.countryList.find(x => x.isoCode === isoCode);\r\n\r\n if (typeof countryEntry != 'undefined') {\r\n this.printSubDivision(countryEntry.subDivisionList);\r\n return;\r\n }\r\n\r\n AxessViewer.loadPartialView('/AccUtil/GetSubDivisionList',\r\n { iso2Code: isoCode },\r\n (res: SubDivisionWithCodeList[]) => {\r\n this.countryList.push({\r\n isoCode: isoCode,\r\n subDivisionList: res\r\n });\r\n this.printSubDivision(res);\r\n }, {});\r\n }\r\n\r\n printSubDivision(subDivisionList: SubDivisionWithCodeList[]) {\r\n let postalCode = this.getPostalCode();\r\n let $dropDownParent: JQuery<HTMLElement> = $(this._CountryDropDown.getElements()[0]);\r\n let $stateField = $dropDownParent.next('.state-field');\r\n\r\n if (typeof postalCode != 'undefined' && postalCode.length === 0) {\r\n this.removePostalCodeInfo($stateField);\r\n return;\r\n };\r\n\r\n let selectedDivision: SubDivisionWithCodeList = subDivisionList.find((x: SubDivisionWithCodeList) => x.PostalCodes.includes(postalCode));\r\n\r\n if (typeof selectedDivision == 'undefined') {\r\n this.removePostalCodeInfo($stateField);\r\n return;\r\n }\r\n\r\n if ($stateField.length > 0) {\r\n this.removePostalCodeInfo($stateField);\r\n return;\r\n }\r\n\r\n if ($stateField.length === 0) {\r\n let newInfoDiv = document.createElement('div');\r\n newInfoDiv.classList.add('ax-form-group');\r\n newInfoDiv.classList.add('ax-mt-1');\r\n newInfoDiv.classList.add('state-field');\r\n\r\n let newInfoInput = document.createElement('input');\r\n newInfoInput.setAttribute('type', 'text');\r\n newInfoInput.setAttribute('disabled', 'disabled');\r\n newInfoInput.setAttribute('value', selectedDivision.SubDivision.SubDivisionName);\r\n newInfoInput.classList.add('ax-form-control');\r\n\r\n\r\n let newInfoLabel = document.createElement('label');\r\n newInfoLabel.classList.add('ax-form-label');\r\n newInfoLabel.innerText = `${this._I18nHelper.GetTranslation(Translations.State)}`;\r\n\r\n let newInfoDivGroupAssistance = document.createElement('div');\r\n newInfoDivGroupAssistance.classList.add('ax-form-group-assistence');\r\n\r\n newInfoDiv.appendChild(newInfoInput);\r\n newInfoDiv.appendChild(newInfoLabel);\r\n newInfoDiv.appendChild(newInfoDivGroupAssistance);\r\n\r\n $dropDownParent.after(newInfoDiv);\r\n $stateField = $dropDownParent.next('.state-field');\r\n }\r\n }\r\n\r\n removePostalCodeInfo($stateField: JQuery<HTMLElement>): void {\r\n $stateField.remove();\r\n }\r\n\r\n getPostalCode(): string {\r\n return $(`${this.parentSelector} .register__postalCode`).val() as string;\r\n }\r\n\r\n initRentDropdowns(that) {\r\n this._RentalWeightDropDown.init(`.accountsettings__rentalWeight`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent: JQuery<HTMLElement>, value: string) => {\r\n $('#RentalWeight').val(value);\r\n }\r\n }\r\n );\r\n\r\n this._RentalHeightDropDown.init(`.accountsettings__rentalHeight`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent: JQuery<HTMLElement>, value: string) => {\r\n $('#RentalHeight').val(value);\r\n }\r\n }\r\n );\r\n\r\n this._RentalShowSizeDropDown.init(`.accountsettings__rentalShoeSize`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent: JQuery<HTMLElement>, value: string) => {\r\n $('#RentalShoeSize').val(value);\r\n }\r\n }\r\n );\r\n\r\n this._RentalSkiLevelDropDown.init(`.accountsettings__rentalSkiLevel`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: ($parent: JQuery<HTMLElement>, value: string) => {\r\n $('#RentalSkiLevel').val(value);\r\n }\r\n }\r\n );\r\n }\r\n}\r\n\r\ninterface IRegistrationData extends IAxBirthDateInitData {\r\n birthdayPattern: string;\r\n parentId: string;\r\n rental_parentId: string;\r\n outputTarget: string;\r\n setDay: string;\r\n setMonth: string;\r\n setYear: string;\r\n setBirthDate: string;\r\n formData: any;\r\n loginUrl: string;\r\n}\r\n\r\nclass CountryList {\r\n isoCode: string;\r\n subDivisionList: SubDivisionWithCodeList[];\r\n}\r\n\r\nclass SubDivisionWithCodeList {\r\n SubDivision: CustomerSubDivision;\r\n PostalCodes: string[];\r\n}\r\n\r\nclass CustomerSubDivision {\r\n SubDivisionCode: string;\r\n SubDivisionName: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { AxModal, AxDropdown, AxFormValidation, AxInput } from \"@axess/limestone\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { AccountStorageService } from \"../../Service/Account/AccountStorageService\";\r\nimport { AxButton } from \"../../Limestone/AxButton/AxButton\";\r\nimport { ConsentDocuments, ICheckboxInfo } from \"../ConsentDocuments/ConsentDocuments\"\r\n\r\n@ModuleName(\"RegisterForm\")\r\nexport class RegisterForm implements AxInit {\r\n\r\n protected _i18nHelper = new I18nHelper();\r\n localLinks: any;\r\n consentDocumentModule: ConsentDocuments;\r\n\r\n constructor(private _requestHelper = new RequestHelper(),\r\n protected _axButton = new AxButton(),\r\n private _storage = new AccountStorageService()) { }\r\n\r\n AxInit(init: any): void {\r\n new AxModal().init();\r\n new AxInput('#password').init();\r\n new AxInput('#mail').init();\r\n new AxInput('#login-email').init();\r\n\r\n this.consentDocumentModule = AxLoad.GetModule<ConsentDocuments>(\"ConsentDocuments\");\r\n\r\n $(\"#registration__rentalContainer\").hide();\r\n $(\"#registration__rentalContainer-submit\").hide();\r\n $(\"#registration__checkInboxWrapper\").hide();\r\n $(\"#forget-password__checkInboxWrapper\").hide();\r\n $(\"#registerResponseField\").hide();\r\n $(\"#normalForm\").show();\r\n\r\n $(\"#mail\").on(\"keyup\", function () {\r\n $(\"#registerResponseField\").hide();\r\n });\r\n\r\n $(\"#height\").on(\"keyup\", function () {\r\n $('#height').inputmask(\"999\", {\r\n placeholder: \" \",\r\n greedy: false\r\n });\r\n });\r\n\r\n //StandardForm\r\n new AxFormValidation({\r\n selector: '#register-form',\r\n rules: this.getValidationRules(),\r\n callback: (form: HTMLElement) => {\r\n if (this.hasRental()) {\r\n this.toggleRental(true);\r\n return;\r\n }\r\n\r\n this.saveConsentsRegister(form);\r\n }\r\n }).init();\r\n\r\n //LoginForm\r\n new AxFormValidation({\r\n selector: '#loginForm',\r\n rules: {},\r\n callback: () => {\r\n this.login();\r\n }\r\n }).init();\r\n\r\n\r\n //RentalForm\r\n new AxFormValidation({\r\n selector: '#register-form__rental',\r\n //Rental validation rules goes here:\r\n rules: this.getValidationRules(),\r\n callback: (form: HTMLElement) => {\r\n this.saveConsentsRegister(form);\r\n }\r\n }).init();\r\n\r\n $(`[data-registration=\"rental_back\"]`).on(\"click\", () => {\r\n $(\"#registration__rentalContainer\").hide();\r\n $(\"#registration__rentalContainer-submit\").hide();\r\n $(\"#registration__checkInboxWrapper\").hide();\r\n $(\"#forget-password__checkInboxWrapper\").hide();\r\n $(\"#registerResponseField\").hide();\r\n $(\"#RegForm\").show();\r\n $(\"#normalForm\").show();\r\n });\r\n\r\n $(\"#form-resetPass\").on(\"submit\", (event) => {\r\n event.preventDefault();\r\n this.resetPassword();\r\n });\r\n }\r\n\r\n checkStoredForward() {\r\n let storageData = this._storage.getStorage();\r\n if (storageData != null) {\r\n if (storageData.data != null) {\r\n this._requestHelper.postToUrl(storageData.target, storageData.data);\r\n } else {\r\n location.href = storageData.target;\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n\r\n login() {\r\n $('#loginResponseField').html('').addClass('d-none');\r\n this._axButton.Loading($('[data-account=\"wrapper\"] button[type=\"submit\"]')[0]);\r\n\r\n AxessViewer.loadPartialView('/Account/Login',\r\n {\r\n Email: $('#loginForm #login-email').val(),\r\n Password: $('#loginForm #password').val(),\r\n LoginTypeNr: $('#LoginTypeNr').val(),\r\n ReturnUrl: $('#ReturnUrl').val()\r\n\r\n },\r\n (resp: any) => {\r\n if (typeof resp['nErrorCode'] == 'undefined' && resp.success) {\r\n let storageForward = this.checkStoredForward();\r\n if (storageForward) return;\r\n\r\n if (typeof resp.WebhookLoginToken != 'undefined' && resp.WebhookLoginToken != null) {\r\n notifyAppLogin(resp.WebhookLoginToken);\r\n } else {\r\n if (typeof resp.returnUrl != 'undefined' && resp.returnUrl != null) {\r\n location.href = \"/\" + resp.languageCode + \"/\" + resp.returnUrl + \"/\";\r\n }\r\n else {\r\n location.href = \"/\" + resp.languageCode + \"/Products/Tickets/\";\r\n }\r\n\r\n }\r\n return;\r\n }\r\n\r\n if (typeof resp['response'] != 'undefined') {\r\n $('#loginResponseField').html(resp['response']).removeClass('d-none');\r\n } else if (typeof resp['message'] != 'undefined') {\r\n $('#loginResponseField').html(resp['message']).removeClass('d-none');\r\n } else if (typeof resp['szErrorMessage'] != 'undefined') {\r\n $('#loginResponseField').html(resp['szErrorMessage']).removeClass('d-none');\r\n }\r\n\r\n this._axButton.StopLoading($('[data-account=\"wrapper\"] button[type=\"submit\"]')[0]);\r\n }\r\n , {});\r\n\r\n }\r\n\r\n toggleRental(show: boolean) {\r\n if (show) {\r\n $(\"#registration__rentalContainer\").show();\r\n $(\"#registration__rentalContainer-submit\").show();\r\n $(\"#RegForm\").hide();\r\n return;\r\n }\r\n $(\"#registration__rentalContainer\").hide();\r\n $(\"#registration__rentalContainer-submit\").hide();\r\n $(\"#RegForm\").show();\r\n $(\"#normalForm\").show();\r\n }\r\n\r\n hasRental() {\r\n return $('#register-form__rental').length > 0;\r\n }\r\n\r\n saveConsentsRegister(form: HTMLElement) {\r\n if (this.consentDocumentModule.consentNeeded) {\r\n let consentDeliveryInfo = {\r\n shoppingCartId: 0,\r\n isGuestCheckOut: false,\r\n customerAccountNo: 0,\r\n consentCheckboxInfos: this.consentDocumentModule.checkBoxInfos\r\n }\r\n \r\n this.register(form, consentDeliveryInfo);\r\n } else {\r\n this.register(form, null);\r\n }\r\n }\r\n\r\n resetPassword() {\r\n const email = $('#forget-pass-email').val().toString();\r\n this._axButton.Loading($('[data-account=\"wrapper\"] button[type=\"submit\"]')[0]);\r\n\r\n AxessViewer.loadPartialView(`/Account/ResetPassword/`, { \"email\": email }, (result) => {\r\n $('[data-account=\"wrapper\"]').html(result.view);\r\n this._axButton.StopLoading($('[data-account=\"wrapper\"] button[type=\"submit\"]')[0]);\r\n }, { reload: false, silent: true });\r\n }\r\n\r\n getValidationRules(): JQueryValidation.RulesDictionary {\r\n return {\r\n radio: {\r\n required: true,\r\n },\r\n radioMd: {\r\n required: true,\r\n },\r\n lastname: {\r\n required: true,\r\n },\r\n dropdown: {\r\n required: true,\r\n },\r\n hiddenPhone: {\r\n required: true,\r\n regex: /([0-9]{10})|(\\([0-9]{3}\\)\\s+[0-9]{3}\\-[0-9]{4})/\r\n },\r\n phone: {\r\n required: true,\r\n regex: /([0-9]{10})|(\\([0-9]{3}\\)\\s+[0-9]{3}\\-[0-9]{4})/,\r\n normalizer: function (value) {\r\n let dropdownVal = $(this).parents(\".ax-phone-field\").find(\".hidden-input\").val() as string;\r\n }\r\n },\r\n password: {\r\n required: true,\r\n },\r\n passwordValidation: {\r\n required: true,\r\n pwcheck: true,\r\n minlength: 8,\r\n },\r\n email: {\r\n required: true,\r\n email: true,\r\n regex: /^\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b$/i,\r\n },\r\n registrationConfirmMail: {\r\n equalTo: \"#mail\"\r\n },\r\n checkboxTerms: {\r\n required: true,\r\n },\r\n emailconfirm: {\r\n required: true,\r\n equalTo: \"#guest-email\",\r\n },\r\n PasswordConfirm: {\r\n required: true,\r\n equalTo: \"#password\",\r\n }\r\n };\r\n }\r\n\r\n register(element: HTMLElement, consentDeliveryInfo) {\r\n let termsCheck = $(element).find('input[name=TermsAndConditions]');\r\n\r\n if (termsCheck.length) {\r\n $(termsCheck).parent().removeClass('invalid');\r\n\r\n if (termsCheck.prop('checked') == false) {\r\n $(termsCheck).parent().addClass('invalid');\r\n }\r\n }\r\n\r\n let addCheck = $(element).find('.registration_addB');\r\n\r\n if (addCheck.length > 0) {\r\n addCheck.each(function (index, elem) {\r\n if ($(elem).prop('checked') == false) {\r\n $(elem).parent().addClass('invalid');\r\n } else {\r\n $(elem).parent().removeClass('invalid');\r\n }\r\n });\r\n }\r\n\r\n if (consentDeliveryInfo != null) {\r\n let temp = consentDeliveryInfo.consentCheckboxInfos;\r\n\r\n jQuery.each(temp, function (i, val) {\r\n $('#register-form').append('<input hidden name=\"ConsentCheckboxInfos[' + i.toString() + '].DocumentId\" value=\"' + val.documentId + '\" /> ');\r\n $('#register-form').append('<input hidden name=\"ConsentCheckboxInfos[' + i.toString() + '].IsChecked\" value=\"' + val.isChecked + '\" /> ');\r\n });\r\n }\r\n\r\n let baseForm = this._requestHelper.objectifyForm($('#register-form').serializeArray());\r\n\r\n if (this.hasRental()) {\r\n let rentalForm = this._requestHelper.objectifyForm($('#register-form__rental').serializeArray());\r\n baseForm = { ...baseForm, ...rentalForm };\r\n }\r\n\r\n $('[data-account=\"wrapper\"] button[type=\"submit\"]').each((i, e) => {\r\n this._axButton.Loading(e);\r\n });\r\n\r\n const languages = $(element).find('button[type=submit]').data('languages') || [];\r\n let languageCode;\r\n if (languages.length > 0) {\r\n languageCode = languages.filter((l) => l.SprachID == $('#Language').val());\r\n languageCode = languageCode.length > 0 ? languageCode[0].IsoSprachCode : null;\r\n }\r\n\r\n AxessViewer.loadPartialView('/Account/Register', baseForm, (resp) => {\r\n if (typeof resp['success'] != 'undefined' && resp['success'] == true) {\r\n let storageForward = this.checkStoredForward();\r\n if (storageForward) return;\r\n\r\n if (typeof resp.WebhookLoginToken != 'undefined' && resp.WebhookLoginToken != null) {\r\n notifyAppLogin(resp.WebhookLoginToken);\r\n }\r\n $('#registerResponseField').html('');\r\n\r\n $(\"#normalForm\").hide();\r\n\r\n if (resp.activationRequired) {\r\n //@ts-ignore\r\n AxessViewer.loadPartialView('/Account/LoadCheckInbox', { email: baseForm.email },\r\n (resp) => {\r\n $('[data-account=\"wrapper\"]').html(resp.view);\r\n },\r\n {});\r\n }\r\n window.location.href = languageCode ? `/${languageCode}/Home` : \"/Home\";\r\n return;\r\n } else {\r\n $('[data-account=\"wrapper\"] button[type=\"submit\"]').each((i, e) => {\r\n this._axButton.StopLoading(e);\r\n });\r\n $(\"#registration__rentalContainer\").hide();\r\n $(\"#registration__rentalContainer-submit\").hide();\r\n $(\"#registration__checkInboxWrapper\").hide();\r\n $(\"#register-form\").show();\r\n $(\"#RegForm\").show();\r\n $(\"#normalForm\").show();\r\n $('#registerResponseField').show();\r\n if (typeof resp['response'] != 'undefined') {\r\n $('#registerResponseField').html(resp['response']);\r\n } else if (typeof resp['message'] != 'undefined') {\r\n $('#registerResponseField').html(resp['message']);\r\n } else if (typeof resp['szErrorMessage'] != 'undefined') {\r\n $('#registerResponseField').html(resp['szErrorMessage']);\r\n }\r\n $('#registerResponseField').addClass('ax-mb-2 ax-alert ax-alert--inline ax-alert--info');\r\n window.scrollTo(0, 0);\r\n }\r\n }, { silent: true });\r\n\r\n }\r\n}", "import { AxDropdown } from \"@axess/limestone\";\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AccountRentalData, AccountRentalDataInitData } from \"../Account/AccountRentalData\";\r\nimport { CustomerLessonProperties, CustomerLessonPropertiesInit } from \"../Account/CustomerLessonProperties\";\r\n\r\nclass InitCustomerProps implements CustomerLessonPropertiesInit {\r\n parentId: string;\r\n formElementPrefix: string;\r\n\r\n constructor(parentId: string, formElementPrefix: string) {\r\n this.parentId = parentId;\r\n this.formElementPrefix = formElementPrefix;\r\n }\r\n}\r\n\r\n@ModuleName(\"PersonalData\")\r\nexport class PersonalData implements AxInit {\r\n\r\n private parentSelector: string;\r\n\r\n private _CountryDropDown: AxDropdown = new AxDropdown();\r\n private _CommunicationLanguage: AxDropdown = new AxDropdown();\r\n private _GenderDropDown: AxDropdown = new AxDropdown();\r\n private _USStateDropDown: AxDropdown = new AxDropdown();\r\n private subDivisionSearchTimeout: NodeJS.Timeout;\r\n private _I18nHelper = new I18nHelper;\r\n private countryList: CountryList[] = [];\r\n private currentCountry: string | null;\r\n private currentGender: string | null;\r\n private currentUSState: string | null;\r\n private init: IRegistrationData;\r\n\r\n private _accountRentalData: AccountRentalData = new AccountRentalData();\r\n private _customerLessonProps: CustomerLessonProperties = new CustomerLessonProperties();\r\n\r\n AxInit(init: IRegistrationData): void {\r\n this.parentSelector = init.parentIdAddress;\r\n this.currentCountry = init.currentCountry;\r\n this.currentGender = init.currentGender;\r\n this.currentUSState = init.currentUSState;\r\n this.init = init;\r\n\r\n this._accountRentalData.AxInit(new AccountRentalDataInitData(init.parentIdRent));\r\n this._customerLessonProps.AxInit(new InitCustomerProps(init.lessonPropsParentId, \"\"));\r\n\r\n this._GenderDropDown.init(`${init.parentIdGender} .accountsettings__gender`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: (x, y) => {\r\n $('#Gender').val(y);\r\n }\r\n }\r\n );\r\n\r\n this._CountryDropDown.init(`${init.parentIdAddress} .accountsettings__countryCode`,\r\n {\r\n searchBar: true,\r\n multiSelect: false,\r\n onSelect: (x, y) => {\r\n this.subDivisionSearchTimeout = setTimeout(() => {\r\n this.searchSubDivision();\r\n }, 200);\r\n $('#CountryCode').val(y);\r\n }\r\n }\r\n );\r\n\r\n this._CommunicationLanguage.init('.register__language', {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: (x, y) => {\r\n $('#Language').val(y);\r\n },\r\n });\r\n\r\n this._USStateDropDown.init(`${init.parentIdAddress} .accountsettings__USState`,\r\n {\r\n searchBar: true,\r\n multiSelect: false,\r\n onSelect: (x, y) => {},\r\n }\r\n );\r\n\r\n const observerConfig = {\r\n attributes: true,\r\n childList: true,\r\n subtree: true,\r\n };\r\n\r\n const countryObserver = new MutationObserver((mutationsList) => {\r\n for (const mutation of mutationsList) {\r\n if (mutation.type === \"childList\" || mutation.type === \"attributes\") {\r\n let $selected = $(\".ax-dropdown__item__countries\").filter(\".selected\");\r\n let isoCode = $selected.attr(\"data-iso\");\r\n if (isoCode === $(\"#CountryCode\").val() || isoCode === undefined) return;\r\n $(\"#CountryCode\").val(isoCode);\r\n\r\n this.searchSubDivision();\r\n }\r\n }\r\n });\r\n\r\n AxLoad.LoadModule('AxBirthDateInputTriple',\r\n {\r\n birthdayPattern: init.birthdayPattern,\r\n parentId: `#account-form`,\r\n outputTarget: `input[name=DateOfBirthCi]`,\r\n setBirthDate: $('input[name=DateOfBirthCi]').val() as string\r\n });\r\n\r\n if ($('#selectedCountry').length > 0) {\r\n countryObserver.observe(document.getElementById('selectedCountry'), observerConfig);\r\n }\r\n\r\n $(`.accountsettings__postalCode`).on(\"keyup\", () => {\r\n if (typeof this.subDivisionSearchTimeout != 'undefined') {\r\n clearTimeout(this.subDivisionSearchTimeout);\r\n }\r\n\r\n this.subDivisionSearchTimeout = setTimeout(() => {\r\n this.searchSubDivision();\r\n }, 200);\r\n });\r\n\r\n $('#account-form-submit').on('click', (e) => {\r\n const languages = $(e.target).data('languages') || [];\r\n let languageCode;\r\n if (languages.length > 0) {\r\n languageCode = languages.filter((l) => l.SprachID == $('#Language').val());\r\n languageCode = languageCode.length > 0 ? languageCode[0].IsoSprachCode : null;\r\n }\r\n return AxessViewer.saveForm(\r\n '/ProfileSettings/Update',\r\n 'account-form',\r\n false,\r\n () => { },\r\n languageCode ? { redirect: `/${languageCode}/ProfileSettings` } : {},\r\n {},\r\n );\r\n });\r\n\r\n this.searchSubDivision();\r\n this.getCorrectCountryName();\r\n }\r\n\r\n getCorrectCountryName() {\r\n let $searchables = $(\"li.ax-dropdown__item__countries\");\r\n let country = $(\"#CountryCode\").val();\r\n let countryName = '';\r\n $searchables.each(function () {\r\n const liContent = $(this).attr('data-iso');\r\n if (liContent === country) {\r\n countryName = $(this).text().trim();\r\n }\r\n })\r\n if (countryName === '') return;\r\n $(\"#selectedCountry\").text(countryName);\r\n this.checkInputmask();\r\n $(\"#height\").on(\"keyup\", () => {\r\n this.checkInputmask();\r\n });\r\n }\r\n checkInputmask() {\r\n $('#height').inputmask(\"999\", {\r\n placeholder: \" \",\r\n greedy: false\r\n });\r\n }\r\n\r\n\r\n searchSubDivision() {\r\n let isoCode = $(\"#CountryCode\").val();\r\n\r\n if (isoCode === '') return;\r\n\r\n let countryEntry: CountryList = this.countryList.find(x => x.isoCode === isoCode);\r\n\r\n if (typeof countryEntry != 'undefined') {\r\n this.printSubDivision(countryEntry.subDivisionList);\r\n return;\r\n }\r\n\r\n AxessViewer.loadPartialView('/AccUtil/GetSubDivisionList',\r\n { iso2Code: isoCode },\r\n (res: SubDivisionWithCodeList[]) => {\r\n this.countryList.push({\r\n isoCode: isoCode as string,\r\n subDivisionList: res\r\n });\r\n this.printSubDivision(res);\r\n }, {});\r\n }\r\n\r\n printSubDivision(subDivisionList: SubDivisionWithCodeList[]) {\r\n\r\n let postalCode = this.getPostalCode();\r\n let $dropDownParent: JQuery<HTMLElement> = $(this._CountryDropDown.getElements()[0]);\r\n let $stateField = $dropDownParent.next('.state-field');\r\n\r\n if (postalCode.length === 0) {\r\n this.removePostalCodeInfo($stateField);\r\n return;\r\n };\r\n\r\n let selectedDivision: SubDivisionWithCodeList = subDivisionList.find((x: SubDivisionWithCodeList) => x.PostalCodes.includes(postalCode));\r\n\r\n if (typeof selectedDivision == 'undefined') {\r\n this.removePostalCodeInfo($stateField);\r\n return;\r\n }\r\n\r\n if ($stateField.length > 0) {\r\n this.removePostalCodeInfo($stateField);\r\n $stateField = $dropDownParent.next('.state-field');\r\n }\r\n\r\n if ($stateField.length === 0) {\r\n let newInfoDiv = document.createElement('div');\r\n newInfoDiv.classList.add('ax-form-group');\r\n newInfoDiv.classList.add('ax-mt-1');\r\n newInfoDiv.classList.add('state-field');\r\n\r\n let newInfoInput = document.createElement('input');\r\n newInfoInput.setAttribute('type', 'text');\r\n newInfoInput.setAttribute('disabled', 'disabled');\r\n newInfoInput.setAttribute('value', selectedDivision.SubDivision.SubDivisionName);\r\n newInfoInput.classList.add('ax-form-control');\r\n\r\n\r\n let newInfoLabel = document.createElement('label');\r\n newInfoLabel.classList.add('ax-form-label');\r\n newInfoLabel.innerText = `${this._I18nHelper.GetTranslation(Translations.State)}`;\r\n\r\n let newInfoDivGroupAssistance = document.createElement('div');\r\n newInfoDivGroupAssistance.classList.add('ax-form-group-assistence');\r\n\r\n newInfoDiv.appendChild(newInfoInput);\r\n newInfoDiv.appendChild(newInfoLabel);\r\n newInfoDiv.appendChild(newInfoDivGroupAssistance);\r\n\r\n $dropDownParent.after(newInfoDiv);\r\n $stateField = $dropDownParent.next('.state-field');\r\n }\r\n }\r\n\r\n removePostalCodeInfo($stateField: JQuery<HTMLElement>): void {\r\n $stateField.remove();\r\n }\r\n\r\n getPostalCode(): string {\r\n return $(`${this.parentSelector} .accountsettings__postalCode`).val() as string;\r\n }\r\n}\r\n\r\n\r\n\r\ninterface IRegistrationData {\r\n parentIdAddress: string;\r\n parentIdGender: string;\r\n parentIdRent: string;\r\n communicationLanguage: string;\r\n lessonPropsParentId: string;\r\n currentCountry: string | null;\r\n currentGender: string | null;\r\n currentUSState: string | null;\r\n birthdayPattern: string;\r\n}\r\n\r\nclass CountryList {\r\n isoCode: string;\r\n subDivisionList: SubDivisionWithCodeList[];\r\n}\r\n\r\nclass SubDivisionWithCodeList {\r\n SubDivision: CustomerSubDivision;\r\n PostalCodes: string[];\r\n}\r\n\r\nclass CustomerSubDivision {\r\n SubDivisionCode: string;\r\n SubDivisionName: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { Translations, I18nHelper } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport Swal from 'sweetalert2/dist/sweetalert2.js'\r\n\r\n@ModuleName(\"Resubscribe\")\r\nexport class Resubscribe implements AxInit {\r\n\r\n private token: string;\r\n private _I18nHelper = new I18nHelper();\r\n private loading: AxLoading;\r\n\r\n AxInit(): void {\r\n this.loading = new AxLoading();\r\n\r\n $('#newsLetterLoginForm').on('submit', (e) => {\r\n AxessViewer.onSubmit(e, $('#newsLetterLoginForm'), '/NewsletterSubscription/Resubscribe', (resp) => {\r\n if (resp.ErrorNo == 0) {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.LoginSuccess),\r\n text: resp['message'],\r\n icon: 'success',\r\n confirmButtonText: 'Ok'\r\n }).then((result) => {\r\n $('#loginModal').modal('hide');\r\n this.loadSuccessPartial();\r\n });\r\n } else {\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.LoginCredentialsWrong),\r\n text: resp['message'],\r\n icon: 'error',\r\n confirmButtonText: 'OK'\r\n });\r\n }\r\n }, { silent: true }, \"\");\r\n });\r\n }\r\n\r\n loadSuccessPartial() {\r\n\r\n this.loading.ShowLoadingIndicator($('#subscriptionContentHolder')[0]);\r\n\r\n AxessViewer.loadPartialView('/NewsletterSubscription/GetResubscribeSuccessPartial', {}, partial => {\r\n $('#subscriptionContentHolder').html(partial);\r\n this.loading.HideLoadingIndicator($('#subscriptionContentHolder')[0]);\r\n }, { dataType: 'html' });\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AccountRentalData, AccountRentalDataInitData } from \"./AccountRentalData\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport Swal from 'sweetalert2/dist/sweetalert2.js'\r\n\r\ninterface IMissingMandatoryDataInit {\r\n rentalParentId: string;\r\n}\r\n\r\n@ModuleName(\"MissingMandatoryData\")\r\nexport class MissingMandatoryData implements AxInit {\r\n\r\n private _I18nHelper = new I18nHelper();\r\n\r\n private _accountRentalData: AccountRentalData = new AccountRentalData();\r\n private _rentalParentId: string;\r\n\r\n\r\n AxInit(init: IMissingMandatoryDataInit): void {\r\n this._rentalParentId = init.rentalParentId;\r\n this.registerSubmitButton();\r\n this.initRentalDataPartial();\r\n }\r\n\r\n // initRentalDataPartial\r\n initRentalDataPartial() {\r\n this._accountRentalData.AxInit(new AccountRentalDataInitData(this._rentalParentId));\r\n }\r\n\r\n // registerSubmitForm\r\n registerSubmitButton() {\r\n $('#btn_register').click((e) => {\r\n this.updateAccount(e, $('#update-form'));\r\n });\r\n }\r\n\r\n // updateAccount\r\n updateAccount(event, element) {\r\n (event.preventDefault ? event.preventDefault() : (event.returnValue = false));\r\n $('#registerResponseField').html('<div class=\"fa-3x\"><i class=\"fas fa-spinner fa-spin\"></i></div>');\r\n\r\n AxessViewer.onSubmit(event, element, '/Account/MandatoryData', (resp) => {\r\n if (typeof resp['success'] != 'undefined' && resp['success'] === true) {\r\n $('#registerResponseField').html('');\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Success),\r\n icon: 'success',\r\n text: resp['message'],\r\n confirmButtonText: 'Ok'\r\n }).then((result) => {\r\n $('.m-content > .alert-danger').remove();\r\n window.location.href = location.origin;\r\n });\r\n return;\r\n } else {\r\n if (typeof resp['response'] != 'undefined') {\r\n $('#registerResponseField').html(resp['response']);\r\n } else if (typeof resp['message'] != 'undefined') {\r\n $('#registerResponseField').html(resp['message']);\r\n } else if (typeof resp['szErrorMessage'] != 'undefined') {\r\n $('#registerResponseField').html(resp['szErrorMessage']);\r\n }\r\n }\r\n }, { silent: true }, null);\r\n }\r\n}\r\n", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"MaintenanceScriptInfo\")\r\nexport class MaintenanceScriptInfo implements AxInit\r\n{\r\n AxInit(init): void {\r\n this.CheckScript();\r\n }\r\n\r\n CheckScript() {\r\n AxessViewer.loadPartialView('/Home/CheckMaintenanceMode',\r\n {},\r\n (x: IMaintenanceScriptInfo) => {\r\n if (!x.running) {\r\n location.reload();\r\n return;\r\n }\r\n const progess = x.toRun - x.open;\r\n const percentDone = Math.round(100 / x.toRun * progess);\r\n\r\n $('.maintenanceScript__progress').html(progess.toString());\r\n $('.maintenanceScript__progressBar .ax-progressbar__progress').css('width', `${percentDone}%`);\r\n\r\n setTimeout(() => {\r\n this.CheckScript();\r\n },\r\n 3000);\r\n },\r\n {});\r\n }\r\n}\r\n\r\ninterface IMaintenanceScriptInfo {\r\n running: boolean;\r\n open: number;\r\n toRun: number;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { ComponentFunction } from \"@glidejs/glide\";\r\nimport Glide from \"@glidejs/glide\";\r\nimport { AxDropdown, IAxDropdownOptions, AxInput } from \"@axess/limestone\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { AxDatePicker, Cell, Mode } from \"../../Components/AxDatepicker/AxDatepicker\";\r\n\r\n@ModuleName(\"RentalMain\")\r\nexport class RentalMain implements AxInit {\r\n private Glides: Map<string, Glide.Static> = new Map<string, Glide.Static>();\r\n public _durationDropDown: AxDropdown = new AxDropdown();\r\n public _locationDropDown: AxDropdown = new AxDropdown();\r\n public _dateDropDown: AxDropdown = new AxDropdown();\r\n public _catDropDown: AxDropdown = new AxDropdown();\r\n private options: IRentalInitData;\r\n private filterUrl: string;\r\n\r\n public datePicker: AxDatePicker;\r\n\r\n constructor(private _requestHelper = new RequestHelper()) { }\r\n\r\n AxInit(init: IRentalInitData): void {\r\n\r\n const mobileInterface = new RentalMainMobilePortlet();\r\n mobileInterface.init(this, init);\r\n\r\n new AxInput('.ax-form-control').init();\r\n this.filterUrl = init.filterUrl;\r\n this.options = init;\r\n\r\n this.datePicker = new AxDatePicker();\r\n\r\n let endDate = init.endDate != null ? moment(init.endDate, \"YYYY-MM-DD\") : null;\r\n\r\n this.datePicker.Init({\r\n StartOfWeek: init.startOfWeek,\r\n Lang: init.lang,\r\n StartDate: moment(init.startDate, \"YYYY-MM-DD\"),\r\n DayRange: 0,\r\n Target: '#rental__startDate-picker',\r\n Mode: Mode.Inline,\r\n EndDate: endDate,\r\n monthsShown: 1\r\n });\r\n\r\n this.datePicker.ActivationSubject.subscribe(x => { this.setDate(x); });\r\n\r\n this._dateDropDown.init(`.rental_landing__date`,\r\n {\r\n searchBar: false,\r\n multiSelect: false\r\n });\r\n this._durationDropDown.init(`.rental_landing__duration`,\r\n {\r\n searchBar: true,\r\n multiSelect: false\r\n });\r\n this._locationDropDown.init(`.rental_landing__location`,\r\n {\r\n searchBar: true,\r\n multiSelect: false\r\n });\r\n this._catDropDown.init(`.rental_landing__cat`,\r\n {\r\n searchBar: true,\r\n multiSelect: false\r\n });\r\n\r\n $('.rental_landing-search').click(x => {\r\n this.search();\r\n });\r\n this.initGlider();\r\n }\r\n\r\n setDate(cell: Cell) {\r\n if (cell != null) {\r\n this._dateDropDown.setValue(cell.Date.format(this.options.datePattern));\r\n this._dateDropDown.close();\r\n }\r\n }\r\n\r\n search() {\r\n const arc = this._locationDropDown.getValue() as string;\r\n const duration = this._durationDropDown.getValue() as string;\r\n const cat = this._catDropDown.getValue() as string;\r\n const date: Cell = this.datePicker.ActivationSubject.getValue();\r\n\r\n let url = this.filterUrl;\r\n\r\n if (cat != null) {\r\n url += `/${cat}`;\r\n }\r\n\r\n if (duration != null) {\r\n url = this._requestHelper.insertParam(url, \"dId\", duration);\r\n }\r\n if (arc != null) {\r\n url = this._requestHelper.insertParam(url, \"aId\", arc);\r\n }\r\n if (date != null && date.Date != null) {\r\n url = this._requestHelper.insertParam(url, \"date\", date.Date.format('YYYY-MM-DD'));\r\n }\r\n\r\n window.location.href = url;\r\n }\r\n\r\n private initGlider() {\r\n $('.ax-products__groupList[data-display-mode=\"swiper\"]').each((i, x) => {\r\n const glideID: string = $(x).attr('id');\r\n const rows: number = $(x).data('rows');\r\n const smallGap = $(x).hasClass('glid--sm');\r\n const glide = new Glide('#' + glideID, {\r\n type: 'slider',\r\n perView: rows,\r\n rewind: false,\r\n bound: true,\r\n animationDuration: 300,\r\n breakpoints: {\r\n 800: {\r\n perView: 2\r\n },\r\n 480: {\r\n perView: 1\r\n }\r\n },\r\n classes: {\r\n activeSlide: 'glide__slide--active',\r\n disabledArrow: 'glide__arrow--disabled'\r\n },\r\n gap: smallGap ? -18 : 0\r\n });\r\n\r\n this.Glides.set(glideID, glide);\r\n\r\n glide.on('run.before', e => {\r\n e.steps = e.direction === '>' ? -glide.settings.perView : glide.settings.perView\r\n })\r\n glide.mount({\r\n 'DisableControls': this.updateGlideFunc\r\n });\r\n });\r\n }\r\n\r\n private updateGlideFunc: ComponentFunction = (glide: Glide.Static, Components: any, Events: any) => {\r\n\r\n const PREV_CONTROL_SELECTOR = \"[data-glide-dir='<']\";\r\n const NEXT_CONTROL_SELECTOR = \"[data-glide-dir='>']\";\r\n const component = {\r\n buildAfter() {\r\n this.prevBtn = Components.Html.root.querySelector(PREV_CONTROL_SELECTOR);\r\n this.nextBtn = Components.Html.root.querySelector(NEXT_CONTROL_SELECTOR);\r\n },\r\n handleDisable() {\r\n const perView = glide.settings.perView;\r\n const slidesCount = Components.Html.slides.length;\r\n\r\n this.prevBtn.disabled = (glide.index <= 0);\r\n this.nextBtn.disabled = (glide.index >= slidesCount - perView);\r\n },\r\n mount() {\r\n }\r\n };\r\n\r\n Events.on(\"build.after\", function () {\r\n component.buildAfter();\r\n component.handleDisable();\r\n });\r\n Events.on(\"run.after\", function () {\r\n component.handleDisable();\r\n });\r\n return component;\r\n }\r\n}\r\n\r\n\r\nclass RentalMainMobilePortlet {\r\n private currentSelectionPosition: SearchStates = SearchStates.Location;\r\n private mainModule: RentalMain;\r\n\r\n private datePickerMobile: AxDatePicker;\r\n\r\n init(rentalMainModule: RentalMain, init: IRentalInitData) {\r\n this.mainModule = rentalMainModule;\r\n\r\n let endDate = init.endDate != null ? moment(init.endDate, \"YYYY-MM-DD\") : null;\r\n\r\n this.datePickerMobile = new AxDatePicker();\r\n this.datePickerMobile.Init({\r\n StartOfWeek: init.startOfWeek,\r\n Lang: init.lang,\r\n StartDate: moment(init.startDate, \"YYYY-MM-DD\"),\r\n DayRange: 0,\r\n Target: '#rental__Landing_search-date_picker',\r\n Mode: Mode.Endless,\r\n LegendTarget: '#rental__Landing_search-date__legend',\r\n EndDate: endDate,\r\n monthsShown: 1,\r\n scrollTargetQuerySelector: '.rental__Landing_search-date'\r\n });\r\n\r\n this.initEvents();\r\n }\r\n\r\n initEvents() {\r\n this.datePickerMobile.ActivationSubject.subscribe((x: Cell) => {\r\n if (x != null) {\r\n this.mainModule.datePicker.setDate(x.Date);\r\n this.currentSelectionPosition = SearchStates.Duration;\r\n this.toggleSelection();\r\n }\r\n });\r\n\r\n $('.rental__Landing_search-overlay .prod_selection__prod-close').click(x => {\r\n this.goBackOrClose();\r\n });\r\n\r\n $('.rental_landing__search-toggle-xs').on('click',\r\n () => {\r\n this.currentSelectionPosition = SearchStates.Location;\r\n this.resetSelections();\r\n this.toggleSelection();\r\n\r\n $('.rental__Landing_search-overlay').toggleClass('active');\r\n });\r\n\r\n $('#rental__Landing_search-ipt').on('keyup change', x => {\r\n const searchVal = $(x.delegateTarget).val() as string;\r\n\r\n if (this.isEmptyOrSpaces(searchVal)) {\r\n $('.rental__Landing_pLocationList .rental__Landing_pLocationEntry').addClass('ax-center-y').removeClass('d-none');\r\n }\r\n\r\n $('.rental__Landing_pLocationList .rental__Landing_pLocationEntry').each((i, e: HTMLElement) => {\r\n if (!e.innerText.includes(searchVal)) {\r\n $(e).removeClass('ax-center-y').addClass('d-none');\r\n }\r\n });\r\n });\r\n\r\n $('.rental__Landing_search-skip').on('click',\r\n (e) => {\r\n if (this.currentSelectionPosition == SearchStates.Category) {\r\n this.mainModule.search();\r\n }\r\n\r\n this.currentSelectionPosition++;\r\n this.toggleSelection();\r\n });\r\n\r\n $('.rental__Landing_pLocationEntry').on('click',\r\n (e) => {\r\n this.selectLocation(e);\r\n });\r\n\r\n $('.rental__Landing_pDurationEntry').on('click',\r\n (e) => {\r\n this.selectDuration(e);\r\n });\r\n\r\n $('.rental__Landing_pCategoryEntry').on('click',\r\n (e) => {\r\n this.selectCategory(e);\r\n });\r\n }\r\n\r\n goBackOrClose() {\r\n const originalPosition = this.currentSelectionPosition;\r\n this.currentSelectionPosition--;\r\n\r\n if (originalPosition !== SearchStates.Location) {\r\n switch (this.currentSelectionPosition) {\r\n case SearchStates.Duration:\r\n this.mainModule._durationDropDown.resetSelection();\r\n break;\r\n case SearchStates.Date:\r\n this.mainModule.datePicker.resetDateSelection();\r\n this.datePickerMobile.resetDateSelection();\r\n this.mainModule._dateDropDown.resetSelection();\r\n break;\r\n case SearchStates.Location:\r\n this.mainModule._locationDropDown.resetSelection();\r\n break;\r\n\r\n }\r\n } else {\r\n $('.rental__Landing_search-overlay').toggleClass('active');\r\n this.resetSelections();\r\n }\r\n this.toggleSelection();\r\n }\r\n\r\n resetSelections() {\r\n this.mainModule._durationDropDown.resetSelection();\r\n this.mainModule._catDropDown.resetSelection();\r\n this.mainModule._locationDropDown.resetSelection();\r\n this.mainModule._dateDropDown.resetSelection();\r\n this.datePickerMobile.resetDateSelection();\r\n this.mainModule.datePicker.resetDateSelection();\r\n }\r\n\r\n printSummary() {\r\n const currentLocationValue = this.mainModule._locationDropDown.getValue();\r\n const currentDateValue = this.mainModule._dateDropDown.getValue();\r\n const currentDurationValue = this.mainModule._durationDropDown.getValue();\r\n\r\n const wrapper = document.createElement('div');\r\n wrapper.classList.add('ax-pt-2', 'ax-my-1-n');\r\n\r\n if (currentLocationValue != null) {\r\n const innerWrapper = document.createElement('div');\r\n innerWrapper.classList.add('d-flex', 'ax-py-1');\r\n const locationElem = $(`.rental__Landing_pLocationEntry[data-value=\"${currentLocationValue}\"]`).html();\r\n innerWrapper.innerHTML = locationElem;\r\n wrapper.appendChild(innerWrapper);\r\n }\r\n\r\n if (this.mainModule.datePicker.ActivationSubject.value != null) {\r\n const innerWrapper = document.createElement('div');\r\n innerWrapper.classList.add('d-flex', 'ax-py-1');\r\n\r\n const iconWrapper = document.createElement('div');\r\n const iconElem = document.createElement('i');\r\n iconElem.classList.add('las', 'la-calendar', 'ax-mr-2');\r\n iconWrapper.appendChild(iconElem);\r\n innerWrapper.appendChild(iconWrapper);\r\n\r\n const textWrapper = document.createElement('div');\r\n textWrapper.classList.add('text-h5');\r\n const currentCell: Cell = this.mainModule.datePicker.ActivationSubject.value;\r\n textWrapper.innerHTML = currentCell.Date.format('ll');\r\n innerWrapper.appendChild(textWrapper);\r\n wrapper.appendChild(innerWrapper);\r\n }\r\n\r\n\r\n if (currentDurationValue != null) {\r\n const innerWrapper = document.createElement('div');\r\n innerWrapper.classList.add('d-flex', 'ax-py-1');\r\n const locationElem = $(`.rental__Landing_pDurationEntry[data-value=\"${currentDurationValue}\"]`).html();\r\n innerWrapper.innerHTML = locationElem;\r\n wrapper.appendChild(innerWrapper);\r\n }\r\n\r\n $('.rental__Landing_search-summary').html(wrapper);\r\n }\r\n\r\n selectDuration(e: JQuery.ClickEvent) {\r\n const value = $(e.delegateTarget).attr('data-value');\r\n this.mainModule._durationDropDown.setValue(value);\r\n this.currentSelectionPosition = SearchStates.Category;\r\n this.toggleSelection();\r\n }\r\n\r\n selectLocation(e: JQuery.ClickEvent) {\r\n const value = $(e.delegateTarget).attr('data-value');\r\n this.mainModule._locationDropDown.setValue(value);\r\n this.currentSelectionPosition = SearchStates.Date;\r\n this.toggleSelection();\r\n }\r\n\r\n selectCategory(e: JQuery.ClickEvent) {\r\n const value = $(e.delegateTarget).attr('data-value');\r\n this.mainModule._catDropDown.setValue(value);\r\n this.currentSelectionPosition = SearchStates.Send;\r\n this.mainModule.search();\r\n }\r\n\r\n toggleSelection() {\r\n if (this.currentSelectionPosition != SearchStates.Send) {\r\n this.printSummary();\r\n }\r\n $('.rental__Landing_search-location').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Location);\r\n $('.rental__Landing_search-date').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Date);\r\n $('.rental__Landing_search-duration').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Duration);\r\n $('.rental__Landing_search-category').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Category);\r\n\r\n $('.prod_selection__prod-close--cancel')\r\n .toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Location);\r\n $('.prod_selection__prod-close--back')\r\n .toggleClass('d-none', this.currentSelectionPosition === SearchStates.Location);\r\n }\r\n\r\n isEmptyOrSpaces(str) {\r\n return str === null || str.match(/^ *$/) !== null;\r\n }\r\n}\r\n\r\nenum SearchStates {\r\n Location = 1,\r\n Date = 2,\r\n Duration = 3,\r\n Category = 4,\r\n Send = 5\r\n}\r\n\r\ninterface IRentalInitData {\r\n filterUrl: string;\r\n startOfWeek: number;\r\n startDate: string;\r\n endDate?: string;\r\n datePattern: string;\r\n lang: string;\r\n}", "import { RentalFilter } from \"../RentalFilter\";\r\n\r\nexport class RentalFilterResetHelper {\r\n private rentalFilterModule: RentalFilter;\r\n\r\n\r\n public init(rentalFilterModule: RentalFilter) {\r\n this.rentalFilterModule = rentalFilterModule;\r\n\r\n $('.rental__filter_reset-cat').on('click',\r\n () => {\r\n this.resetCatFilter(false);\r\n this.rentalFilterModule.updateFilterItems();\r\n });\r\n\r\n\r\n $('.rental__filter_reset-drpdwn').on('click',\r\n () => {\r\n this.resetDropdownFilters();\r\n this.rentalFilterModule.updateFilterItems();\r\n });\r\n\r\n $('.rental__filter_settings-reset').on('click',\r\n () => {\r\n this.resetAllFilters();\r\n });\r\n }\r\n\r\n resetAllFilters() {\r\n this.resetCatFilter(false);\r\n this.resetDropdownFilters();\r\n this.rentalFilterModule.updateFilterItems();\r\n }\r\n\r\n resetCatFilter(triggerChangeEvent: boolean) {\r\n this.rentalFilterModule.filterUpdateAllowed = false;\r\n\r\n const $elem = $('input[name=rental_landing__cat][value=null]');\r\n $elem.prop('checked', true);\r\n\r\n if (triggerChangeEvent) {\r\n $elem.trigger('change');\r\n }\r\n\r\n this.rentalFilterModule.filterUpdateAllowed = true;\r\n }\r\n\r\n resetDropdownFilters() {\r\n this.rentalFilterModule.filterUpdateAllowed = false;\r\n\r\n this.rentalFilterModule._durationDropDown.resetSelection();\r\n this.rentalFilterModule._locationDropDown.resetSelection();\r\n this.rentalFilterModule._dateDropDown.resetSelection();\r\n this.rentalFilterModule.datePicker.resetDateSelection();\r\n\r\n this.rentalFilterModule.filterUpdateAllowed = true;\r\n }\r\n} ", "import { IonRangeSliderEvent, IonRangeSliderOptions } from \"ion-rangeslider\";\r\nimport { RentalFilter } from \"../RentalFilter\";\r\nimport { RentalSelectionItem } from \"../../../Models/Rental/RentalSelectionItem\";\r\nimport { AxLoading } from \"../../../Limestone/AxLoading/AxLoading\";\r\n\r\nexport class RentalFilterPriceSlider {\r\n private priceRangeMin: number;\r\n private priceRangeMax: number;\r\n\r\n private lastPriceFilterTariff: number = 0;\r\n\r\n private rangeSlider: any;\r\n\r\n\r\n private _rentalFilterModule: RentalFilter;\r\n private _axLoading: AxLoading;\r\n\r\n constructor(rentalFilterModule: RentalFilter) {\r\n this._rentalFilterModule = rentalFilterModule;\r\n this._axLoading = new AxLoading();\r\n }\r\n\r\n\r\n setPriceFilter() {\r\n if (this._rentalFilterModule.rentalItemList == null) return;\r\n\r\n const filterListEmpty = this._rentalFilterModule.rentalItemList?.length > 0;\r\n let min = filterListEmpty ? this._rentalFilterModule.rentalItemList.reduce((prev, curr) => prev.price < curr.price ? prev : curr).price / 100 : 0;\r\n let max = filterListEmpty ? this._rentalFilterModule.rentalItemList.reduce((prev, curr) => prev.price > curr.price ? prev : curr).price / 100 : 0;\r\n\r\n if (min !== max) {\r\n if (this.rangeSlider != null) {\r\n this.rangeSlider.update({\r\n min: min,\r\n max: max,\r\n from: min,\r\n to: max\r\n });\r\n $('.retail__filter__price_holder').removeClass('d-none');\r\n return;\r\n }\r\n\r\n $(\"#retail__filter__price_slider\").ionRangeSlider({\r\n skin: 'round',\r\n type: 'double',\r\n hide_min_max: true,\r\n extra_classes: 'ax-range-slider has-labels',\r\n prefix: `${this._rentalFilterModule.options.currencyString} `,\r\n max: max,\r\n min: min,\r\n drag_interval: true,\r\n onFinish: x => this.priceSliderChange(x),\r\n onUpdate: x => this.priceSliderChange(x),\r\n //onChange: x => this.backgroundUpdatePriceFilter(x)\r\n });\r\n this.rangeSlider = $(\"#retail__filter__price_slider\").data(\"ionRangeSlider\");\r\n\r\n $('.retail__filter__price_reset').click(x => {\r\n this.rangeSlider.update({\r\n from: this.rangeSlider.options.min,\r\n to: this.rangeSlider.options.max\r\n });\r\n });\r\n $('.retail__filter__price_holder').removeClass('d-none');\r\n } else {\r\n $('.retail__filter__price_holder').addClass('d-none');\r\n }\r\n }\r\n\r\n updateFilteredProducts(): void {\r\n //300ms loading\r\n this._axLoading.ShowLoadingIndicator($('.retail__filter_bar')[0], true);\r\n $('.retail__filter_bar--container').addClass('loading');\r\n this._rentalFilterModule.getFilterParameterAndUpdateCount();\r\n\r\n setTimeout(() => {\r\n let priceFilteredItems =\r\n this._rentalFilterModule.rentalItemList.filter(y => y.price > this.priceRangeMax || y.price < this.priceRangeMin);\r\n\r\n $('.rental__filter_item').removeClass('d-none');\r\n\r\n for (let item of priceFilteredItems) {\r\n $(`.rental__filter_item[data-itemid=${this.getIdentifier(item)}]`).addClass('d-none');\r\n }\r\n\r\n let entriesLeft: boolean = $('.rental__filter_item').not('.d-none').length !== 0;\r\n this._rentalFilterModule.printItemCount(this._rentalFilterModule.rentalItemList.length - priceFilteredItems.length);\r\n $('.retail__notFound').toggleClass('d-none', entriesLeft);\r\n\r\n this._axLoading.HideLoadingIndicator($('.retail__filter_bar')[0]);\r\n $('.retail__filter_bar--container').removeClass('loading');\r\n }, 300);\r\n }\r\n\r\n getIdentifier(item: RentalSelectionItem) {\r\n return `${item.type}_${item.productTriple.projNr}-${item.productTriple.productGroupIdentifier}-${item.productTriple.id}`;\r\n }\r\n\r\n priceSliderChange(event: IonRangeSliderEvent) {\r\n this.priceRangeMin = Math.round(event.from * 100);\r\n this.priceRangeMax = Math.round(event.to * 100);\r\n this.updateFilteredProducts();\r\n\r\n let priceFilteredItems = this.getPriceFilteredList(event);\r\n\r\n if (priceFilteredItems.length > 0) {\r\n let min = priceFilteredItems.reduce((prev, curr) => prev.price < curr.price ? prev : curr).price;\r\n let max = priceFilteredItems.reduce((prev, curr) => prev.price > curr.price ? prev : curr).price;\r\n\r\n if (min !== max) {\r\n this.updatePriceFilterSingleItem(0);\r\n }\r\n }\r\n }\r\n\r\n backgroundUpdatePriceFilter(event: IonRangeSliderEvent) {\r\n let priceFilteredItems = this.getPriceFilteredList(event);\r\n\r\n if (priceFilteredItems.length > 0) {\r\n let min = priceFilteredItems.reduce((prev, curr) => prev.price < curr.price ? prev : curr).price;\r\n let max = priceFilteredItems.reduce((prev, curr) => prev.price > curr.price ? prev : curr).price;\r\n\r\n if (min === max) {\r\n this.updatePriceFilterSingleItem(priceFilteredItems[0].price);\r\n }\r\n }\r\n }\r\n\r\n getPriceFilteredList(event: IonRangeSliderEvent) {\r\n return this._rentalFilterModule.rentalItemList.filter(y => y.price <= Math.round(event.to * 100) &&\r\n y.price >= Math.round(event.from * 100));\r\n }\r\n\r\n updatePriceFilterSingleItem(tariff: number) {\r\n if (tariff !== this.lastPriceFilterTariff) {\r\n this.lastPriceFilterTariff = tariff;\r\n if (tariff !== 0) {\r\n this.rangeSlider.update({\r\n from_max: tariff / 100,\r\n to_min: tariff / 100\r\n });\r\n } else {\r\n this.rangeSlider.update({\r\n from_max: null,\r\n to_min: null\r\n });\r\n }\r\n }\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { BodyUtility } from \"../../Components/AxUtility/BodyUtility\";\r\nimport { AxDropdown, IAxDropdownOptions } from \"@axess/limestone\";\r\nimport { AxDatePicker, Cell, Mode } from \"../../Components/AxDatepicker/AxDatepicker\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { BehaviorSubject, Observable } from \"rxjs\";\r\nimport { RentalFilterResetHelper } from \"./Helper/RentalFilterResetHelper\";\r\nimport { RentalSelectionItem } from \"../../Models/Rental/RentalSelectionItem\";\r\nimport { RentalFilterPriceSlider } from \"./Components/RentalFilterPriceSlider\";\r\nimport { I18nHelper, Translations } from '../../Lib/Helper/I18nHelper';\r\n\r\n@ModuleName(\"RentalFilter\")\r\nexport class RentalFilter implements AxInit {\r\n public _durationDropDown: AxDropdown = new AxDropdown();\r\n public _locationDropDown: AxDropdown = new AxDropdown();\r\n public _dateDropDown: AxDropdown = new AxDropdown();\r\n\r\n public datePicker: AxDatePicker;\r\n public rentalItemList: RentalSelectionItem[];\r\n\r\n public options: IRentalFilterInitData;\r\n public filterUpdateAllowed: boolean = false;\r\n\r\n private datePickerActivationSubject: BehaviorSubject<Cell>;\r\n\r\n private rentalPriceFilter: RentalFilterPriceSlider;\r\n\r\n private tmpFilters: IFilterRequest;\r\n\r\n constructor(private _axLoading = new AxLoading(),\r\n private _bodyUtility = new BodyUtility(),\r\n private _requestHelper = new RequestHelper(),\r\n private _filterResetHelper = new RentalFilterResetHelper(),\r\n private i18nHelper = new I18nHelper()) { }\r\n\r\n AxInit(init: IRentalFilterInitData): void {\r\n this.options = init;\r\n this.rentalPriceFilter = new RentalFilterPriceSlider(this);\r\n\r\n this.initFilterInputs();\r\n this.attachMenuEvents();\r\n this.initQueryParameters();\r\n\r\n this._filterResetHelper.init(this);\r\n }\r\n\r\n toggleFilterBar(active: boolean) {\r\n $('.rental__filter_bar').toggleClass('active', active);\r\n }\r\n\r\n printFilterCount(count: number) {\r\n $('.rental__filter_filterWrapper, .rental__filter_filterCount').toggleClass('d-none', count === 0);\r\n $('.rental__filter_filterCount').html(`${count}`);\r\n }\r\n\r\n printItemCount(count: number) {\r\n $('.rental__filter_itemCount').html(`${count}`);\r\n $('.rental__filter_itemText').html(this.i18nHelper.GetTranslation(Translations.ShowXResults, count));\r\n }\r\n\r\n attachMenuEvents() {\r\n $('.rental__filter-catinfo').on('click', '.rental__filter_settings', e => {\r\n window.scrollTo(0, 0);\r\n this.toggleFilterBar(true);\r\n this._bodyUtility.DisableScroll();\r\n this.tmpFilters = this.getFilterRequest();\r\n });\r\n\r\n $('.prod_selection__prod-save').click(e => {\r\n this.toggleFilterBar(false);\r\n this._bodyUtility.EnableScroll();\r\n });\r\n\r\n $('.rental__filter_bar .retail__filter_settings-close').click(e => {\r\n this.resetFilterFromTmp();\r\n this.toggleFilterBar(false);\r\n this._bodyUtility.EnableScroll();\r\n });\r\n\r\n $('.rental__filter_bar .prod_selection__prod-close').click(e => {\r\n this.toggleFilterBar(false);\r\n this._filterResetHelper.resetAllFilters();\r\n });\r\n }\r\n\r\n initFilterInputs() {\r\n this.rentalPriceFilter.setPriceFilter();\r\n this.datePicker = new AxDatePicker();\r\n\r\n let endDate = this.options.endDate != null ? moment(this.options.endDate, \"YYYY-MM-DD\") : null;\r\n this.datePicker.Init({\r\n StartOfWeek: this.options.startOfWeek,\r\n Lang: this.options.lang,\r\n StartDate: moment(this.options.startDate, \"YYYY-MM-DD\"),\r\n DayRange: 0,\r\n Target: '#rental__startDate-picker',\r\n Mode: Mode.Inline,\r\n EndDate: endDate,\r\n monthsShown: 1\r\n });\r\n\r\n this._durationDropDown.init(`.rental_landing__duration`,\r\n {\r\n searchBar: true,\r\n multiSelect: false,\r\n onSelect: (parent, element) => { this.updateFilterItems() }\r\n });\r\n this._locationDropDown.init(`.rental_landing__location`,\r\n {\r\n searchBar: true,\r\n multiSelect: false,\r\n onSelect: (parent, element) => { this.updateFilterItems() }\r\n });\r\n\r\n this._dateDropDown.init(`.rental_landing__date`,\r\n {\r\n searchBar: false,\r\n multiSelect: false\r\n });\r\n\r\n\r\n $('input[name=rental_landing__cat]').on('change',\r\n () => {\r\n this.updateFilterItems();\r\n });\r\n\r\n\r\n this.datePickerActivationSubject = this.datePicker.ActivationSubject;\r\n this.datePickerActivationSubject.subscribe(x => { this.setDate(x); });\r\n }\r\n\r\n private resetFilterFromTmp() {\r\n this.filterUpdateAllowed = false;\r\n\r\n if (this.tmpFilters.arcId == null) {\r\n this._locationDropDown.resetSelection();\r\n } else {\r\n this._locationDropDown.setValue(this.tmpFilters.arcId);\r\n }\r\n\r\n if (this.tmpFilters.durationIdentifier == null) {\r\n this._durationDropDown.resetSelection();\r\n } else {\r\n this._durationDropDown.setValue(this.tmpFilters.durationIdentifier);\r\n }\r\n\r\n if (this.tmpFilters.date == null) {\r\n this.datePicker.resetDateSelection();;\r\n this._dateDropDown.resetSelection();\r\n } else {\r\n this.datePicker.setDate(moment(this.tmpFilters.date, 'YYYY-MM-YY'));\r\n }\r\n\r\n $(`input[name=rental_landing__cat]`).prop('checked', false);\r\n $(`input[name=rental_landing__cat][value=\"${this.tmpFilters.catId}\"]`).prop('checked', true);\r\n\r\n this.filterUpdateAllowed = true;\r\n this.updateFilterItems();\r\n }\r\n\r\n public getFilterParameterAndUpdateCount(request?: IFilterRequest) {\r\n let url = this.options.filterUrl;\r\n request = request || this.getFilterRequest();\r\n let filterCount = 0;\r\n\r\n if (request.catId != null && !isNaN(request.catId)) {\r\n url += `/${request.catId}`;\r\n filterCount++;\r\n }\r\n\r\n if (request.durationIdentifier != null) {\r\n url = this._requestHelper.insertParam(url, \"dId\", request.durationIdentifier);\r\n filterCount++;\r\n }\r\n if (request.arcId != null) {\r\n url = this._requestHelper.insertParam(url, \"aId\", request.arcId);\r\n filterCount++;\r\n }\r\n if (request.date != null && request.date != null) {\r\n url = this._requestHelper.insertParam(url, \"date\", request.date);\r\n filterCount++;\r\n }\r\n\r\n let rangeSlider = $(\"#retail__filter__price_slider\").data(\"ionRangeSlider\");\r\n\r\n if (!$(\".retail__filter__price_holder\").hasClass('d-none') && rangeSlider != null && (rangeSlider.result.min !== rangeSlider.result.from || rangeSlider.result.max !== rangeSlider.result.to)) {\r\n filterCount++;\r\n }\r\n\r\n this.printFilterCount(filterCount);\r\n return url;\r\n }\r\n\r\n updateFilterItems(requestObj?: IFilterRequest) {\r\n if (!this.filterUpdateAllowed) return;\r\n\r\n requestObj = requestObj || this.getFilterRequest();\r\n\r\n const urlPath = this.getFilterParameterAndUpdateCount(requestObj);\r\n window.history.pushState({}, \"\", urlPath);\r\n\r\n this._axLoading.ShowLoadingIndicator($('.rental__filter-item-wrapper')[0], false, null, true);\r\n AxessViewer.loadPartialView('/Rental/FilterPartial',\r\n requestObj,\r\n (x: IRentalFilterResult) => {\r\n this.rentalItemList = x.selectionItems;\r\n $('.rental__filter-itemList').html(x.returnView);\r\n $('.rental__filter-catinfo').html(x.catView);\r\n this.printItemCount(this.rentalItemList.length);\r\n this.rentalPriceFilter.setPriceFilter();\r\n this._axLoading.HideLoadingIndicator($('.rental__filter-item-wrapper')[0]);\r\n this.getFilterParameterAndUpdateCount(requestObj);\r\n }, {});\r\n }\r\n\r\n getFilterRequest(): IFilterRequest {\r\n const arcId = this._locationDropDown.getValue() as string;\r\n const durationIdentifier = this._durationDropDown.getValue() as string;\r\n const dateCell: Cell = this.datePickerActivationSubject.getValue();\r\n const catId = parseInt($('input[name=rental_landing__cat]:checked').val() as string);\r\n\r\n let date = null;\r\n if (dateCell != null) {\r\n date = dateCell.Date.format('YYYY-MM-DD');\r\n }\r\n\r\n const requestObj: IFilterRequest = {\r\n arcId,\r\n durationIdentifier,\r\n date,\r\n catId\r\n };\r\n\r\n return requestObj;\r\n }\r\n\r\n initQueryParameters() {\r\n const dateRaw = this._requestHelper.findGetParameter('date');\r\n const arcId = this._requestHelper.findGetParameter('aId');\r\n const durationId = this._requestHelper.findGetParameter('dId');\r\n\r\n if (dateRaw != null) {\r\n const date = moment(this._requestHelper.findGetParameter('date'), \"YYYY-MM-DD\");\r\n this.datePicker.setDate(date);\r\n }\r\n if (arcId != null) {\r\n this._locationDropDown.setValue(arcId);\r\n }\r\n if (durationId != null) {\r\n this._durationDropDown.setValue(durationId);\r\n }\r\n this.filterUpdateAllowed = true;\r\n this.updateFilterItems();\r\n }\r\n\r\n setDate(cell: Cell) {\r\n if (cell != null) {\r\n this._dateDropDown.setValue(cell.Date.format(this.options.datePattern));\r\n this._dateDropDown.close();\r\n this.updateFilterItems();\r\n }\r\n }\r\n}\r\n\r\ninterface IRentalFilterResult {\r\n returnView: HTMLElement;\r\n catView: HTMLElement;\r\n selectionItems: RentalSelectionItem[];\r\n}\r\n\r\ninterface IFilterRequest {\r\n arcId: string;\r\n durationIdentifier: string;\r\n date: string;\r\n catId: number;\r\n}\r\n\r\n\r\ninterface IRentalFilterInitData {\r\n filterUrl: string;\r\n startOfWeek: number;\r\n startDate: string;\r\n endDate?: string;\r\n datePattern: string;\r\n lang: string;\r\n currencyString: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n\r\nexport interface ILocalizationModuleInitData {\r\n cultureInfo: any;\r\n priceToDecimalDivisor: number;\r\n selectedLanguage: string;\r\n selectedLanguageId: number;\r\n}\r\n\r\n//Refactor this should definitely not be a module\r\n@ModuleName(\"LocalizationModule\")\r\nexport class LocalizationModule implements AxInit {\r\n private cultureInfo: any;\r\n private priceToDecimalDivisor: number;\r\n private selectedLanguage: string;\r\n private selectedLanguageId: number;\r\n\r\n AxInit(init: ILocalizationModuleInitData): void {\r\n this.cultureInfo = init.cultureInfo;\r\n this.priceToDecimalDivisor = init.priceToDecimalDivisor;\r\n this.selectedLanguage = init.selectedLanguage;\r\n this.selectedLanguageId = init.selectedLanguageId;\r\n }\r\n\r\n getSelectedLanguage(): string {\r\n return this.selectedLanguage;\r\n }\r\n\r\n getSelectedLanguageId(): number {\r\n return this.selectedLanguageId;\r\n }\r\n\r\n getCultureInfo(): any {\r\n return this.cultureInfo;\r\n }\r\n\r\n getPriceToDecimalDivisor(): number {\r\n return this.priceToDecimalDivisor;\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxReloadable } from \"../../Lib/AxSystem/AxReloadable\";\r\nexport interface BleQrCodesInit {\r\n loadTicketBtnClass: string;\r\n copyTextToClipboardBtnClass: string;\r\n\r\n}\r\n\r\ndeclare let toastr: any;\r\n\r\n@ModuleName(\"BleQrCodes\")\r\nexport class BleQrCodes implements AxInit, AxReloadable {\r\n private i18nHelper: I18nHelper;\r\n private initData: BleQrCodesInit;\r\n\r\n AxInit(init: BleQrCodesInit): void {\r\n this.i18nHelper = new I18nHelper();\r\n this.initData = init;\r\n this.initClickEvents('body');\r\n }\r\n\r\n AxReload(parentName: string): void {\r\n this.initClickEvents(parentName);\r\n }\r\n\r\n // initClickEvents\r\n initClickEvents(parentName: any) {\r\n\r\n $('.imageBox .close, .imageBox').click(() => {\r\n $('.imageBox').removeClass('open');\r\n $('.imageBox').removeClass('finished');\r\n toastr.clear();\r\n this.toggleOverlayScrollFixed(false);\r\n });\r\n\r\n let loadTicketButton = $(parentName).find(this.initData.loadTicketBtnClass);\r\n\r\n $(loadTicketButton).click((e) => {\r\n let cartEntryId = parseInt($(e.currentTarget).attr('data-cartEnrtryId'));\r\n let orderNr = parseInt($(e.currentTarget).attr('data-orderNr'));\r\n let mode = parseInt($(e.currentTarget).attr('data-mode'));\r\n\r\n this.loadTicket(orderNr, cartEntryId, mode);\r\n });\r\n\r\n let copyLinkButton = $(parentName).find(this.initData.copyTextToClipboardBtnClass);\r\n\r\n $(copyLinkButton).click((e) => {\r\n let cartEntryId = $(e.currentTarget).attr('data-cartEnrtryId');\r\n this.copyTextToClipboard(`#ble_bc_link_${cartEntryId}`);\r\n });\r\n }\r\n\r\n // loadTicket\r\n loadTicket(orderNr: number, cartEntryId: number, mode: number) {\r\n\r\n $('.imageBox').addClass('open');\r\n this.toggleOverlayScrollFixed(true);\r\n\r\n let text = [\r\n this.i18nHelper.GetTranslation(Translations.MyTicketsInfoBarCode),\r\n this.i18nHelper.GetTranslation(Translations.MyTicketsInfoVoucher),\r\n this.i18nHelper.GetTranslation(Translations.MyTicketsInfoBLE)\r\n ];\r\n\r\n let data = {\r\n orderNr: orderNr,\r\n cartEntryId: cartEntryId,\r\n };\r\n\r\n AxessViewer.loadPartialView('/QrCode/ShowTicket', data, resp => {\r\n if ($('.imageBox').hasClass('open')) {\r\n\r\n $('.imageBox .image').html(resp);\r\n\r\n $('.imageBox .image img').removeAttr('height');\r\n\r\n $('.imageBox').addClass('finished');\r\n\r\n toastr.info(text[mode], null, {\r\n \"closeButton\": false,\r\n \"debug\": false,\r\n \"newestOnTop\": false,\r\n \"progressBar\": false,\r\n \"positionClass\": \"toast-bottom-center\",\r\n \"preventDuplicates\": false,\r\n \"onclick\": null,\r\n \"showDuration\": \"0\",\r\n \"hideDuration\": \"1000\",\r\n \"timeOut\": \"0\",\r\n \"extendedTimeOut\": \"0\",\r\n \"showEasing\": \"swing\",\r\n \"hideEasing\": \"linear\",\r\n \"showMethod\": \"fadeIn\",\r\n \"hideMethod\": \"fadeOut\"\r\n });\r\n }\r\n }, {\r\n dataType: 'html'\r\n });\r\n }\r\n\r\n // copyTextToClipboard\r\n copyTextToClipboard(bleBcIdentifierName) {\r\n\r\n let txt = '' + $(bleBcIdentifierName).val();\r\n\r\n navigator.clipboard.writeText(txt);\r\n\r\n toastr.success(this.i18nHelper.GetTranslation(Translations.LinkCopiedToClipboard), null, {\r\n \"closeButton\": false,\r\n \"debug\": false,\r\n \"newestOnTop\": false,\r\n \"progressBar\": false,\r\n \"positionClass\": \"toast-bottom-center\",\r\n \"preventDuplicates\": false,\r\n \"onclick\": null,\r\n \"showDuration\": \"0\",\r\n \"hideDuration\": \"1000\",\r\n \"timeOut\": \"1000\",\r\n \"extendedTimeOut\": \"0\",\r\n \"showEasing\": \"swing\",\r\n \"hideEasing\": \"linear\",\r\n \"showMethod\": \"fadeIn\",\r\n \"hideMethod\": \"fadeOut\"\r\n });\r\n }\r\n\r\n // toggleOverlayScrollFixed\r\n toggleOverlayScrollFixed(addOverlay) {\r\n if (addOverlay) {\r\n var scrollTop = $(\"html\").scrollTop();\r\n $('html').addClass('overlay');\r\n $(\"body\").scrollTop(scrollTop);\r\n }\r\n else {\r\n var scrollTop = $(\"body\").scrollTop();\r\n $('html').removeClass('overlay');\r\n $(\"html\").scrollTop(scrollTop);\r\n }\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\n\r\n@ModuleName(\"ShoppingCartDateInputTriple\")\r\nexport class ShoppingCartDateInputTriple implements AxInit {\r\n private initData: ShoppingCartDateInputTripleInit;\r\n\r\n constructor(\r\n protected _dateInitData = new BirthDateInitData()\r\n ) {\r\n }\r\n\r\n AxInit(init: ShoppingCartDateInputTripleInit): void {\r\n\r\n this.initData = init;\r\n $('.positionPersonalisation_birthday').each((i, e) => {\r\n let cartEntryId = $(e).attr('data-for-entry');\r\n let datePatternId = $(`#datePatternId_${cartEntryId}`).val();\r\n let dateInitData = {\r\n birthdayPattern: datePatternId.toString(),\r\n outputTarget: `input[type=\"hidden\"]#DateOfBirthCi_${cartEntryId}`,\r\n parentId: `#needPersonId_${cartEntryId}`\r\n };\r\n AxLoad.LoadModule('AxBirthDateInputTriple', dateInitData);\r\n });\r\n }\r\n}\r\nclass ShoppingCartDateInputTripleInit {\r\n customerSignedIn?: boolean;\r\n}\r\n\r\nclass BirthDateInitData {\r\n birthdayPattern: string;\r\n parentId: string;\r\n outputTarget: string;\r\n setDay: string;\r\n setMonth: string;\r\n setYear: string;\r\n setBirthDate: string;\r\n}", "export class RentalProdSelectionTimings {\r\n startSoapDate: string | null;\r\n durationIdentifier: string | null;\r\n pickUpTimeId: number | null;\r\n\r\n allBookingTimeParametersAreSet(): boolean {\r\n return this.durationIdentifier != null\r\n && this.pickUpTimeId != null\r\n && this.startSoapDate != null;\r\n }\r\n}", "import { AxDropdown, IAxDropdownOptions } from \"@axess/limestone\";\r\nimport { AxDatePicker, Mode, Cell } from \"../../../../Components/AxDatepicker/AxDatepicker\";\r\nimport { IRentalDetailInitData } from \"../../../../Models/Rental/Details/RentalDetailInitData\";\r\nimport { RentalProdSelectionTimings } from \"../../../../Models/Rental/Details/RentalProdSelectionTimings\";\r\nimport { RentDetailsProdSelectCompManager } from \"../Services/RentDetailsProdSelectCompManager\";\r\n\r\nexport class RentDetailsProdSelectTimings {\r\n\r\n private startDatePicker = new AxDatePicker();\r\n private startDateDropDown = new AxDropdown();\r\n private durationDropDown = new AxDropdown();\r\n private pickUpTimeDropDown = new AxDropdown();\r\n\r\n private datePattern: string;\r\n private selectionTimings: RentalProdSelectionTimings;\r\n private prodSelectComponentManager: RentDetailsProdSelectCompManager;\r\n\r\n constructor(init: IRentalDetailInitData, prodSelectComponentManager: RentDetailsProdSelectCompManager) {\r\n this.selectionTimings = new RentalProdSelectionTimings();\r\n this.prodSelectComponentManager = prodSelectComponentManager;\r\n this.initEvents(init);\r\n }\r\n\r\n private initEvents(init: IRentalDetailInitData) {\r\n this.datePattern = init.datePattern;\r\n\r\n this.initStartDatePicker(init);\r\n this.initDurationDropDown();\r\n this.initPickUpTimesDropDown();\r\n }\r\n\r\n getSelectedTimings(): RentalProdSelectionTimings {\r\n return this.selectionTimings;\r\n }\r\n\r\n private loadProductSelectionComponent() {\r\n this.prodSelectComponentManager.loadRentDetailsProdSelectComponent(this.selectionTimings);\r\n }\r\n\r\n private initStartDatePicker(init: IRentalDetailInitData) {\r\n this.startDatePicker = new AxDatePicker();\r\n\r\n const endDate = init.endDate != null ? moment(init.endDate, \"YYYY-MM-DD\") : null;\r\n\r\n this.startDatePicker.Init({\r\n StartOfWeek: init.startOfWeek,\r\n Lang: init.lang,\r\n StartDate: moment(init.startDate, \"YYYY-MM-DD\"),\r\n DayRange: 0,\r\n Target: '#rental__startDate-picker',\r\n Mode: Mode.Inline,\r\n EndDate: endDate,\r\n monthsShown: 1\r\n });\r\n\r\n this.startDateDropDown.init(`.rental_details__date`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: ($parent: JQuery<HTMLElement>) => {\r\n //@ts-ignore\r\n const instance = $parent[0]._tippy as Instance<Props>;\r\n let $popper = $(instance.popper);\r\n $popper.css('width', 'auto');\r\n }\r\n });\r\n\r\n this.startDatePicker.ActivationSubject.subscribe(x => { this.onSelectStartDatePicker(x); });\r\n }\r\n\r\n\r\n private onSelectStartDatePicker(cell: Cell) {\r\n if (cell != null) {\r\n const dateValue = cell.Date.format(this.datePattern);\r\n this.startDateDropDown.setValue(dateValue);\r\n this.startDateDropDown.close();\r\n this.selectionTimings.startSoapDate = cell.Date.format(\"YYYY-MM-DD\");\r\n this.loadProductSelectionComponent();\r\n }\r\n }\r\n\r\n private initDurationDropDown() {\r\n this.durationDropDown.init(`.rental_details__duration`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: (elem: any) => { this.onSelectDurationDropDown(elem) }\r\n });\r\n }\r\n\r\n private onSelectDurationDropDown(elem: any) {\r\n this.selectionTimings.durationIdentifier = this.durationDropDown.getValue().toString();\r\n this.loadProductSelectionComponent();\r\n }\r\n\r\n private initPickUpTimesDropDown() {\r\n this.pickUpTimeDropDown.init(`.rental_details__pickUpTime`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: (elem: any) => { this.onSelectPickUpTimesDropDown(elem) }\r\n });\r\n }\r\n\r\n private onSelectPickUpTimesDropDown(elem: any) {\r\n this.selectionTimings.pickUpTimeId = parseInt(this.pickUpTimeDropDown.getValue().toString());\r\n this.loadProductSelectionComponent();\r\n }\r\n}", "import PhotoSwipe from \"photoswipe\";\r\nimport PhotoSwipeUI_Default from \"photoswipe/dist/photoswipe-ui-default\";\r\nimport { Asset } from \"../../../Interfaces/Assets/Asset\";\r\nimport { AssetHelper } from \"../../../Lib/Helper/AssetHelper\";\r\nimport Swiper from 'swiper';\r\n\r\nexport class RentalDetailLightbox {\r\n private photoSwipe: PhotoSwipe<PhotoSwipe.Options> = null;\r\n private swiperAssets: PhotoSwipe.Item[];\r\n\r\n constructor(private _assetHelper = new AssetHelper()) { }\r\n\r\n init(assetList: Asset[]): void {\r\n const swiper = new Swiper('.swiper', {\r\n direction: 'horizontal',\r\n loop: false,\r\n freeMode: true,\r\n slidesPerView: 'auto',\r\n spaceBetween: 8,\r\n });\r\n\r\n this.swiperAssets = this._assetHelper.GetPhotoSwipeItems(assetList);\r\n\r\n $('.retail_detail__asset-main').click(x => {\r\n let src = x.target.getAttribute('src');\r\n this.initLightBox(src);\r\n });\r\n\r\n $('.rental_detail__asset-list-item').click(x => {\r\n this.activateImage(x.target);\r\n });\r\n }\r\n\r\n activateImage(e: HTMLElement) {\r\n let index = parseInt(e.getAttribute('data-index'));\r\n\r\n $('.retail_detail__asset-main').attr('data-index', index);\r\n $('.retail_detail__asset-main').attr('src', $(e).attr('data-src'));\r\n }\r\n\r\n initLightBox(src) {\r\n let swiperAssets: PhotoSwipe.Item[] = [];\r\n let count = 0;\r\n let index = 0;\r\n\r\n for (let image of $(`.rental_detail__asset-list-item`).not('.d-none')) {\r\n let imageSrc = $(image).attr('data-src');\r\n let tmp = this.swiperAssets.find(x => x.src == imageSrc);\r\n swiperAssets.push(tmp);\r\n\r\n if (imageSrc == src) {\r\n index = count;\r\n }\r\n count++;\r\n }\r\n\r\n if (swiperAssets.length > 0) {\r\n let swipeElem = document.querySelectorAll('.pswp')[0] as HTMLElement;\r\n this.photoSwipe = new PhotoSwipe<PhotoSwipeUI_Default.Options>(swipeElem, PhotoSwipeUI_Default, swiperAssets, {\r\n index: index,\r\n closeEl: true,\r\n captionEl: false,\r\n fullscreenEl: false,\r\n zoomEl: false,\r\n shareEl: false,\r\n counterEl: false,\r\n arrowEl: false,\r\n preloaderEl: true,\r\n bgOpacity: 0.85,\r\n history: false\r\n });\r\n this.photoSwipe.init();\r\n }\r\n }\r\n}", "import { LocalizationModule } from \"../../../Global/LocalizationModule\";\r\nimport { PriceHelper } from \"../../../../Lib/Helper/PriceHelper\";\r\nimport { AxLoad } from \"../../../../Lib/AxSystem/AxLoad\";\r\nimport { RentalProdSelectionTimings } from \"../../../../Models/Rental/Details/RentalProdSelectionTimings\";\r\n\r\nexport abstract class RentDetailsProdSelectionAbstract {\r\n private locationId: number;\r\n private allProductsCount: number;\r\n\r\n private localizationModule: LocalizationModule;\r\n private priceHelper: PriceHelper;\r\n\r\n protected prodSelectionTimings: RentalProdSelectionTimings;\r\n\r\n abstract proceed();\r\n abstract getSelectionTotalPrice(): number;\r\n abstract getAllProductsCount(): number;\r\n protected abstract createPostData();\r\n\r\n constructor(bookingTimeParameterSelection: RentalProdSelectionTimings) {\r\n this.prodSelectionTimings = bookingTimeParameterSelection;\r\n this.allProductsCount = 0;\r\n\r\n this.localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n this.priceHelper = new PriceHelper(this.localizationModule.getCultureInfo(), true);\r\n }\r\n\r\n getSelectedLocationId(): number {\r\n return this.locationId;\r\n };\r\n\r\n setLocationId(locationId: number) {\r\n this.locationId = locationId;\r\n }\r\n\r\n getPriceHelper(): PriceHelper {\r\n return this.priceHelper;\r\n }\r\n}", "import { PriceHelper } from \"../../../Lib/Helper/PriceHelper\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { LocalizationModule } from \"../../../Modules/Global/LocalizationModule\";\r\nimport { AxCounter } from \"../../../Limestone/AxCounter/AxCounter\";\r\nimport { RentalProductDetails } from \"../../../Modules/Rental/ProductDetails/RentalProductDetails\";\r\n\r\nexport class RentDetailsSingleItemSelectionSection {\r\n projNr: number;\r\n personTypeId: number;\r\n rentalItemId: number;\r\n\r\n private itemsSelectedCount: number;\r\n\r\n private basePrice: number = 0;\r\n private basePriceHolder: HTMLElement;\r\n private totalPriceHolder: HTMLElement;\r\n\r\n private priceHelper: PriceHelper;\r\n\r\n constructor(wrapperElement: HTMLElement, pricesPerPersonType: any) {\r\n this.itemsSelectedCount = 0;\r\n this.basePrice = \r\n\r\n this.projNr = parseInt(wrapperElement.getAttribute(\"data-item-projNr\"));\r\n this.personTypeId = parseInt(wrapperElement.getAttribute(\"data-item-personTypeId\"));\r\n this.rentalItemId = parseInt(wrapperElement.getAttribute(\"data-item-id\"));\r\n\r\n this.addBasePrice(pricesPerPersonType);\r\n\r\n this.initItemCounters();\r\n\r\n this.priceHelper = new PriceHelper(null, true);\r\n\r\n this.basePriceHolder = document.querySelector(`[data-item-basePrice-idendifier=\"${this.personTypeId}\"]`);\r\n this.totalPriceHolder = document.querySelector(`[data-item-priceSum-idendifier=\"${this.personTypeId}\"]`);\r\n }\r\n\r\n getPostData(): any {\r\n const postData = {\r\n ProjNr: this.projNr,\r\n RentalItemId: this.rentalItemId,\r\n RentalPersonTypeId: this.personTypeId,\r\n Count: this.getItemsSelectedCount()\r\n }\r\n\r\n return postData;\r\n }\r\n\r\n updateBasePriceLabel() {\r\n const localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n const basePriceLabelText = this.priceHelper.GetPriceStringWithCurrencySymbol(this.basePrice / localizationModule.getPriceToDecimalDivisor());\r\n this.basePriceHolder.innerHTML = basePriceLabelText;\r\n }\r\n\r\n updateTotalPriceLabel() {\r\n const localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n const sumPriceLabelPrice = this.priceHelper.GetPriceStringWithCurrencySymbol(this.getSectionTotalPrice() / localizationModule.getPriceToDecimalDivisor());\r\n this.totalPriceHolder.innerHTML = sumPriceLabelPrice;\r\n }\r\n\r\n getSectionTotalPrice(): number {\r\n const totalPrice = this.basePrice * this.itemsSelectedCount;\r\n return totalPrice;\r\n }\r\n\r\n updatePriceLabels() {\r\n this.updateBasePriceLabel();\r\n this.updateTotalPriceLabel();\r\n }\r\n\r\n getItemsSelectedCount() {\r\n return this.itemsSelectedCount;\r\n }\r\n\r\n private addBasePrice(pricesPerPersonType: any) {\r\n const personTypePrice = pricesPerPersonType\r\n .find(x => x.personTypeNr === this.personTypeId);\r\n\r\n this.basePrice = personTypePrice.price;\r\n }\r\n\r\n private initItemCounters() {\r\n const axCounter = new AxCounter();\r\n\r\n axCounter.Init({\r\n Value: 0,\r\n Selector: this.getCounterSelector(),\r\n Max: 10,\r\n Min: 0,\r\n });\r\n\r\n axCounter.Subscribe((x) => {\r\n this.itemsSelectedCount = x;\r\n this.updatePriceLabels();\r\n AxLoad.GetModule<RentalProductDetails>('RentalProductDetails').refreshProceedBtn();\r\n });\r\n }\r\n\r\n getCounterSelector(): string {\r\n return `.prod__counter_singleItem_${this.personTypeId}`;\r\n }\r\n}", "import { RequestHelper } from \"../../../../Lib/Helper/RequestHelper\";\r\nimport { RentDetailsProdSelectionAbstract } from \"./RentDetailsProdSelectionAbstract\";\r\nimport { RentalProdSelectionTimings } from \"../../../../Models/Rental/Details/RentalProdSelectionTimings\";\r\nimport { RentDetailsSingleItemSelectionSection } from\r\n \"../../../../Models/Rental/Details/RentDetailsSingleItemSelectionSection\";\r\n\r\nexport class RentDetailsProdSelectSingleItemHandler extends RentDetailsProdSelectionAbstract {\r\n\r\n private rentalDetailSingleSelectionItem: RentDetailsSingleItemSelectionSection[] = [];\r\n\r\n constructor(prodSelectionTimings: RentalProdSelectionTimings, pricesPerPersonType: any) {\r\n super(prodSelectionTimings);\r\n\r\n const rentalProductPortlets = document.getElementsByClassName('rental_details__product_portlet');\r\n\r\n for (let i = 0; i < rentalProductPortlets.length; i++) {\r\n const wrapperElement = rentalProductPortlets[i] as HTMLElement;\r\n const rentalPackSelection = new RentDetailsSingleItemSelectionSection(wrapperElement, pricesPerPersonType);\r\n this.rentalDetailSingleSelectionItem.push(rentalPackSelection);\r\n }\r\n }\r\n\r\n getSelectionTotalPrice(): number {\r\n let selectionTotalPrice = 0;\r\n\r\n for (let i = 0; i < this.rentalDetailSingleSelectionItem.length; i++) {\r\n const selectionComp: RentDetailsSingleItemSelectionSection = this.rentalDetailSingleSelectionItem[i];\r\n const packPriceTotal = selectionComp.getSectionTotalPrice();\r\n selectionTotalPrice += packPriceTotal;\r\n }\r\n\r\n return selectionTotalPrice;\r\n }\r\n\r\n getAllProductsCount(): number {\r\n let selectionTotalCount = 0;\r\n\r\n for (let i = 0; i < this.rentalDetailSingleSelectionItem.length; i++) {\r\n const selectionComp: RentDetailsSingleItemSelectionSection = this.rentalDetailSingleSelectionItem[i];\r\n selectionTotalCount += selectionComp.getItemsSelectedCount();\r\n }\r\n\r\n return selectionTotalCount;\r\n }\r\n\r\n protected createPostData(): any {\r\n\r\n let tempArr = [];\r\n\r\n for (let i = 0; i < this.rentalDetailSingleSelectionItem.length; i++) {\r\n let tempItem = this.rentalDetailSingleSelectionItem[i];\r\n\r\n if (tempItem.getItemsSelectedCount() < 1) {\r\n continue;\r\n }\r\n\r\n const postData = tempItem.getPostData();\r\n tempArr.push(postData);\r\n }\r\n\r\n const data = {\r\n selectedLocationId: this.getSelectedLocationId(),\r\n startSoapDate: this.prodSelectionTimings.startSoapDate,\r\n durationIdentifier: this.prodSelectionTimings.durationIdentifier,\r\n pickupTimeId: this.prodSelectionTimings.pickUpTimeId,\r\n SelectedItems: tempArr\r\n };\r\n\r\n return data;\r\n }\r\n\r\n proceed() {\r\n\r\n const data = this.createPostData();\r\n const requestHelper = new RequestHelper();\r\n requestHelper.postToUrl(`/${cultureInfo}/RentalRiderDetails/RiderDetailsSingle`, data, {});\r\n\r\n }\r\n}", "\r\nexport class RentalDetailsPackOptionSelectionItem {\r\n\r\n constructor(productId: number, packagePosition: number, productName: string, productPrice: number, isSelected: boolean) {\r\n this.productId = productId;\r\n this.packagePosition = packagePosition;\r\n this.productName = productName;\r\n this.productPrice = productPrice;\r\n this.isSelected = isSelected;\r\n\r\n }\r\n\r\n productId: number;\r\n packagePosition: number;\r\n productName: string;\r\n productPrice: number;\r\n isSelected: boolean;\r\n}", "import { RentalDetailsPackOptionSelectionItem } from\r\n \"../../../../Models/Rental/Details/RentalDetailsPackOptionSelectionItem\";\r\nimport { PriceHelper } from \"../../../../Lib/Helper/PriceHelper\";\r\nimport { AxLoad } from \"../../../../Lib/AxSystem/AxLoad\";\r\nimport { RentalProductDetails } from \"../RentalProductDetails\";\r\nimport { RentDetailsPackItemSelectionSection } from \"./RentDetailsPackItemSelectionSection\";\r\nimport { LocalizationModule } from \"../../../Global/LocalizationModule\";\r\n\r\nexport class RentDetailsProdOptItemSelectSection {\r\n\r\n private htmlElement: HTMLDivElement;\r\n\r\n private itemSelectionData: RentalDetailsPackOptionSelectionItem[];\r\n private parentComponent: RentDetailsPackItemSelectionSection;\r\n\r\n constructor(availableOptionalItems: RentalDetailsPackOptionSelectionItem[], drawSeparator: boolean, wrapper: HTMLElement,\r\n parentComponent: RentDetailsPackItemSelectionSection) {\r\n\r\n this.parentComponent = parentComponent;\r\n this.itemSelectionData = [];\r\n\r\n const row = document.createElement(\"div\");\r\n row.classList.add(\"row\");\r\n\r\n this.htmlElement = row;\r\n\r\n wrapper.appendChild(row);\r\n\r\n if (drawSeparator) {\r\n const separator = document.createElement(\"div\");\r\n separator.classList.add(\"ax-divider\");\r\n separator.classList.add(\"ax-mb-2\");\r\n row.appendChild(separator);\r\n }\r\n\r\n for (let i = 0; i < availableOptionalItems.length; i++) {\r\n const newItemSelectionData = new RentalDetailsPackOptionSelectionItem(availableOptionalItems[i].productId,\r\n availableOptionalItems[i].packagePosition,\r\n availableOptionalItems[i].productName,\r\n availableOptionalItems[i].productPrice,\r\n availableOptionalItems[i].isSelected);\r\n\r\n this.itemSelectionData.push(newItemSelectionData);\r\n\r\n const checkBoxCol = this.getCheckBoxCol(newItemSelectionData);\r\n row.appendChild(checkBoxCol);\r\n }\r\n }\r\n\r\n destroyElement() {\r\n this.htmlElement.remove();\r\n }\r\n\r\n getSelectedItemsIds(): RentalDetailsPackOptionSelectionItem[] {\r\n const selectedItemIds = this.itemSelectionData\r\n .filter(x => x.isSelected);\r\n\r\n return selectedItemIds;\r\n }\r\n\r\n getSelectedItemsPriceSum(): number {\r\n\r\n let optItemsTotalPrice = 0;\r\n\r\n for (let y = 0; y < this.itemSelectionData.length; y++) {\r\n const selectionData = this.itemSelectionData[y];\r\n\r\n if (selectionData.isSelected) {\r\n optItemsTotalPrice += selectionData.productPrice;\r\n }\r\n }\r\n\r\n return optItemsTotalPrice;\r\n }\r\n\r\n private getCheckBoxCol(optionalItem: RentalDetailsPackOptionSelectionItem): HTMLDivElement {\r\n const col = document.createElement(\"div\");\r\n col.classList.add(\"col-12\");\r\n col.classList.add(\"col-md-6\");\r\n\r\n const checkboxWrapper = document.createElement(\"div\");\r\n checkboxWrapper.classList.add(\"ax-checkbox-wrapper\");\r\n\r\n let localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n let priceHelper = new PriceHelper(localizationModule.getCultureInfo(), true);\r\n\r\n const priceString = priceHelper.GetPriceStringWithCurrencySymbol(optionalItem.productPrice / localizationModule.getPriceToDecimalDivisor());\r\n\r\n const optionalItemLabelString = `${optionalItem.productName} ( + ${priceString})`;\r\n const label = document.createElement(\"label\");\r\n label.classList.add(\"ax-checkbox\");\r\n label.innerHTML = optionalItemLabelString;\r\n\r\n const optionalItemIdentifier = `prod__check_optional_${optionalItem.productId}`;\r\n const checkBox = document.createElement(\"input\");\r\n checkBox.name = optionalItemIdentifier;\r\n\r\n if (optionalItem.isSelected) {\r\n checkBox.checked = true;\r\n }\r\n checkBox.type = \"checkbox\";\r\n\r\n const span = document.createElement(\"span\");\r\n span.classList.add(\"ax-checkbox__checkmark\");\r\n\r\n label.appendChild(checkBox);\r\n label.appendChild(span);\r\n checkboxWrapper.appendChild(label);\r\n col.appendChild(checkboxWrapper);\r\n\r\n this.initCheckBox(checkBox, optionalItem);\r\n\r\n return col;\r\n }\r\n\r\n private initCheckBox(checkBox: HTMLInputElement, optionalItem: RentalDetailsPackOptionSelectionItem) {\r\n checkBox.addEventListener('change', (event) => {\r\n optionalItem.isSelected = checkBox.checked;\r\n this.parentComponent.updatePriceLabels();\r\n AxLoad.GetModule<RentalProductDetails>('RentalProductDetails').refreshProceedBtn();\r\n });\r\n }\r\n}", "import { RentalDetailsPackOptionSelectionItem } from\r\n \"../../../../Models/Rental/Details/RentalDetailsPackOptionSelectionItem\";\r\nimport { RentDetailsProdOptItemSelectSection } from \"./RentDetailsProdOptItemSelectSection\";\r\nimport { PriceHelper } from \"../../../../Lib/Helper/PriceHelper\";\r\nimport { AxCounter } from \"../../../../Limestone/AxCounter/AxCounter\";\r\nimport { LocalizationModule } from \"../../../Global/LocalizationModule\";\r\nimport { AxLoad } from \"../../../../Lib/AxSystem/AxLoad\";\r\nimport { RentalProductDetails } from \"../RentalProductDetails\";\r\n\r\nexport class RentDetailsPackItemSelectionSection {\r\n private projNr: number;\r\n private prodGroupId: number;\r\n private packageId: number;\r\n private personTypeId: number;\r\n private packagesSelectedCount: number;\r\n private basePrice: number = 0;\r\n\r\n availableOptionalItems: RentalDetailsPackOptionSelectionItem[];\r\n optionalItemsSections: RentDetailsProdOptItemSelectSection[];\r\n\r\n private basePriceHolder: HTMLElement;\r\n private totalPriceHolder: HTMLElement;\r\n\r\n private priceHelper: PriceHelper;\r\n\r\n constructor(wrapperElement: HTMLElement, packageList: any) {\r\n this.packagesSelectedCount = 0;\r\n this.availableOptionalItems = [];\r\n this.optionalItemsSections = [];\r\n\r\n this.projNr = parseInt(wrapperElement.getAttribute(\"data-pack-projNr\"));\r\n this.prodGroupId = parseInt(wrapperElement.getAttribute(\"data-pack-productGroupIdentifier\"));\r\n this.packageId = parseInt(wrapperElement.getAttribute(\"data-pack-id\"));\r\n this.personTypeId = parseInt(wrapperElement.getAttribute(\"data-pack-personTypeId\"));\r\n\r\n this.addOptionalItemDataAndBasePrice(packageList);\r\n this.initPackageCounters();\r\n\r\n const localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n this.priceHelper = new PriceHelper(localizationModule.getCultureInfo(), true);\r\n\r\n this.basePriceHolder = document.querySelector(`[data-item-basePrice-idendifier=\"${this.packageId}\"]`);\r\n this.totalPriceHolder = document.querySelector(`[data-item-priceSum-idendifier=\"${this.packageId}\"]`);\r\n }\r\n\r\n getPostData(): any {\r\n let postData = [];\r\n\r\n if (this.optionalItemsSections.length === 0) {\r\n for (let i = 0; i < this.getPackagesSelectedCount(); i++) {\r\n const packageSelectionData = {\r\n projNr: this.projNr,\r\n prodGrpId: this.prodGroupId,\r\n packageId: this.packageId,\r\n rentalPersonTypeId: this.personTypeId\r\n };\r\n\r\n postData.push(packageSelectionData);\r\n }\r\n\r\n return postData;\r\n }\r\n\r\n for (let i = 0; i < this.optionalItemsSections.length; i++) {\r\n const packageSelectionData = {\r\n projNr: this.projNr,\r\n prodGrpId: this.prodGroupId,\r\n packageId: this.packageId,\r\n rentalPersonTypeId: this.personTypeId,\r\n selectedOptionalItems: this.optionalItemsSections[i].getSelectedItemsIds()\r\n };\r\n\r\n postData.push(packageSelectionData);\r\n }\r\n\r\n return postData;\r\n }\r\n\r\n updateBasePriceLabel() {\r\n const localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n const basePriceLabelText = this.priceHelper.GetPriceStringWithCurrencySymbol(this.basePrice / localizationModule.getPriceToDecimalDivisor());\r\n this.basePriceHolder.innerHTML = basePriceLabelText;\r\n }\r\n\r\n updateTotalPriceLabel() {\r\n const localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n const sumPriceLabelPrice = this.priceHelper.GetPriceStringWithCurrencySymbol(this.getPackageTotalPrice() / localizationModule.getPriceToDecimalDivisor());\r\n this.totalPriceHolder.innerHTML = sumPriceLabelPrice;\r\n }\r\n\r\n updatePriceLabels() {\r\n this.updateBasePriceLabel();\r\n this.updateTotalPriceLabel();\r\n }\r\n\r\n getPackageTotalPrice(): number {\r\n const optItemsTotalPrice = this.getPriceSumSelectedOptionalItems();\r\n return (this.basePrice * this.packagesSelectedCount) + optItemsTotalPrice;\r\n }\r\n\r\n getPackagesSelectedCount(): number {\r\n return this.packagesSelectedCount;\r\n }\r\n\r\n getPriceSumSelectedOptionalItems(): number {\r\n\r\n let optItemsTotalPrice = 0;\r\n\r\n for (let i = 0; i < this.optionalItemsSections.length; i++) {\r\n const optItemSection = this.optionalItemsSections[i];\r\n optItemsTotalPrice += optItemSection.getSelectedItemsPriceSum();\r\n }\r\n\r\n return optItemsTotalPrice;\r\n }\r\n\r\n removeOptionalItemSection() {\r\n const lastItem = this.optionalItemsSections.pop();\r\n lastItem.destroyElement();\r\n }\r\n\r\n getCounterSelectorPack(): string {\r\n return `.prod__counter_pack_${this.projNr}_${this.prodGroupId}_${this.packageId}_${this.personTypeId}`;\r\n }\r\n\r\n private addOptionalItemDataAndBasePrice(packageList: any) {\r\n const packageData = packageList\r\n .find(x => x.productTripleWithType.id === this.packageId &&\r\n x.productTripleWithType.productGroupIdentifier === this.prodGroupId);\r\n\r\n for (let i = 0; i < packageData.packageProducts.length; i++) {\r\n const temp = packageData.packageProducts[i];\r\n\r\n if (!temp.isOptional) {\r\n this.basePrice += temp.productPrice;\r\n continue;\r\n }\r\n\r\n const optionalItem = new RentalDetailsPackOptionSelectionItem(temp.productId, temp.packagePosition, temp.productName, temp.productPrice, temp.preSelected ?? false);\r\n this.availableOptionalItems.push(optionalItem);\r\n }\r\n }\r\n\r\n private manageOptionalItemSection(count: number) {\r\n const wrapperId = `rental_details__package_optItems_wrapper_${this.projNr}_${this.prodGroupId}_${this.packageId}`;\r\n const wrapper = document.getElementById(wrapperId);\r\n\r\n if (this.availableOptionalItems.length === 0) {\r\n return;\r\n }\r\n\r\n if (count > this.optionalItemsSections.length) {\r\n const optionalItemSection =\r\n new RentDetailsProdOptItemSelectSection(this.availableOptionalItems, count > 1, wrapper, this);\r\n this.optionalItemsSections.push(optionalItemSection);\r\n } else {\r\n this.removeOptionalItemSection();\r\n }\r\n }\r\n\r\n private initPackageCounters() {\r\n const axCounter = new AxCounter();\r\n\r\n axCounter.Init({\r\n Value: 0,\r\n Selector: this.getCounterSelectorPack(),\r\n Max: 10,\r\n Min: 0,\r\n });\r\n\r\n axCounter.Subscribe((x) => {\r\n this.packagesSelectedCount = x;\r\n this.manageOptionalItemSection(x);\r\n this.updatePriceLabels();\r\n AxLoad.GetModule<RentalProductDetails>('RentalProductDetails').refreshProceedBtn();\r\n });\r\n }\r\n}", "import { RentDetailsProdSelectionAbstract } from \"./RentDetailsProdSelectionAbstract\";\r\nimport { RentalProdSelectionTimings } from \"../../../../Models/Rental/Details/RentalProdSelectionTimings\";\r\nimport { RentDetailsPackItemSelectionSection } from \"../Components/RentDetailsPackItemSelectionSection\";\r\nimport { RequestHelper } from \"../../../../Lib/Helper/RequestHelper\";\r\n\r\nexport class RentDetailsProdSelectPackHandler extends RentDetailsProdSelectionAbstract {\r\n private rentalPackageSelectionSections: RentDetailsPackItemSelectionSection[] = [];\r\n\r\n constructor(prodSelectionTimings: RentalProdSelectionTimings, packageList: any) {\r\n super(prodSelectionTimings);\r\n const rentalPackageWrappers = document.getElementsByClassName('rental_details__package_wrapper');\r\n\r\n for (let i = 0; i < rentalPackageWrappers.length; i++) {\r\n const wrapperElement = rentalPackageWrappers[i] as HTMLElement;\r\n const rentalPackSelectionSection = new RentDetailsPackItemSelectionSection(wrapperElement, packageList);\r\n this.rentalPackageSelectionSections.push(rentalPackSelectionSection);\r\n }\r\n }\r\n\r\n upDateAllPriceLabels() {\r\n for (let i = 0; i < this.rentalPackageSelectionSections.length; i++) {\r\n const selectionComp: RentDetailsPackItemSelectionSection = this.rentalPackageSelectionSections[i];\r\n selectionComp.updatePriceLabels();\r\n }\r\n }\r\n\r\n getSelectionTotalPrice(): number {\r\n let selectionTotalPrice = 0;\r\n\r\n for (let i = 0; i < this.rentalPackageSelectionSections.length; i++) {\r\n const selectionComp: RentDetailsPackItemSelectionSection = this.rentalPackageSelectionSections[i];\r\n const packPriceTotal = selectionComp.getPackageTotalPrice();\r\n selectionTotalPrice += packPriceTotal;\r\n }\r\n\r\n return selectionTotalPrice;\r\n }\r\n\r\n getAllProductsCount(): number {\r\n let selectionTotalCount = 0;\r\n\r\n for (let i = 0; i < this.rentalPackageSelectionSections.length; i++) {\r\n const selectionComp: RentDetailsPackItemSelectionSection = this.rentalPackageSelectionSections[i];\r\n selectionTotalCount += selectionComp.getPackagesSelectedCount();\r\n }\r\n\r\n return selectionTotalCount;\r\n }\r\n\r\n protected createPostData(): any {\r\n\r\n let selectedPackages = [];\r\n\r\n for (let i = 0; i < this.rentalPackageSelectionSections.length; i++) {\r\n const tempPack = this.rentalPackageSelectionSections[i];\r\n if (tempPack.getPackagesSelectedCount() < 1) {\r\n continue;\r\n }\r\n const postDataPack = tempPack.getPostData();\r\n selectedPackages = selectedPackages.concat(postDataPack);\r\n }\r\n\r\n const data = {\r\n selectedLocationId: this.getSelectedLocationId(),\r\n startSoapDate: this.prodSelectionTimings.startSoapDate,\r\n durationIdentifier: this.prodSelectionTimings.durationIdentifier,\r\n pickupTimeId: this.prodSelectionTimings.pickUpTimeId,\r\n rentalDetailsSelectedPackages: selectedPackages\r\n };\r\n\r\n return data;\r\n }\r\n\r\n proceed() {\r\n const data = this.createPostData();\r\n const requestHelper = new RequestHelper();\r\n requestHelper.postToUrl(`/${cultureInfo}/RentalRiderDetails/RiderDetailsPack`, data, {});\r\n }\r\n}", "import { AxDropdown, IAxDropdownOptions } from \"@axess/limestone\";\r\nimport { RentalItemIdentifier } from \"../../../../Models/Rental/Details/RentalItemIdentifier\";\r\nimport { AxLoading } from \"../../../../Limestone/AxLoading/AxLoading\";\r\nimport { AxCounter } from \"../../../../Limestone/AxCounter/AxCounter\";\r\nimport { RentDetailsProdSelectionAbstract } from \"./RentDetailsProdSelectionAbstract\";\r\nimport { RentDetailsProdSelectSingleItemHandler } from \"./RentDetailsProdSelectSingleItemHandler\";\r\nimport { RentDetailsProdSelectPackHandler } from \"./RentDetailsProdSelectPackHandler\";\r\nimport { RentalProdSelectionTimings } from \"../../../../Models/Rental/Details/RentalProdSelectionTimings\";\r\nimport { AxLoad } from \"../../../../Lib/AxSystem/AxLoad\";\r\nimport { RentalProductDetails } from \"../RentalProductDetails\";\r\n\r\nexport class RentDetailsProdSelectCompManager {\r\n private rentalSelectionItem: RentalItemIdentifier;\r\n private axLoading = new AxLoading();\r\n private locationDropDown = new AxDropdown();\r\n private rentalDetailProdSelection: RentDetailsProdSelectionAbstract;\r\n\r\n productCounters: AxCounter[] = [];\r\n\r\n constructor(rentalSelectionItem: RentalItemIdentifier) {\r\n this.rentalSelectionItem = rentalSelectionItem;\r\n }\r\n\r\n getProdSelectionComponent(): RentDetailsProdSelectionAbstract {\r\n return this.rentalDetailProdSelection;\r\n }\r\n\r\n locationIsSet(): boolean {\r\n return this.rentalDetailProdSelection.getSelectedLocationId() !== undefined;\r\n }\r\n\r\n quantityOk(): boolean {\r\n return this.rentalDetailProdSelection.getAllProductsCount() > 0;\r\n }\r\n\r\n loadRentDetailsProdSelectComponent(prodSelectionTimings: RentalProdSelectionTimings) {\r\n\r\n if (!prodSelectionTimings.allBookingTimeParametersAreSet()) {\r\n return;\r\n }\r\n\r\n const data = {\r\n productTripleWithType: {\r\n projNr: this.rentalSelectionItem.projNr,\r\n productGroupIdentifier: this.rentalSelectionItem.productGroupIdentifier,\r\n id: this.rentalSelectionItem.id,\r\n // Rental = 4 todo: enum or constant\r\n // Package = 1\r\n // RentalSelectionItemType: 1 == SingleItem\r\n Type: this.rentalSelectionItem.rentalSelectionItemType === 0 ? 4 : 1\r\n },\r\n startSoapDate: prodSelectionTimings.startSoapDate,\r\n durationIdentifier: prodSelectionTimings.durationIdentifier,\r\n pickUpTimeId: prodSelectionTimings.pickUpTimeId\r\n };\r\n\r\n const url = this.getCorrectLinkForPartial();\r\n\r\n $('.rental_detail__selection-area-holder').addClass('position-relative ');\r\n $('.rental_detail__selection-area-holder').html('<div style=\"min-height: 250px;\"></div>');\r\n\r\n this.axLoading.ShowLoadingIndicator($('.rental_detail__selection-area-holder')[0], true);\r\n\r\n AxessViewer.loadPartialView(url, data, (res) => {\r\n let returnView = res.returnView;\r\n\r\n $('.rental_detail__selection-area-holder').html(returnView);\r\n\r\n this.initLocationDropDown();\r\n this.initPartialEventsAfterLoad(prodSelectionTimings, res);\r\n\r\n let retailsAlertBannerData = new DetailsAlertBannersData(res.rentalDetailsAlertBannersViewModel.alertBannerText,\r\n res.rentalDetailsAlertBannersViewModel.arcAlertBannerHeaderText, res.rentalDetailsAlertBannersViewModel.arcAlertMessages,\r\n res.rentalDetailsAlertBannersViewModel.pickupTimeAtAllArcsValid)\r\n\r\n this.showBookingPeriodAlert(retailsAlertBannerData.alertBannerText);\r\n\r\n if (retailsAlertBannerData.pickupTimeAtAllArcsValid === false) {\r\n this.showArcAvailabilityAlert(retailsAlertBannerData);\r\n }\r\n this.axLoading.HideLoadingIndicator($('.rental_detail__selection-area-holder')[0]);\r\n }, {\r\n //dataType: 'html'\r\n });\r\n }\r\n\r\n private showBookingPeriodAlert(alertBannerText: string) {\r\n let alertElement = document.getElementById('bookingPeriodAlert');\r\n alertElement.innerHTML = alertBannerText;\r\n alertElement.removeAttribute(\"hidden\");\r\n }\r\n\r\n private showArcAvailabilityAlert(rentalDetailsAlertBannerData: DetailsAlertBannersData) {\r\n const alertMsgHolderDiv = document.createElement('div');\r\n\r\n const headerParagraph = document.createElement('p');\r\n headerParagraph.textContent = rentalDetailsAlertBannerData.arcAlertBannerHeaderText;\r\n headerParagraph.classList.add('font-weight-bold');\r\n\r\n alertMsgHolderDiv.appendChild(headerParagraph);\r\n\r\n rentalDetailsAlertBannerData.arcAlertMessages.forEach((alertMesg, index) => {\r\n const paragraph = document.createElement('p');\r\n paragraph.textContent = alertMesg;\r\n alertMsgHolderDiv.appendChild(paragraph);\r\n });\r\n\r\n let alertElement = document.getElementsByClassName('arcAvailabilityAlert');\r\n alertElement[0].innerHTML = alertMsgHolderDiv.outerHTML;\r\n alertElement[0].removeAttribute(\"hidden\");\r\n }\r\n\r\n private initPartialEventsAfterLoad(prodSelectionTimings: RentalProdSelectionTimings, result: any) {\r\n switch (this.rentalSelectionItem.rentalSelectionItemType) {\r\n case 0:\r\n this.initSingleEventsAfterLoad(prodSelectionTimings, result.pricesPerPersonType);\r\n break;\r\n case 1:\r\n this.initPackageEventsAfterLoad(prodSelectionTimings, result.packageList);\r\n break;\r\n case 2:\r\n this.initPackageEventsAfterLoad(prodSelectionTimings, result.packageList);\r\n break;\r\n }\r\n }\r\n\r\n private initSingleEventsAfterLoad(prodSelectionTimings: RentalProdSelectionTimings, pricesPerPersonType: any) {\r\n this.rentalDetailProdSelection = new RentDetailsProdSelectSingleItemHandler(prodSelectionTimings, pricesPerPersonType);\r\n }\r\n\r\n private initPackageEventsAfterLoad(prodSelectionTimings: RentalProdSelectionTimings, packageList: any) {\r\n this.rentalDetailProdSelection = new RentDetailsProdSelectPackHandler(prodSelectionTimings, packageList);\r\n }\r\n\r\n private getCorrectLinkForPartial(): string {\r\n let url = '';\r\n\r\n switch (this.rentalSelectionItem.rentalSelectionItemType) {\r\n case 0:\r\n url = '/RentalDetails/LoadSingleItemDetailsSelectionPartial';\r\n break;\r\n case 1:\r\n url = '/RentalDetails/LoadPackageItemDetailsSelectionPartial';\r\n break;\r\n case 2:\r\n url = '/RentalDetails/LoadPackageGroupItemDetailsSelectionPartial';\r\n break;\r\n }\r\n\r\n return url;\r\n }\r\n\r\n private initLocationDropDown() {\r\n this.locationDropDown.init(`.rental_details__location`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: (elem: any) => { this.onSelectLocationDropDown(elem) }\r\n });\r\n }\r\n\r\n private onSelectLocationDropDown(elem: any) {\r\n const arcNr = parseInt(this.locationDropDown.getValue().toString());\r\n this.rentalDetailProdSelection.setLocationId(arcNr);\r\n const rentalProductDetailsModule = AxLoad.GetModule<RentalProductDetails>('RentalProductDetails');\r\n\r\n $('.rental_details__locationLink').addClass('d-none');\r\n $(`.rental_details__locationLink[data-target=\"${arcNr}\"]`).removeClass('d-none');\r\n\r\n rentalProductDetailsModule.refreshProceedBtn();\r\n }\r\n}\r\n\r\nclass DetailsAlertBannersData {\r\n constructor(alertBannerText: string, arcAlertBannerHeaderText: string, arcAlertMessages: string[], pickupTimeAtAllArcsValid: boolean) {\r\n this.alertBannerText = alertBannerText;\r\n this.arcAlertBannerHeaderText = arcAlertBannerHeaderText;\r\n this.arcAlertMessages = arcAlertMessages;\r\n this.pickupTimeAtAllArcsValid = pickupTimeAtAllArcsValid;\r\n }\r\n\r\n public alertBannerText: string;\r\n public arcAlertBannerHeaderText: string;\r\n public arcAlertMessages: string[];\r\n public pickupTimeAtAllArcsValid: boolean;\r\n}", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { IRentalDetailInitData } from \"../../../Models/Rental/Details/RentalDetailInitData\";\r\nimport { AxLoading } from \"../../../Limestone/AxLoading/AxLoading\";\r\nimport { RentDetailsProdSelectTimings } from \"./Components/RentDetailsProdSelectTimings\";\r\nimport { I18nHelper, Translations } from \"../../../Lib/Helper/I18nHelper\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { LocalizationModule } from \"../../Global/LocalizationModule\";\r\nimport { PriceHelper } from \"../../../Lib/Helper/PriceHelper\";\r\nimport { RentalDetailLightbox } from \"../Components/RentalDetailLightbox\";\r\nimport { RentDetailsProdSelectCompManager } from \"./Services/RentDetailsProdSelectCompManager\";\r\n\r\n@ModuleName(\"RentalProductDetails\")\r\nexport class RentalProductDetails implements AxInit {\r\n\r\n private loadingSpinner: AxLoading;\r\n private i18nHelper: I18nHelper;\r\n\r\n private rentDetailsProdSelectTimings: RentDetailsProdSelectTimings;\r\n private rentDetailsProdSelectCompManager: RentDetailsProdSelectCompManager;\r\n private priceHelper: PriceHelper;\r\n\r\n proceedBtn: HTMLButtonElement;\r\n\r\n AxInit(init: IRentalDetailInitData): void {\r\n this.i18nHelper = new I18nHelper();\r\n this.loadingSpinner = new AxLoading();\r\n this.initComponents(init);\r\n\r\n const localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n const detailLightbox = new RentalDetailLightbox();\r\n detailLightbox.init(init.assets);\r\n\r\n this.priceHelper = new PriceHelper(localizationModule.getCultureInfo(), true);\r\n }\r\n\r\n private initComponents(init: IRentalDetailInitData) {\r\n this.rentDetailsProdSelectCompManager = new RentDetailsProdSelectCompManager(init.rentalSelectionItem);\r\n this.rentDetailsProdSelectTimings = new RentDetailsProdSelectTimings(init, this.rentDetailsProdSelectCompManager);\r\n\r\n this.initProceedButton();\r\n }\r\n\r\n private initProceedButton() {\r\n this.proceedBtn = document.getElementById('rental_detail__button-proceed') as HTMLButtonElement;\r\n this.proceedBtn.addEventListener(\"click\", e => {\r\n this.rentDetailsProdSelectCompManager\r\n .getProdSelectionComponent()\r\n .proceed();\r\n });\r\n }\r\n\r\n refreshProceedBtn() {\r\n const locationIsSet = this.rentDetailsProdSelectCompManager\r\n .locationIsSet();\r\n\r\n const timingsSet = this.rentDetailsProdSelectTimings\r\n .getSelectedTimings()\r\n .allBookingTimeParametersAreSet();\r\n\r\n const quantityOk = this.rentDetailsProdSelectCompManager.quantityOk();\r\n\r\n if (locationIsSet && timingsSet && quantityOk) {\r\n this.proceedBtn.disabled = false;\r\n } else {\r\n this.proceedBtn.disabled = true;\r\n }\r\n\r\n this.setProceedBtnText();\r\n }\r\n\r\n showLoadingSpinnerOnProceedBtn() {\r\n this.loadingSpinner.ShowLoadingIndicatorButtonPrimary(this.proceedBtn);\r\n }\r\n\r\n hideLoadingSpinnerOnProceedBtn() {\r\n this.loadingSpinner.HideLoadingIndicator(this.proceedBtn);\r\n }\r\n\r\n private setProceedBtnText() {\r\n const totalPrice = this.rentDetailsProdSelectCompManager\r\n .getProdSelectionComponent()\r\n .getSelectionTotalPrice();\r\n\r\n const localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n\r\n const totalProductCount = this.rentDetailsProdSelectCompManager\r\n .getProdSelectionComponent()\r\n .getAllProductsCount();\r\n\r\n const bntText = `<p style=\"margin-bottom: 0;\">${totalProductCount} ${this.i18nHelper.GetTranslation(Translations.Rentals)},\r\n ${this.priceHelper.GetPriceStringWithCurrencySymbol(totalPrice / localizationModule.getPriceToDecimalDivisor())}</p>`;\r\n\r\n this.proceedBtn.innerHTML = bntText;\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\nexport interface IDateModuleData {\r\n startOfWeekConfig: number;\r\n companyDate: string;\r\n datePattern: string;\r\n}\r\n\r\n@ModuleName(\"DateModule\")\r\nexport class DateModule implements AxInit {\r\n private startOfWeekConfig: number;\r\n private companyDate: string;\r\n private datePattern: string;\r\n\r\n AxInit(init: IDateModuleData): void {\r\n this.startOfWeekConfig = init.startOfWeekConfig;\r\n this.companyDate = init.companyDate;\r\n this.datePattern = init.datePattern;\r\n }\r\n\r\n getStartOfWeekConfig(): number {\r\n return this.startOfWeekConfig;\r\n }\r\n\r\n getCompanyDate(): string {\r\n return this.companyDate;\r\n }\r\n\r\n getDatePattern(): string {\r\n return this.datePattern;\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport Glide from \"@glidejs/glide\";\r\n\r\n@ModuleName(\"RentalShopDetails\")\r\nexport class RentalShopDetails implements AxInit {\r\n AxInit(init): void {\r\n\r\n const glide = new Glide('#rental__shopDetails-glider', {\r\n type: 'slider',\r\n perView: 1,\r\n rewind: true,\r\n bound: true,\r\n animationDuration: 300,\r\n classes: {\r\n activeSlide: 'glide__slide--active',\r\n disabledArrow: 'glide__arrow--disabled'\r\n },\r\n gap: 0\r\n });\r\n\r\n glide.mount();\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../../Lib/AxSystem/AxInit\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { AxLoading } from \"../../../Limestone/AxLoading/AxLoading\";\r\nimport MobileDetect from \"mobile-detect\";\r\nimport { RequestHelper } from \"../../../Lib/Helper/RequestHelper\";\r\nimport * as components from \"./RiderDetailsCompBundle\";\r\nimport * as models from \"./RiderDetailsModelBundle\";\r\nimport { LoadingSpinnerPositionEnum } from \"../../../Lib/Enums/LoadingSpinnerPositionEnum\";\r\nimport { ProductAndRiderDetailsService } from \"../Services/ProductAndRiderDetailsService\";\r\n\r\nexport interface IRentalRiderDetailsInit {\r\n model: models.ProductAndRiderDetails[];\r\n}\r\n\r\n\r\n@ModuleName(\"RiderDetailsModule\")\r\nexport class RiderDetailsModule implements AxInit {\r\n private axLoading: AxLoading;\r\n private mobileDetect: MobileDetect;\r\n\r\n private addToCartBtn: HTMLButtonElement;\r\n\r\n private activeProductPortlet: components.ProductInfoPortlet;\r\n private productInfoPortlets: components.ProductInfoPortlet[] = [];\r\n private riderSelection: components.RiderSelection;\r\n private lockerDataComp: components.LockerData;\r\n private personDataForm: components.PersonDataForm;\r\n private rentalPropertiesSelection: components.RentalPropertiesSelection;\r\n\r\n AxInit(init: IRentalRiderDetailsInit): void {\r\n this.axLoading = new AxLoading();\r\n this.mobileDetect = new MobileDetect(window.navigator.userAgent);\r\n\r\n this.riderSelection = new components.RiderSelection();\r\n this.initProductPortletComponents(init.model);\r\n\r\n if (!this.mobileDetect.mobile()) {\r\n this.selectFirstPortlet();\r\n }\r\n\r\n this.initAddToCartBtn();\r\n }\r\n\r\n getAllProductInfoPortlets(): components.ProductInfoPortlet[] {\r\n return this.productInfoPortlets;\r\n }\r\n\r\n changeActiveProductPortlet(activatedProductPortlet: components.ProductInfoPortlet) {\r\n if (this.activeProductPortlet != undefined) {\r\n this.activeProductPortlet.checkFormValidityAndSetStates();\r\n this.activeProductPortlet.setPortletInActive();\r\n }\r\n\r\n if (this.mobileDetect.mobile()) {\r\n this.riderSelection.showMobilePersonSelection();\r\n }\r\n\r\n this.activeProductPortlet = activatedProductPortlet;\r\n this.loadLockerPartial(activatedProductPortlet.getProductAndRiderDetails());\r\n this.loadRentalPropertiesSelection(activatedProductPortlet);\r\n this.updateLabelsAndPersonDataArea();\r\n }\r\n\r\n loadRentalPropertiesSelection(productPortlet: components.ProductInfoPortlet) {\r\n const holder = document.getElementsByClassName('rental_detail_rider__right_container-rental-properties')[0];\r\n holder.innerHTML = '';\r\n\r\n const prodAndRiderDetails = productPortlet.getProductAndRiderDetails();\r\n this.rentalPropertiesSelection = new components.RentalPropertiesSelection(prodAndRiderDetails);\r\n }\r\n\r\n loadAccountData(accountId: number) {\r\n const url = \"/RentalRiderDetails/GetCustomerAccountRentalData\";\r\n\r\n this.setAccountIdToProduct(accountId);\r\n\r\n const proAndRiderDetails = this.activeProductPortlet.getProductAndRiderDetails();\r\n\r\n const data = {\r\n addToCartFormModel: proAndRiderDetails\r\n }\r\n\r\n if (!this.mobileDetect.mobile()) {\r\n this.axLoading.ShowLoadingIndicatorGreyBackGround($('.rental_detail_rider__right_container-data-area')[0], LoadingSpinnerPositionEnum.Top);\r\n } else {\r\n this.axLoading.ShowLoadingIndicator($('.rental_detail_rider__right_container-data-area')[0], false, LoadingSpinnerPositionEnum.Top);\r\n }\r\n\r\n AxessViewer.loadPartialView(url, data, (res) => {\r\n const success: boolean = res.success;\r\n\r\n if (!success) {\r\n\r\n if (res.ageCheckFailed) {\r\n this.setAgeCheckFailedStatus(res.errorMsg);\r\n this.axLoading.HideLoadingIndicator($('.rental_detail_rider__right_container-data-area')[0]);\r\n return;\r\n }\r\n\r\n const requestHelper = new RequestHelper();\r\n requestHelper.postToUrl(`/${cultureInfo}/Rental/LandingPage`, {}, {});\r\n }\r\n\r\n $('.rental_detail_rider__right_container-person-data').html(res.returnView);\r\n\r\n if (this.lockerIncluded()) {\r\n this.lockerDataComp.setLockerData(proAndRiderDetails);\r\n }\r\n\r\n this.setValuesFromResultToProductAndRiderDetails(res);\r\n\r\n this.personDataForm = new components.PersonDataForm(res.customerRentalData.unitSystem);\r\n this.personDataForm.initInputsAsync(this.activeProductPortlet.getProductAndRiderDetails())\r\n .then(x => {\r\n this.activeProductPortlet.updatePersonInfoTexts();\r\n this.riderSelection.setSelectedPersonDataTexts(res.customerRentalData.dateOfBirth, res.customerRentalData.customerEmail);\r\n\r\n this.activeProductPortlet.checkFormValidityAndSetStates();\r\n\r\n this.axLoading.HideLoadingIndicator($('.rental_detail_rider__right_container-data-area')[0]);\r\n this.riderSelection.hideAlertBanner();\r\n });\r\n }, {});\r\n }\r\n\r\n getLockerDataComponent(): components.LockerData {\r\n return this.lockerDataComp;\r\n }\r\n\r\n getPersonRentalDataForm(): components.PersonDataForm {\r\n return this.personDataForm;\r\n }\r\n\r\n getActiveProductPortlet(): components.ProductInfoPortlet {\r\n return this.activeProductPortlet;\r\n }\r\n\r\n lockerIncluded(): boolean {\r\n return $('.rental_customer_details-lockerWtp').length > 0;\r\n }\r\n\r\n private initProductPortletComponents(productAndRiderDetailsList: models.ProductAndRiderDetails[]) {\r\n const allPortlets = document.querySelectorAll(\".rental_details_rider__product_portlet\");\r\n\r\n for (let i = 0; i < allPortlets.length; i++) {\r\n const productPosition = allPortlets[i].getAttribute('rider-details-productPosition');\r\n const productAndRiderDetails = productAndRiderDetailsList.find(x => x.productPositionId === productPosition);\r\n const newPortlet = new components.ProductInfoPortlet(allPortlets[i] as HTMLDivElement, productAndRiderDetails);\r\n this.productInfoPortlets.push(newPortlet);\r\n }\r\n }\r\n\r\n private selectFirstPortlet() {\r\n this.productInfoPortlets[0].activatePortlet();\r\n }\r\n\r\n private initAddToCartBtn() {\r\n this.addToCartBtn = document.getElementsByClassName('rental_detail_rider__btn-add_to_cart')[0] as HTMLButtonElement;\r\n\r\n this.addToCartBtn.addEventListener(\"click\",\r\n x => {\r\n this.getActiveProductPortlet().checkFormValidityAndSetStates().then(valid => {\r\n if (!valid) {\r\n return;\r\n }\r\n\r\n const everyThingSet = this.checkIfAllProductsHavePerson();\r\n if (everyThingSet) {\r\n this.addToCart();\r\n return;\r\n }\r\n\r\n let portlet = this.getActiveProductPortlet();\r\n\r\n if (portlet) {\r\n const index = this.productInfoPortlets.indexOf(portlet);\r\n if (index < this.productInfoPortlets.length - 1) {\r\n this.productInfoPortlets[index + 1].activatePortlet();\r\n return;\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n private checkIfAllProductsHavePerson(): boolean {\r\n let everyThingSet = true;\r\n\r\n for (let i = 0; i < this.productInfoPortlets.length; i++) {\r\n if (this.productInfoPortlets[i].getProductAndRiderDetails()?.riderData?.customerAccountId === undefined) {\r\n everyThingSet = false;\r\n }\r\n }\r\n\r\n return everyThingSet;\r\n }\r\n\r\n private addToCart() {\r\n const url = \"/RentalRiderDetails/AddRentalsToCart\";\r\n\r\n this.axLoading.ShowLoadingIndicatorFixed($('.ax-content')[0]);\r\n\r\n let productAndRiderDetails = ProductAndRiderDetailsService.getInstance()\r\n .getProductAndRiderDetails(this.productInfoPortlets);\r\n\r\n AxessViewer.loadPartialView(url,\r\n {\r\n rentalDetailsProdInfos: productAndRiderDetails\r\n },\r\n (res) => {\r\n AxLoad.LoadModule('AxFireShoppingCartModal',\r\n {\r\n result: res,\r\n continueShoppingPath: 'rental',\r\n btn: '.rental_detail_rider__btn-add_to_cart',\r\n ResetQuantity: null\r\n });\r\n this.axLoading.HideLoadingIndicator($('.ax-content')[0]);\r\n },\r\n {\r\n silent: true,\r\n skipShoppingCartReload: false\r\n });\r\n }\r\n\r\n private updateLabelsAndPersonDataArea() {\r\n const productAndRiderDetails = this.activeProductPortlet.getProductAndRiderDetails();\r\n\r\n if (this.activeProductPortlet != undefined && productAndRiderDetails.customerAccountNr !== 0) {\r\n this.riderSelection.setDataAfterSelect(productAndRiderDetails);\r\n this.loadAccountData(productAndRiderDetails.customerAccountNr);\r\n } else {\r\n $('.rental_detail_rider__right_container-person-data').html(\"\");\r\n this.riderSelection.resetPortlet();\r\n }\r\n }\r\n\r\n private loadLockerPartial(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n // rentalItemType 1 = locker\r\n\r\n if (productAndRiderDetails.rentalItemType !== 1 &&\r\n productAndRiderDetails.includedPackageItems.every(x => x.rentalItemType !== 1)) {\r\n $('.rental_detail_rider__right_container-locker-data').html('');\r\n return;\r\n }\r\n\r\n const url = \"/RentalRiderDetails/GetRiderDetailsLockerPartial\";\r\n\r\n const data = {\r\n\r\n }\r\n\r\n AxessViewer.loadPartialView(url, data, (res) => {\r\n const success: boolean = res.success;\r\n\r\n if (!success) {\r\n return;\r\n }\r\n\r\n $('.rental_detail_rider__right_container-locker-data').html(res.returnView);\r\n\r\n this.lockerDataComp = new components.LockerData();\r\n }, {});\r\n }\r\n\r\n private setAgeCheckFailedStatus(errorMsg: string) {\r\n this.riderSelection.showAlertBanner(errorMsg, 'danger');\r\n\r\n this.riderSelection.resetDrownDown();\r\n\r\n const personDataForm = this.getPersonRentalDataForm();\r\n\r\n if (personDataForm != undefined) {\r\n personDataForm.setEmptyValues(this.activeProductPortlet.getProductAndRiderDetails());\r\n this.riderSelection.resetSelectedPersonDataTexts();\r\n this.activeProductPortlet.updatePersonInfoTexts();\r\n }\r\n\r\n this.activeProductPortlet.setUserNotSelectedState();\r\n\r\n $('.rental_detail_rider__right_container-person-data').html(\"\");\r\n }\r\n\r\n private setAccountIdToProduct(accountId: number) {\r\n const prodDetails = this.activeProductPortlet.getProductAndRiderDetails();\r\n\r\n if (prodDetails.riderData == null || prodDetails.riderData == undefined) {\r\n prodDetails.riderData = new models.RiderData();\r\n }\r\n\r\n prodDetails.riderData.customerAccountId = accountId;\r\n prodDetails.customerAccountNr = accountId;\r\n }\r\n\r\n private setValuesFromResultToProductAndRiderDetails(res: any) {\r\n let productAndRiderDetails = this.activeProductPortlet.getProductAndRiderDetails();\r\n\r\n if (productAndRiderDetails.riderData == null || productAndRiderDetails.riderData == undefined) {\r\n productAndRiderDetails.riderData = new models.RiderData();\r\n }\r\n\r\n productAndRiderDetails.riderData.customerAccountId = res.customerRentalData.customerAccountId;\r\n\r\n productAndRiderDetails.riderData.shoeSizeSystem = res.customerRentalData.shoeSizeSystem;\r\n productAndRiderDetails.riderData.unitSystem = res.customerRentalData.unitSystem;\r\n\r\n productAndRiderDetails.riderData.customerName = res.customerRentalData.customerName;\r\n productAndRiderDetails.riderData.customerEmail = res.customerRentalData.customerEmail;\r\n productAndRiderDetails.riderData.dateOfBirth = res.customerRentalData.dateOfBirth;\r\n\r\n productAndRiderDetails.riderData.weight = res.customerRentalData.weight;\r\n productAndRiderDetails.riderData.height = res.customerRentalData.height;\r\n productAndRiderDetails.riderData.soleLength = res.customerRentalData.soleLength;\r\n productAndRiderDetails.riderData.shoeSize = res.customerRentalData.shoeSize;\r\n productAndRiderDetails.riderData.gender = res.customerRentalData.gender;\r\n productAndRiderDetails.riderData.skillLevel = res.customerRentalData.skillLevel;\r\n\r\n productAndRiderDetails.riderData.phone = res.customerRentalData.phone;\r\n\r\n productAndRiderDetails.riderData.city = res.customerRentalData.city;\r\n productAndRiderDetails.riderData.zipCode = res.customerRentalData.zipCode;\r\n productAndRiderDetails.riderData.country = res.customerRentalData.country;\r\n productAndRiderDetails.riderData.street = res.customerRentalData.street;\r\n //productAndRiderDetails.riderData.houseNumber = res.customerRentalData.houseNumber; // not yet needed\r\n productAndRiderDetails.riderData.state = res.customerRentalData.state;\r\n productAndRiderDetails.riderData.passportId = res.customerRentalData.passportId;\r\n }\r\n}\r\n\r\n", "// packages/alpinejs/src/scheduler.js\nvar flushPending = false;\nvar flushing = false;\nvar queue = [];\nvar lastFlushedIndex = -1;\nfunction scheduler(callback) {\n queueJob(callback);\n}\nfunction queueJob(job) {\n if (!queue.includes(job))\n queue.push(job);\n queueFlush();\n}\nfunction dequeueJob(job) {\n let index = queue.indexOf(job);\n if (index !== -1 && index > lastFlushedIndex)\n queue.splice(index, 1);\n}\nfunction queueFlush() {\n if (!flushing && !flushPending) {\n flushPending = true;\n queueMicrotask(flushJobs);\n }\n}\nfunction flushJobs() {\n flushPending = false;\n flushing = true;\n for (let i = 0; i < queue.length; i++) {\n queue[i]();\n lastFlushedIndex = i;\n }\n queue.length = 0;\n lastFlushedIndex = -1;\n flushing = false;\n}\n\n// packages/alpinejs/src/reactivity.js\nvar reactive;\nvar effect;\nvar release;\nvar raw;\nvar shouldSchedule = true;\nfunction disableEffectScheduling(callback) {\n shouldSchedule = false;\n callback();\n shouldSchedule = true;\n}\nfunction setReactivityEngine(engine) {\n reactive = engine.reactive;\n release = engine.release;\n effect = (callback) => engine.effect(callback, { scheduler: (task) => {\n if (shouldSchedule) {\n scheduler(task);\n } else {\n task();\n }\n } });\n raw = engine.raw;\n}\nfunction overrideEffect(override) {\n effect = override;\n}\nfunction elementBoundEffect(el) {\n let cleanup2 = () => {\n };\n let wrappedEffect = (callback) => {\n let effectReference = effect(callback);\n if (!el._x_effects) {\n el._x_effects = /* @__PURE__ */ new Set();\n el._x_runEffects = () => {\n el._x_effects.forEach((i) => i());\n };\n }\n el._x_effects.add(effectReference);\n cleanup2 = () => {\n if (effectReference === void 0)\n return;\n el._x_effects.delete(effectReference);\n release(effectReference);\n };\n return effectReference;\n };\n return [wrappedEffect, () => {\n cleanup2();\n }];\n}\nfunction watch(getter, callback) {\n let firstTime = true;\n let oldValue;\n let effectReference = effect(() => {\n let value = getter();\n JSON.stringify(value);\n if (!firstTime) {\n queueMicrotask(() => {\n callback(value, oldValue);\n oldValue = value;\n });\n } else {\n oldValue = value;\n }\n firstTime = false;\n });\n return () => release(effectReference);\n}\n\n// packages/alpinejs/src/mutation.js\nvar onAttributeAddeds = [];\nvar onElRemoveds = [];\nvar onElAddeds = [];\nfunction onElAdded(callback) {\n onElAddeds.push(callback);\n}\nfunction onElRemoved(el, callback) {\n if (typeof callback === \"function\") {\n if (!el._x_cleanups)\n el._x_cleanups = [];\n el._x_cleanups.push(callback);\n } else {\n callback = el;\n onElRemoveds.push(callback);\n }\n}\nfunction onAttributesAdded(callback) {\n onAttributeAddeds.push(callback);\n}\nfunction onAttributeRemoved(el, name, callback) {\n if (!el._x_attributeCleanups)\n el._x_attributeCleanups = {};\n if (!el._x_attributeCleanups[name])\n el._x_attributeCleanups[name] = [];\n el._x_attributeCleanups[name].push(callback);\n}\nfunction cleanupAttributes(el, names) {\n if (!el._x_attributeCleanups)\n return;\n Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {\n if (names === void 0 || names.includes(name)) {\n value.forEach((i) => i());\n delete el._x_attributeCleanups[name];\n }\n });\n}\nfunction cleanupElement(el) {\n el._x_effects?.forEach(dequeueJob);\n while (el._x_cleanups?.length)\n el._x_cleanups.pop()();\n}\nvar observer = new MutationObserver(onMutate);\nvar currentlyObserving = false;\nfunction startObservingMutations() {\n observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true });\n currentlyObserving = true;\n}\nfunction stopObservingMutations() {\n flushObserver();\n observer.disconnect();\n currentlyObserving = false;\n}\nvar queuedMutations = [];\nfunction flushObserver() {\n let records = observer.takeRecords();\n queuedMutations.push(() => records.length > 0 && onMutate(records));\n let queueLengthWhenTriggered = queuedMutations.length;\n queueMicrotask(() => {\n if (queuedMutations.length === queueLengthWhenTriggered) {\n while (queuedMutations.length > 0)\n queuedMutations.shift()();\n }\n });\n}\nfunction mutateDom(callback) {\n if (!currentlyObserving)\n return callback();\n stopObservingMutations();\n let result = callback();\n startObservingMutations();\n return result;\n}\nvar isCollecting = false;\nvar deferredMutations = [];\nfunction deferMutations() {\n isCollecting = true;\n}\nfunction flushAndStopDeferringMutations() {\n isCollecting = false;\n onMutate(deferredMutations);\n deferredMutations = [];\n}\nfunction onMutate(mutations) {\n if (isCollecting) {\n deferredMutations = deferredMutations.concat(mutations);\n return;\n }\n let addedNodes = [];\n let removedNodes = /* @__PURE__ */ new Set();\n let addedAttributes = /* @__PURE__ */ new Map();\n let removedAttributes = /* @__PURE__ */ new Map();\n for (let i = 0; i < mutations.length; i++) {\n if (mutations[i].target._x_ignoreMutationObserver)\n continue;\n if (mutations[i].type === \"childList\") {\n mutations[i].removedNodes.forEach((node) => {\n if (node.nodeType !== 1)\n return;\n if (!node._x_marker)\n return;\n removedNodes.add(node);\n });\n mutations[i].addedNodes.forEach((node) => {\n if (node.nodeType !== 1)\n return;\n if (removedNodes.has(node)) {\n removedNodes.delete(node);\n return;\n }\n if (node._x_marker)\n return;\n addedNodes.push(node);\n });\n }\n if (mutations[i].type === \"attributes\") {\n let el = mutations[i].target;\n let name = mutations[i].attributeName;\n let oldValue = mutations[i].oldValue;\n let add2 = () => {\n if (!addedAttributes.has(el))\n addedAttributes.set(el, []);\n addedAttributes.get(el).push({ name, value: el.getAttribute(name) });\n };\n let remove = () => {\n if (!removedAttributes.has(el))\n removedAttributes.set(el, []);\n removedAttributes.get(el).push(name);\n };\n if (el.hasAttribute(name) && oldValue === null) {\n add2();\n } else if (el.hasAttribute(name)) {\n remove();\n add2();\n } else {\n remove();\n }\n }\n }\n removedAttributes.forEach((attrs, el) => {\n cleanupAttributes(el, attrs);\n });\n addedAttributes.forEach((attrs, el) => {\n onAttributeAddeds.forEach((i) => i(el, attrs));\n });\n for (let node of removedNodes) {\n if (addedNodes.some((i) => i.contains(node)))\n continue;\n onElRemoveds.forEach((i) => i(node));\n }\n for (let node of addedNodes) {\n if (!node.isConnected)\n continue;\n onElAddeds.forEach((i) => i(node));\n }\n addedNodes = null;\n removedNodes = null;\n addedAttributes = null;\n removedAttributes = null;\n}\n\n// packages/alpinejs/src/scope.js\nfunction scope(node) {\n return mergeProxies(closestDataStack(node));\n}\nfunction addScopeToNode(node, data2, referenceNode) {\n node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];\n return () => {\n node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);\n };\n}\nfunction closestDataStack(node) {\n if (node._x_dataStack)\n return node._x_dataStack;\n if (typeof ShadowRoot === \"function\" && node instanceof ShadowRoot) {\n return closestDataStack(node.host);\n }\n if (!node.parentNode) {\n return [];\n }\n return closestDataStack(node.parentNode);\n}\nfunction mergeProxies(objects) {\n return new Proxy({ objects }, mergeProxyTrap);\n}\nvar mergeProxyTrap = {\n ownKeys({ objects }) {\n return Array.from(\n new Set(objects.flatMap((i) => Object.keys(i)))\n );\n },\n has({ objects }, name) {\n if (name == Symbol.unscopables)\n return false;\n return objects.some(\n (obj) => Object.prototype.hasOwnProperty.call(obj, name) || Reflect.has(obj, name)\n );\n },\n get({ objects }, name, thisProxy) {\n if (name == \"toJSON\")\n return collapseProxies;\n return Reflect.get(\n objects.find(\n (obj) => Reflect.has(obj, name)\n ) || {},\n name,\n thisProxy\n );\n },\n set({ objects }, name, value, thisProxy) {\n const target = objects.find(\n (obj) => Object.prototype.hasOwnProperty.call(obj, name)\n ) || objects[objects.length - 1];\n const descriptor = Object.getOwnPropertyDescriptor(target, name);\n if (descriptor?.set && descriptor?.get)\n return descriptor.set.call(thisProxy, value) || true;\n return Reflect.set(target, name, value);\n }\n};\nfunction collapseProxies() {\n let keys = Reflect.ownKeys(this);\n return keys.reduce((acc, key) => {\n acc[key] = Reflect.get(this, key);\n return acc;\n }, {});\n}\n\n// packages/alpinejs/src/interceptor.js\nfunction initInterceptors(data2) {\n let isObject2 = (val) => typeof val === \"object\" && !Array.isArray(val) && val !== null;\n let recurse = (obj, basePath = \"\") => {\n Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => {\n if (enumerable === false || value === void 0)\n return;\n if (typeof value === \"object\" && value !== null && value.__v_skip)\n return;\n let path = basePath === \"\" ? key : `${basePath}.${key}`;\n if (typeof value === \"object\" && value !== null && value._x_interceptor) {\n obj[key] = value.initialize(data2, path, key);\n } else {\n if (isObject2(value) && value !== obj && !(value instanceof Element)) {\n recurse(value, path);\n }\n }\n });\n };\n return recurse(data2);\n}\nfunction interceptor(callback, mutateObj = () => {\n}) {\n let obj = {\n initialValue: void 0,\n _x_interceptor: true,\n initialize(data2, path, key) {\n return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);\n }\n };\n mutateObj(obj);\n return (initialValue) => {\n if (typeof initialValue === \"object\" && initialValue !== null && initialValue._x_interceptor) {\n let initialize = obj.initialize.bind(obj);\n obj.initialize = (data2, path, key) => {\n let innerValue = initialValue.initialize(data2, path, key);\n obj.initialValue = innerValue;\n return initialize(data2, path, key);\n };\n } else {\n obj.initialValue = initialValue;\n }\n return obj;\n };\n}\nfunction get(obj, path) {\n return path.split(\".\").reduce((carry, segment) => carry[segment], obj);\n}\nfunction set(obj, path, value) {\n if (typeof path === \"string\")\n path = path.split(\".\");\n if (path.length === 1)\n obj[path[0]] = value;\n else if (path.length === 0)\n throw error;\n else {\n if (obj[path[0]])\n return set(obj[path[0]], path.slice(1), value);\n else {\n obj[path[0]] = {};\n return set(obj[path[0]], path.slice(1), value);\n }\n }\n}\n\n// packages/alpinejs/src/magics.js\nvar magics = {};\nfunction magic(name, callback) {\n magics[name] = callback;\n}\nfunction injectMagics(obj, el) {\n let memoizedUtilities = getUtilities(el);\n Object.entries(magics).forEach(([name, callback]) => {\n Object.defineProperty(obj, `$${name}`, {\n get() {\n return callback(el, memoizedUtilities);\n },\n enumerable: false\n });\n });\n return obj;\n}\nfunction getUtilities(el) {\n let [utilities, cleanup2] = getElementBoundUtilities(el);\n let utils = { interceptor, ...utilities };\n onElRemoved(el, cleanup2);\n return utils;\n}\n\n// packages/alpinejs/src/utils/error.js\nfunction tryCatch(el, expression, callback, ...args) {\n try {\n return callback(...args);\n } catch (e) {\n handleError(e, el, expression);\n }\n}\nfunction handleError(error2, el, expression = void 0) {\n error2 = Object.assign(\n error2 ?? { message: \"No error message given.\" },\n { el, expression }\n );\n console.warn(`Alpine Expression Error: ${error2.message}\n\n${expression ? 'Expression: \"' + expression + '\"\\n\\n' : \"\"}`, el);\n setTimeout(() => {\n throw error2;\n }, 0);\n}\n\n// packages/alpinejs/src/evaluator.js\nvar shouldAutoEvaluateFunctions = true;\nfunction dontAutoEvaluateFunctions(callback) {\n let cache = shouldAutoEvaluateFunctions;\n shouldAutoEvaluateFunctions = false;\n let result = callback();\n shouldAutoEvaluateFunctions = cache;\n return result;\n}\nfunction evaluate(el, expression, extras = {}) {\n let result;\n evaluateLater(el, expression)((value) => result = value, extras);\n return result;\n}\nfunction evaluateLater(...args) {\n return theEvaluatorFunction(...args);\n}\nvar theEvaluatorFunction = normalEvaluator;\nfunction setEvaluator(newEvaluator) {\n theEvaluatorFunction = newEvaluator;\n}\nfunction normalEvaluator(el, expression) {\n let overriddenMagics = {};\n injectMagics(overriddenMagics, el);\n let dataStack = [overriddenMagics, ...closestDataStack(el)];\n let evaluator = typeof expression === \"function\" ? generateEvaluatorFromFunction(dataStack, expression) : generateEvaluatorFromString(dataStack, expression, el);\n return tryCatch.bind(null, el, expression, evaluator);\n}\nfunction generateEvaluatorFromFunction(dataStack, func) {\n return (receiver = () => {\n }, { scope: scope2 = {}, params = [] } = {}) => {\n let result = func.apply(mergeProxies([scope2, ...dataStack]), params);\n runIfTypeOfFunction(receiver, result);\n };\n}\nvar evaluatorMemo = {};\nfunction generateFunctionFromString(expression, el) {\n if (evaluatorMemo[expression]) {\n return evaluatorMemo[expression];\n }\n let AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor;\n let rightSideSafeExpression = /^[\\n\\s]*if.*\\(.*\\)/.test(expression.trim()) || /^(let|const)\\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression;\n const safeAsyncFunction = () => {\n try {\n let func2 = new AsyncFunction(\n [\"__self\", \"scope\"],\n `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`\n );\n Object.defineProperty(func2, \"name\", {\n value: `[Alpine] ${expression}`\n });\n return func2;\n } catch (error2) {\n handleError(error2, el, expression);\n return Promise.resolve();\n }\n };\n let func = safeAsyncFunction();\n evaluatorMemo[expression] = func;\n return func;\n}\nfunction generateEvaluatorFromString(dataStack, expression, el) {\n let func = generateFunctionFromString(expression, el);\n return (receiver = () => {\n }, { scope: scope2 = {}, params = [] } = {}) => {\n func.result = void 0;\n func.finished = false;\n let completeScope = mergeProxies([scope2, ...dataStack]);\n if (typeof func === \"function\") {\n let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression));\n if (func.finished) {\n runIfTypeOfFunction(receiver, func.result, completeScope, params, el);\n func.result = void 0;\n } else {\n promise.then((result) => {\n runIfTypeOfFunction(receiver, result, completeScope, params, el);\n }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0);\n }\n }\n };\n}\nfunction runIfTypeOfFunction(receiver, value, scope2, params, el) {\n if (shouldAutoEvaluateFunctions && typeof value === \"function\") {\n let result = value.apply(scope2, params);\n if (result instanceof Promise) {\n result.then((i) => runIfTypeOfFunction(receiver, i, scope2, params)).catch((error2) => handleError(error2, el, value));\n } else {\n receiver(result);\n }\n } else if (typeof value === \"object\" && value instanceof Promise) {\n value.then((i) => receiver(i));\n } else {\n receiver(value);\n }\n}\n\n// packages/alpinejs/src/directives.js\nvar prefixAsString = \"x-\";\nfunction prefix(subject = \"\") {\n return prefixAsString + subject;\n}\nfunction setPrefix(newPrefix) {\n prefixAsString = newPrefix;\n}\nvar directiveHandlers = {};\nfunction directive(name, callback) {\n directiveHandlers[name] = callback;\n return {\n before(directive2) {\n if (!directiveHandlers[directive2]) {\n console.warn(String.raw`Cannot find directive \\`${directive2}\\`. \\`${name}\\` will use the default order of execution`);\n return;\n }\n const pos = directiveOrder.indexOf(directive2);\n directiveOrder.splice(pos >= 0 ? pos : directiveOrder.indexOf(\"DEFAULT\"), 0, name);\n }\n };\n}\nfunction directiveExists(name) {\n return Object.keys(directiveHandlers).includes(name);\n}\nfunction directives(el, attributes, originalAttributeOverride) {\n attributes = Array.from(attributes);\n if (el._x_virtualDirectives) {\n let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value }));\n let staticAttributes = attributesOnly(vAttributes);\n vAttributes = vAttributes.map((attribute) => {\n if (staticAttributes.find((attr) => attr.name === attribute.name)) {\n return {\n name: `x-bind:${attribute.name}`,\n value: `\"${attribute.value}\"`\n };\n }\n return attribute;\n });\n attributes = attributes.concat(vAttributes);\n }\n let transformedAttributeMap = {};\n let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);\n return directives2.map((directive2) => {\n return getDirectiveHandler(el, directive2);\n });\n}\nfunction attributesOnly(attributes) {\n return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));\n}\nvar isDeferringHandlers = false;\nvar directiveHandlerStacks = /* @__PURE__ */ new Map();\nvar currentHandlerStackKey = Symbol();\nfunction deferHandlingDirectives(callback) {\n isDeferringHandlers = true;\n let key = Symbol();\n currentHandlerStackKey = key;\n directiveHandlerStacks.set(key, []);\n let flushHandlers = () => {\n while (directiveHandlerStacks.get(key).length)\n directiveHandlerStacks.get(key).shift()();\n directiveHandlerStacks.delete(key);\n };\n let stopDeferring = () => {\n isDeferringHandlers = false;\n flushHandlers();\n };\n callback(flushHandlers);\n stopDeferring();\n}\nfunction getElementBoundUtilities(el) {\n let cleanups = [];\n let cleanup2 = (callback) => cleanups.push(callback);\n let [effect3, cleanupEffect] = elementBoundEffect(el);\n cleanups.push(cleanupEffect);\n let utilities = {\n Alpine: alpine_default,\n effect: effect3,\n cleanup: cleanup2,\n evaluateLater: evaluateLater.bind(evaluateLater, el),\n evaluate: evaluate.bind(evaluate, el)\n };\n let doCleanup = () => cleanups.forEach((i) => i());\n return [utilities, doCleanup];\n}\nfunction getDirectiveHandler(el, directive2) {\n let noop = () => {\n };\n let handler4 = directiveHandlers[directive2.type] || noop;\n let [utilities, cleanup2] = getElementBoundUtilities(el);\n onAttributeRemoved(el, directive2.original, cleanup2);\n let fullHandler = () => {\n if (el._x_ignore || el._x_ignoreSelf)\n return;\n handler4.inline && handler4.inline(el, directive2, utilities);\n handler4 = handler4.bind(handler4, el, directive2, utilities);\n isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4();\n };\n fullHandler.runCleanups = cleanup2;\n return fullHandler;\n}\nvar startingWith = (subject, replacement) => ({ name, value }) => {\n if (name.startsWith(subject))\n name = name.replace(subject, replacement);\n return { name, value };\n};\nvar into = (i) => i;\nfunction toTransformedAttributes(callback = () => {\n}) {\n return ({ name, value }) => {\n let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => {\n return transform(carry);\n }, { name, value });\n if (newName !== name)\n callback(newName, name);\n return { name: newName, value: newValue };\n };\n}\nvar attributeTransformers = [];\nfunction mapAttributes(callback) {\n attributeTransformers.push(callback);\n}\nfunction outNonAlpineAttributes({ name }) {\n return alpineAttributeRegex().test(name);\n}\nvar alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\\\b`);\nfunction toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {\n return ({ name, value }) => {\n let typeMatch = name.match(alpineAttributeRegex());\n let valueMatch = name.match(/:([a-zA-Z0-9\\-_:]+)/);\n let modifiers = name.match(/\\.[^.\\]]+(?=[^\\]]*$)/g) || [];\n let original = originalAttributeOverride || transformedAttributeMap[name] || name;\n return {\n type: typeMatch ? typeMatch[1] : null,\n value: valueMatch ? valueMatch[1] : null,\n modifiers: modifiers.map((i) => i.replace(\".\", \"\")),\n expression: value,\n original\n };\n };\n}\nvar DEFAULT = \"DEFAULT\";\nvar directiveOrder = [\n \"ignore\",\n \"ref\",\n \"data\",\n \"id\",\n \"anchor\",\n \"bind\",\n \"init\",\n \"for\",\n \"model\",\n \"modelable\",\n \"transition\",\n \"show\",\n \"if\",\n DEFAULT,\n \"teleport\"\n];\nfunction byPriority(a, b) {\n let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;\n let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;\n return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);\n}\n\n// packages/alpinejs/src/utils/dispatch.js\nfunction dispatch(el, name, detail = {}) {\n el.dispatchEvent(\n new CustomEvent(name, {\n detail,\n bubbles: true,\n // Allows events to pass the shadow DOM barrier.\n composed: true,\n cancelable: true\n })\n );\n}\n\n// packages/alpinejs/src/utils/walk.js\nfunction walk(el, callback) {\n if (typeof ShadowRoot === \"function\" && el instanceof ShadowRoot) {\n Array.from(el.children).forEach((el2) => walk(el2, callback));\n return;\n }\n let skip = false;\n callback(el, () => skip = true);\n if (skip)\n return;\n let node = el.firstElementChild;\n while (node) {\n walk(node, callback, false);\n node = node.nextElementSibling;\n }\n}\n\n// packages/alpinejs/src/utils/warn.js\nfunction warn(message, ...args) {\n console.warn(`Alpine Warning: ${message}`, ...args);\n}\n\n// packages/alpinejs/src/lifecycle.js\nvar started = false;\nfunction start() {\n if (started)\n warn(\"Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.\");\n started = true;\n if (!document.body)\n warn(\"Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?\");\n dispatch(document, \"alpine:init\");\n dispatch(document, \"alpine:initializing\");\n startObservingMutations();\n onElAdded((el) => initTree(el, walk));\n onElRemoved((el) => destroyTree(el));\n onAttributesAdded((el, attrs) => {\n directives(el, attrs).forEach((handle) => handle());\n });\n let outNestedComponents = (el) => !closestRoot(el.parentElement, true);\n Array.from(document.querySelectorAll(allSelectors().join(\",\"))).filter(outNestedComponents).forEach((el) => {\n initTree(el);\n });\n dispatch(document, \"alpine:initialized\");\n setTimeout(() => {\n warnAboutMissingPlugins();\n });\n}\nvar rootSelectorCallbacks = [];\nvar initSelectorCallbacks = [];\nfunction rootSelectors() {\n return rootSelectorCallbacks.map((fn) => fn());\n}\nfunction allSelectors() {\n return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());\n}\nfunction addRootSelector(selectorCallback) {\n rootSelectorCallbacks.push(selectorCallback);\n}\nfunction addInitSelector(selectorCallback) {\n initSelectorCallbacks.push(selectorCallback);\n}\nfunction closestRoot(el, includeInitSelectors = false) {\n return findClosest(el, (element) => {\n const selectors = includeInitSelectors ? allSelectors() : rootSelectors();\n if (selectors.some((selector) => element.matches(selector)))\n return true;\n });\n}\nfunction findClosest(el, callback) {\n if (!el)\n return;\n if (callback(el))\n return el;\n if (el._x_teleportBack)\n el = el._x_teleportBack;\n if (!el.parentElement)\n return;\n return findClosest(el.parentElement, callback);\n}\nfunction isRoot(el) {\n return rootSelectors().some((selector) => el.matches(selector));\n}\nvar initInterceptors2 = [];\nfunction interceptInit(callback) {\n initInterceptors2.push(callback);\n}\nvar markerDispenser = 1;\nfunction initTree(el, walker = walk, intercept = () => {\n}) {\n if (findClosest(el, (i) => i._x_ignore))\n return;\n deferHandlingDirectives(() => {\n walker(el, (el2, skip) => {\n if (el2._x_marker)\n return;\n intercept(el2, skip);\n initInterceptors2.forEach((i) => i(el2, skip));\n directives(el2, el2.attributes).forEach((handle) => handle());\n if (!el2._x_ignore)\n el2._x_marker = markerDispenser++;\n el2._x_ignore && skip();\n });\n });\n}\nfunction destroyTree(root, walker = walk) {\n walker(root, (el) => {\n cleanupElement(el);\n cleanupAttributes(el);\n delete el._x_marker;\n });\n}\nfunction warnAboutMissingPlugins() {\n let pluginDirectives = [\n [\"ui\", \"dialog\", [\"[x-dialog], [x-popover]\"]],\n [\"anchor\", \"anchor\", [\"[x-anchor]\"]],\n [\"sort\", \"sort\", [\"[x-sort]\"]]\n ];\n pluginDirectives.forEach(([plugin2, directive2, selectors]) => {\n if (directiveExists(directive2))\n return;\n selectors.some((selector) => {\n if (document.querySelector(selector)) {\n warn(`found \"${selector}\", but missing ${plugin2} plugin`);\n return true;\n }\n });\n });\n}\n\n// packages/alpinejs/src/nextTick.js\nvar tickStack = [];\nvar isHolding = false;\nfunction nextTick(callback = () => {\n}) {\n queueMicrotask(() => {\n isHolding || setTimeout(() => {\n releaseNextTicks();\n });\n });\n return new Promise((res) => {\n tickStack.push(() => {\n callback();\n res();\n });\n });\n}\nfunction releaseNextTicks() {\n isHolding = false;\n while (tickStack.length)\n tickStack.shift()();\n}\nfunction holdNextTicks() {\n isHolding = true;\n}\n\n// packages/alpinejs/src/utils/classes.js\nfunction setClasses(el, value) {\n if (Array.isArray(value)) {\n return setClassesFromString(el, value.join(\" \"));\n } else if (typeof value === \"object\" && value !== null) {\n return setClassesFromObject(el, value);\n } else if (typeof value === \"function\") {\n return setClasses(el, value());\n }\n return setClassesFromString(el, value);\n}\nfunction setClassesFromString(el, classString) {\n let split = (classString2) => classString2.split(\" \").filter(Boolean);\n let missingClasses = (classString2) => classString2.split(\" \").filter((i) => !el.classList.contains(i)).filter(Boolean);\n let addClassesAndReturnUndo = (classes) => {\n el.classList.add(...classes);\n return () => {\n el.classList.remove(...classes);\n };\n };\n classString = classString === true ? classString = \"\" : classString || \"\";\n return addClassesAndReturnUndo(missingClasses(classString));\n}\nfunction setClassesFromObject(el, classObject) {\n let split = (classString) => classString.split(\" \").filter(Boolean);\n let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean);\n let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean);\n let added = [];\n let removed = [];\n forRemove.forEach((i) => {\n if (el.classList.contains(i)) {\n el.classList.remove(i);\n removed.push(i);\n }\n });\n forAdd.forEach((i) => {\n if (!el.classList.contains(i)) {\n el.classList.add(i);\n added.push(i);\n }\n });\n return () => {\n removed.forEach((i) => el.classList.add(i));\n added.forEach((i) => el.classList.remove(i));\n };\n}\n\n// packages/alpinejs/src/utils/styles.js\nfunction setStyles(el, value) {\n if (typeof value === \"object\" && value !== null) {\n return setStylesFromObject(el, value);\n }\n return setStylesFromString(el, value);\n}\nfunction setStylesFromObject(el, value) {\n let previousStyles = {};\n Object.entries(value).forEach(([key, value2]) => {\n previousStyles[key] = el.style[key];\n if (!key.startsWith(\"--\")) {\n key = kebabCase(key);\n }\n el.style.setProperty(key, value2);\n });\n setTimeout(() => {\n if (el.style.length === 0) {\n el.removeAttribute(\"style\");\n }\n });\n return () => {\n setStyles(el, previousStyles);\n };\n}\nfunction setStylesFromString(el, value) {\n let cache = el.getAttribute(\"style\", value);\n el.setAttribute(\"style\", value);\n return () => {\n el.setAttribute(\"style\", cache || \"\");\n };\n}\nfunction kebabCase(subject) {\n return subject.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n}\n\n// packages/alpinejs/src/utils/once.js\nfunction once(callback, fallback = () => {\n}) {\n let called = false;\n return function() {\n if (!called) {\n called = true;\n callback.apply(this, arguments);\n } else {\n fallback.apply(this, arguments);\n }\n };\n}\n\n// packages/alpinejs/src/directives/x-transition.js\ndirective(\"transition\", (el, { value, modifiers, expression }, { evaluate: evaluate2 }) => {\n if (typeof expression === \"function\")\n expression = evaluate2(expression);\n if (expression === false)\n return;\n if (!expression || typeof expression === \"boolean\") {\n registerTransitionsFromHelper(el, modifiers, value);\n } else {\n registerTransitionsFromClassString(el, expression, value);\n }\n});\nfunction registerTransitionsFromClassString(el, classString, stage) {\n registerTransitionObject(el, setClasses, \"\");\n let directiveStorageMap = {\n \"enter\": (classes) => {\n el._x_transition.enter.during = classes;\n },\n \"enter-start\": (classes) => {\n el._x_transition.enter.start = classes;\n },\n \"enter-end\": (classes) => {\n el._x_transition.enter.end = classes;\n },\n \"leave\": (classes) => {\n el._x_transition.leave.during = classes;\n },\n \"leave-start\": (classes) => {\n el._x_transition.leave.start = classes;\n },\n \"leave-end\": (classes) => {\n el._x_transition.leave.end = classes;\n }\n };\n directiveStorageMap[stage](classString);\n}\nfunction registerTransitionsFromHelper(el, modifiers, stage) {\n registerTransitionObject(el, setStyles);\n let doesntSpecify = !modifiers.includes(\"in\") && !modifiers.includes(\"out\") && !stage;\n let transitioningIn = doesntSpecify || modifiers.includes(\"in\") || [\"enter\"].includes(stage);\n let transitioningOut = doesntSpecify || modifiers.includes(\"out\") || [\"leave\"].includes(stage);\n if (modifiers.includes(\"in\") && !doesntSpecify) {\n modifiers = modifiers.filter((i, index) => index < modifiers.indexOf(\"out\"));\n }\n if (modifiers.includes(\"out\") && !doesntSpecify) {\n modifiers = modifiers.filter((i, index) => index > modifiers.indexOf(\"out\"));\n }\n let wantsAll = !modifiers.includes(\"opacity\") && !modifiers.includes(\"scale\");\n let wantsOpacity = wantsAll || modifiers.includes(\"opacity\");\n let wantsScale = wantsAll || modifiers.includes(\"scale\");\n let opacityValue = wantsOpacity ? 0 : 1;\n let scaleValue = wantsScale ? modifierValue(modifiers, \"scale\", 95) / 100 : 1;\n let delay = modifierValue(modifiers, \"delay\", 0) / 1e3;\n let origin = modifierValue(modifiers, \"origin\", \"center\");\n let property = \"opacity, transform\";\n let durationIn = modifierValue(modifiers, \"duration\", 150) / 1e3;\n let durationOut = modifierValue(modifiers, \"duration\", 75) / 1e3;\n let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`;\n if (transitioningIn) {\n el._x_transition.enter.during = {\n transformOrigin: origin,\n transitionDelay: `${delay}s`,\n transitionProperty: property,\n transitionDuration: `${durationIn}s`,\n transitionTimingFunction: easing\n };\n el._x_transition.enter.start = {\n opacity: opacityValue,\n transform: `scale(${scaleValue})`\n };\n el._x_transition.enter.end = {\n opacity: 1,\n transform: `scale(1)`\n };\n }\n if (transitioningOut) {\n el._x_transition.leave.during = {\n transformOrigin: origin,\n transitionDelay: `${delay}s`,\n transitionProperty: property,\n transitionDuration: `${durationOut}s`,\n transitionTimingFunction: easing\n };\n el._x_transition.leave.start = {\n opacity: 1,\n transform: `scale(1)`\n };\n el._x_transition.leave.end = {\n opacity: opacityValue,\n transform: `scale(${scaleValue})`\n };\n }\n}\nfunction registerTransitionObject(el, setFunction, defaultValue = {}) {\n if (!el._x_transition)\n el._x_transition = {\n enter: { during: defaultValue, start: defaultValue, end: defaultValue },\n leave: { during: defaultValue, start: defaultValue, end: defaultValue },\n in(before = () => {\n }, after = () => {\n }) {\n transition(el, setFunction, {\n during: this.enter.during,\n start: this.enter.start,\n end: this.enter.end\n }, before, after);\n },\n out(before = () => {\n }, after = () => {\n }) {\n transition(el, setFunction, {\n during: this.leave.during,\n start: this.leave.start,\n end: this.leave.end\n }, before, after);\n }\n };\n}\nwindow.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {\n const nextTick2 = document.visibilityState === \"visible\" ? requestAnimationFrame : setTimeout;\n let clickAwayCompatibleShow = () => nextTick2(show);\n if (value) {\n if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {\n el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow();\n } else {\n el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow();\n }\n return;\n }\n el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => {\n el._x_transition.out(() => {\n }, () => resolve(hide));\n el._x_transitioning && el._x_transitioning.beforeCancel(() => reject({ isFromCancelledTransition: true }));\n }) : Promise.resolve(hide);\n queueMicrotask(() => {\n let closest = closestHide(el);\n if (closest) {\n if (!closest._x_hideChildren)\n closest._x_hideChildren = [];\n closest._x_hideChildren.push(el);\n } else {\n nextTick2(() => {\n let hideAfterChildren = (el2) => {\n let carry = Promise.all([\n el2._x_hidePromise,\n ...(el2._x_hideChildren || []).map(hideAfterChildren)\n ]).then(([i]) => i?.());\n delete el2._x_hidePromise;\n delete el2._x_hideChildren;\n return carry;\n };\n hideAfterChildren(el).catch((e) => {\n if (!e.isFromCancelledTransition)\n throw e;\n });\n });\n }\n });\n};\nfunction closestHide(el) {\n let parent = el.parentNode;\n if (!parent)\n return;\n return parent._x_hidePromise ? parent : closestHide(parent);\n}\nfunction transition(el, setFunction, { during, start: start2, end } = {}, before = () => {\n}, after = () => {\n}) {\n if (el._x_transitioning)\n el._x_transitioning.cancel();\n if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) {\n before();\n after();\n return;\n }\n let undoStart, undoDuring, undoEnd;\n performTransition(el, {\n start() {\n undoStart = setFunction(el, start2);\n },\n during() {\n undoDuring = setFunction(el, during);\n },\n before,\n end() {\n undoStart();\n undoEnd = setFunction(el, end);\n },\n after,\n cleanup() {\n undoDuring();\n undoEnd();\n }\n });\n}\nfunction performTransition(el, stages) {\n let interrupted, reachedBefore, reachedEnd;\n let finish = once(() => {\n mutateDom(() => {\n interrupted = true;\n if (!reachedBefore)\n stages.before();\n if (!reachedEnd) {\n stages.end();\n releaseNextTicks();\n }\n stages.after();\n if (el.isConnected)\n stages.cleanup();\n delete el._x_transitioning;\n });\n });\n el._x_transitioning = {\n beforeCancels: [],\n beforeCancel(callback) {\n this.beforeCancels.push(callback);\n },\n cancel: once(function() {\n while (this.beforeCancels.length) {\n this.beforeCancels.shift()();\n }\n ;\n finish();\n }),\n finish\n };\n mutateDom(() => {\n stages.start();\n stages.during();\n });\n holdNextTicks();\n requestAnimationFrame(() => {\n if (interrupted)\n return;\n let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, \"\").replace(\"s\", \"\")) * 1e3;\n let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, \"\").replace(\"s\", \"\")) * 1e3;\n if (duration === 0)\n duration = Number(getComputedStyle(el).animationDuration.replace(\"s\", \"\")) * 1e3;\n mutateDom(() => {\n stages.before();\n });\n reachedBefore = true;\n requestAnimationFrame(() => {\n if (interrupted)\n return;\n mutateDom(() => {\n stages.end();\n });\n releaseNextTicks();\n setTimeout(el._x_transitioning.finish, duration + delay);\n reachedEnd = true;\n });\n });\n}\nfunction modifierValue(modifiers, key, fallback) {\n if (modifiers.indexOf(key) === -1)\n return fallback;\n const rawValue = modifiers[modifiers.indexOf(key) + 1];\n if (!rawValue)\n return fallback;\n if (key === \"scale\") {\n if (isNaN(rawValue))\n return fallback;\n }\n if (key === \"duration\" || key === \"delay\") {\n let match = rawValue.match(/([0-9]+)ms/);\n if (match)\n return match[1];\n }\n if (key === \"origin\") {\n if ([\"top\", \"right\", \"left\", \"center\", \"bottom\"].includes(modifiers[modifiers.indexOf(key) + 2])) {\n return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(\" \");\n }\n }\n return rawValue;\n}\n\n// packages/alpinejs/src/clone.js\nvar isCloning = false;\nfunction skipDuringClone(callback, fallback = () => {\n}) {\n return (...args) => isCloning ? fallback(...args) : callback(...args);\n}\nfunction onlyDuringClone(callback) {\n return (...args) => isCloning && callback(...args);\n}\nvar interceptors = [];\nfunction interceptClone(callback) {\n interceptors.push(callback);\n}\nfunction cloneNode(from, to) {\n interceptors.forEach((i) => i(from, to));\n isCloning = true;\n dontRegisterReactiveSideEffects(() => {\n initTree(to, (el, callback) => {\n callback(el, () => {\n });\n });\n });\n isCloning = false;\n}\nvar isCloningLegacy = false;\nfunction clone(oldEl, newEl) {\n if (!newEl._x_dataStack)\n newEl._x_dataStack = oldEl._x_dataStack;\n isCloning = true;\n isCloningLegacy = true;\n dontRegisterReactiveSideEffects(() => {\n cloneTree(newEl);\n });\n isCloning = false;\n isCloningLegacy = false;\n}\nfunction cloneTree(el) {\n let hasRunThroughFirstEl = false;\n let shallowWalker = (el2, callback) => {\n walk(el2, (el3, skip) => {\n if (hasRunThroughFirstEl && isRoot(el3))\n return skip();\n hasRunThroughFirstEl = true;\n callback(el3, skip);\n });\n };\n initTree(el, shallowWalker);\n}\nfunction dontRegisterReactiveSideEffects(callback) {\n let cache = effect;\n overrideEffect((callback2, el) => {\n let storedEffect = cache(callback2);\n release(storedEffect);\n return () => {\n };\n });\n callback();\n overrideEffect(cache);\n}\n\n// packages/alpinejs/src/utils/bind.js\nfunction bind(el, name, value, modifiers = []) {\n if (!el._x_bindings)\n el._x_bindings = reactive({});\n el._x_bindings[name] = value;\n name = modifiers.includes(\"camel\") ? camelCase(name) : name;\n switch (name) {\n case \"value\":\n bindInputValue(el, value);\n break;\n case \"style\":\n bindStyles(el, value);\n break;\n case \"class\":\n bindClasses(el, value);\n break;\n case \"selected\":\n case \"checked\":\n bindAttributeAndProperty(el, name, value);\n break;\n default:\n bindAttribute(el, name, value);\n break;\n }\n}\nfunction bindInputValue(el, value) {\n if (isRadio(el)) {\n if (el.attributes.value === void 0) {\n el.value = value;\n }\n if (window.fromModel) {\n if (typeof value === \"boolean\") {\n el.checked = safeParseBoolean(el.value) === value;\n } else {\n el.checked = checkedAttrLooseCompare(el.value, value);\n }\n }\n } else if (isCheckbox(el)) {\n if (Number.isInteger(value)) {\n el.value = value;\n } else if (!Array.isArray(value) && typeof value !== \"boolean\" && ![null, void 0].includes(value)) {\n el.value = String(value);\n } else {\n if (Array.isArray(value)) {\n el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value));\n } else {\n el.checked = !!value;\n }\n }\n } else if (el.tagName === \"SELECT\") {\n updateSelect(el, value);\n } else {\n if (el.value === value)\n return;\n el.value = value === void 0 ? \"\" : value;\n }\n}\nfunction bindClasses(el, value) {\n if (el._x_undoAddedClasses)\n el._x_undoAddedClasses();\n el._x_undoAddedClasses = setClasses(el, value);\n}\nfunction bindStyles(el, value) {\n if (el._x_undoAddedStyles)\n el._x_undoAddedStyles();\n el._x_undoAddedStyles = setStyles(el, value);\n}\nfunction bindAttributeAndProperty(el, name, value) {\n bindAttribute(el, name, value);\n setPropertyIfChanged(el, name, value);\n}\nfunction bindAttribute(el, name, value) {\n if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {\n el.removeAttribute(name);\n } else {\n if (isBooleanAttr(name))\n value = name;\n setIfChanged(el, name, value);\n }\n}\nfunction setIfChanged(el, attrName, value) {\n if (el.getAttribute(attrName) != value) {\n el.setAttribute(attrName, value);\n }\n}\nfunction setPropertyIfChanged(el, propName, value) {\n if (el[propName] !== value) {\n el[propName] = value;\n }\n}\nfunction updateSelect(el, value) {\n const arrayWrappedValue = [].concat(value).map((value2) => {\n return value2 + \"\";\n });\n Array.from(el.options).forEach((option) => {\n option.selected = arrayWrappedValue.includes(option.value);\n });\n}\nfunction camelCase(subject) {\n return subject.toLowerCase().replace(/-(\\w)/g, (match, char) => char.toUpperCase());\n}\nfunction checkedAttrLooseCompare(valueA, valueB) {\n return valueA == valueB;\n}\nfunction safeParseBoolean(rawValue) {\n if ([1, \"1\", \"true\", \"on\", \"yes\", true].includes(rawValue)) {\n return true;\n }\n if ([0, \"0\", \"false\", \"off\", \"no\", false].includes(rawValue)) {\n return false;\n }\n return rawValue ? Boolean(rawValue) : null;\n}\nvar booleanAttributes = /* @__PURE__ */ new Set([\n \"allowfullscreen\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"default\",\n \"defer\",\n \"disabled\",\n \"formnovalidate\",\n \"inert\",\n \"ismap\",\n \"itemscope\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"nomodule\",\n \"novalidate\",\n \"open\",\n \"playsinline\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"selected\",\n \"shadowrootclonable\",\n \"shadowrootdelegatesfocus\",\n \"shadowrootserializable\"\n]);\nfunction isBooleanAttr(attrName) {\n return booleanAttributes.has(attrName);\n}\nfunction attributeShouldntBePreservedIfFalsy(name) {\n return ![\"aria-pressed\", \"aria-checked\", \"aria-expanded\", \"aria-selected\"].includes(name);\n}\nfunction getBinding(el, name, fallback) {\n if (el._x_bindings && el._x_bindings[name] !== void 0)\n return el._x_bindings[name];\n return getAttributeBinding(el, name, fallback);\n}\nfunction extractProp(el, name, fallback, extract = true) {\n if (el._x_bindings && el._x_bindings[name] !== void 0)\n return el._x_bindings[name];\n if (el._x_inlineBindings && el._x_inlineBindings[name] !== void 0) {\n let binding = el._x_inlineBindings[name];\n binding.extract = extract;\n return dontAutoEvaluateFunctions(() => {\n return evaluate(el, binding.expression);\n });\n }\n return getAttributeBinding(el, name, fallback);\n}\nfunction getAttributeBinding(el, name, fallback) {\n let attr = el.getAttribute(name);\n if (attr === null)\n return typeof fallback === \"function\" ? fallback() : fallback;\n if (attr === \"\")\n return true;\n if (isBooleanAttr(name)) {\n return !![name, \"true\"].includes(attr);\n }\n return attr;\n}\nfunction isCheckbox(el) {\n return el.type === \"checkbox\" || el.localName === \"ui-checkbox\" || el.localName === \"ui-switch\";\n}\nfunction isRadio(el) {\n return el.type === \"radio\" || el.localName === \"ui-radio\";\n}\n\n// packages/alpinejs/src/utils/debounce.js\nfunction debounce(func, wait) {\n var timeout;\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n func.apply(context, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n}\n\n// packages/alpinejs/src/utils/throttle.js\nfunction throttle(func, limit) {\n let inThrottle;\n return function() {\n let context = this, args = arguments;\n if (!inThrottle) {\n func.apply(context, args);\n inThrottle = true;\n setTimeout(() => inThrottle = false, limit);\n }\n };\n}\n\n// packages/alpinejs/src/entangle.js\nfunction entangle({ get: outerGet, set: outerSet }, { get: innerGet, set: innerSet }) {\n let firstRun = true;\n let outerHash;\n let innerHash;\n let reference = effect(() => {\n let outer = outerGet();\n let inner = innerGet();\n if (firstRun) {\n innerSet(cloneIfObject(outer));\n firstRun = false;\n } else {\n let outerHashLatest = JSON.stringify(outer);\n let innerHashLatest = JSON.stringify(inner);\n if (outerHashLatest !== outerHash) {\n innerSet(cloneIfObject(outer));\n } else if (outerHashLatest !== innerHashLatest) {\n outerSet(cloneIfObject(inner));\n } else {\n }\n }\n outerHash = JSON.stringify(outerGet());\n innerHash = JSON.stringify(innerGet());\n });\n return () => {\n release(reference);\n };\n}\nfunction cloneIfObject(value) {\n return typeof value === \"object\" ? JSON.parse(JSON.stringify(value)) : value;\n}\n\n// packages/alpinejs/src/plugin.js\nfunction plugin(callback) {\n let callbacks = Array.isArray(callback) ? callback : [callback];\n callbacks.forEach((i) => i(alpine_default));\n}\n\n// packages/alpinejs/src/store.js\nvar stores = {};\nvar isReactive = false;\nfunction store(name, value) {\n if (!isReactive) {\n stores = reactive(stores);\n isReactive = true;\n }\n if (value === void 0) {\n return stores[name];\n }\n stores[name] = value;\n initInterceptors(stores[name]);\n if (typeof value === \"object\" && value !== null && value.hasOwnProperty(\"init\") && typeof value.init === \"function\") {\n stores[name].init();\n }\n}\nfunction getStores() {\n return stores;\n}\n\n// packages/alpinejs/src/binds.js\nvar binds = {};\nfunction bind2(name, bindings) {\n let getBindings = typeof bindings !== \"function\" ? () => bindings : bindings;\n if (name instanceof Element) {\n return applyBindingsObject(name, getBindings());\n } else {\n binds[name] = getBindings;\n }\n return () => {\n };\n}\nfunction injectBindingProviders(obj) {\n Object.entries(binds).forEach(([name, callback]) => {\n Object.defineProperty(obj, name, {\n get() {\n return (...args) => {\n return callback(...args);\n };\n }\n });\n });\n return obj;\n}\nfunction applyBindingsObject(el, obj, original) {\n let cleanupRunners = [];\n while (cleanupRunners.length)\n cleanupRunners.pop()();\n let attributes = Object.entries(obj).map(([name, value]) => ({ name, value }));\n let staticAttributes = attributesOnly(attributes);\n attributes = attributes.map((attribute) => {\n if (staticAttributes.find((attr) => attr.name === attribute.name)) {\n return {\n name: `x-bind:${attribute.name}`,\n value: `\"${attribute.value}\"`\n };\n }\n return attribute;\n });\n directives(el, attributes, original).map((handle) => {\n cleanupRunners.push(handle.runCleanups);\n handle();\n });\n return () => {\n while (cleanupRunners.length)\n cleanupRunners.pop()();\n };\n}\n\n// packages/alpinejs/src/datas.js\nvar datas = {};\nfunction data(name, callback) {\n datas[name] = callback;\n}\nfunction injectDataProviders(obj, context) {\n Object.entries(datas).forEach(([name, callback]) => {\n Object.defineProperty(obj, name, {\n get() {\n return (...args) => {\n return callback.bind(context)(...args);\n };\n },\n enumerable: false\n });\n });\n return obj;\n}\n\n// packages/alpinejs/src/alpine.js\nvar Alpine = {\n get reactive() {\n return reactive;\n },\n get release() {\n return release;\n },\n get effect() {\n return effect;\n },\n get raw() {\n return raw;\n },\n version: \"3.14.8\",\n flushAndStopDeferringMutations,\n dontAutoEvaluateFunctions,\n disableEffectScheduling,\n startObservingMutations,\n stopObservingMutations,\n setReactivityEngine,\n onAttributeRemoved,\n onAttributesAdded,\n closestDataStack,\n skipDuringClone,\n onlyDuringClone,\n addRootSelector,\n addInitSelector,\n interceptClone,\n addScopeToNode,\n deferMutations,\n mapAttributes,\n evaluateLater,\n interceptInit,\n setEvaluator,\n mergeProxies,\n extractProp,\n findClosest,\n onElRemoved,\n closestRoot,\n destroyTree,\n interceptor,\n // INTERNAL: not public API and is subject to change without major release.\n transition,\n // INTERNAL\n setStyles,\n // INTERNAL\n mutateDom,\n directive,\n entangle,\n throttle,\n debounce,\n evaluate,\n initTree,\n nextTick,\n prefixed: prefix,\n prefix: setPrefix,\n plugin,\n magic,\n store,\n start,\n clone,\n // INTERNAL\n cloneNode,\n // INTERNAL\n bound: getBinding,\n $data: scope,\n watch,\n walk,\n data,\n bind: bind2\n};\nvar alpine_default = Alpine;\n\n// node_modules/@vue/shared/dist/shared.esm-bundler.js\nfunction makeMap(str, expectsLowerCase) {\n const map = /* @__PURE__ */ Object.create(null);\n const list = str.split(\",\");\n for (let i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];\n}\nvar specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\nvar isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);\nvar EMPTY_OBJ = true ? Object.freeze({}) : {};\nvar EMPTY_ARR = true ? Object.freeze([]) : [];\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar hasOwn = (val, key) => hasOwnProperty.call(val, key);\nvar isArray = Array.isArray;\nvar isMap = (val) => toTypeString(val) === \"[object Map]\";\nvar isString = (val) => typeof val === \"string\";\nvar isSymbol = (val) => typeof val === \"symbol\";\nvar isObject = (val) => val !== null && typeof val === \"object\";\nvar objectToString = Object.prototype.toString;\nvar toTypeString = (value) => objectToString.call(value);\nvar toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n};\nvar isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\nvar cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n};\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cacheStringFunction((str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\nvar hyphenateRE = /\\B([A-Z])/g;\nvar hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nvar capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\nvar toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);\nvar hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);\n\n// node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js\nvar targetMap = /* @__PURE__ */ new WeakMap();\nvar effectStack = [];\nvar activeEffect;\nvar ITERATE_KEY = Symbol(true ? \"iterate\" : \"\");\nvar MAP_KEY_ITERATE_KEY = Symbol(true ? \"Map key iterate\" : \"\");\nfunction isEffect(fn) {\n return fn && fn._isEffect === true;\n}\nfunction effect2(fn, options = EMPTY_OBJ) {\n if (isEffect(fn)) {\n fn = fn.raw;\n }\n const effect3 = createReactiveEffect(fn, options);\n if (!options.lazy) {\n effect3();\n }\n return effect3;\n}\nfunction stop(effect3) {\n if (effect3.active) {\n cleanup(effect3);\n if (effect3.options.onStop) {\n effect3.options.onStop();\n }\n effect3.active = false;\n }\n}\nvar uid = 0;\nfunction createReactiveEffect(fn, options) {\n const effect3 = function reactiveEffect() {\n if (!effect3.active) {\n return fn();\n }\n if (!effectStack.includes(effect3)) {\n cleanup(effect3);\n try {\n enableTracking();\n effectStack.push(effect3);\n activeEffect = effect3;\n return fn();\n } finally {\n effectStack.pop();\n resetTracking();\n activeEffect = effectStack[effectStack.length - 1];\n }\n }\n };\n effect3.id = uid++;\n effect3.allowRecurse = !!options.allowRecurse;\n effect3._isEffect = true;\n effect3.active = true;\n effect3.raw = fn;\n effect3.deps = [];\n effect3.options = options;\n return effect3;\n}\nfunction cleanup(effect3) {\n const { deps } = effect3;\n if (deps.length) {\n for (let i = 0; i < deps.length; i++) {\n deps[i].delete(effect3);\n }\n deps.length = 0;\n }\n}\nvar shouldTrack = true;\nvar trackStack = [];\nfunction pauseTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = false;\n}\nfunction enableTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = true;\n}\nfunction resetTracking() {\n const last = trackStack.pop();\n shouldTrack = last === void 0 ? true : last;\n}\nfunction track(target, type, key) {\n if (!shouldTrack || activeEffect === void 0) {\n return;\n }\n let depsMap = targetMap.get(target);\n if (!depsMap) {\n targetMap.set(target, depsMap = /* @__PURE__ */ new Map());\n }\n let dep = depsMap.get(key);\n if (!dep) {\n depsMap.set(key, dep = /* @__PURE__ */ new Set());\n }\n if (!dep.has(activeEffect)) {\n dep.add(activeEffect);\n activeEffect.deps.push(dep);\n if (activeEffect.options.onTrack) {\n activeEffect.options.onTrack({\n effect: activeEffect,\n target,\n type,\n key\n });\n }\n }\n}\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\n const depsMap = targetMap.get(target);\n if (!depsMap) {\n return;\n }\n const effects = /* @__PURE__ */ new Set();\n const add2 = (effectsToAdd) => {\n if (effectsToAdd) {\n effectsToAdd.forEach((effect3) => {\n if (effect3 !== activeEffect || effect3.allowRecurse) {\n effects.add(effect3);\n }\n });\n }\n };\n if (type === \"clear\") {\n depsMap.forEach(add2);\n } else if (key === \"length\" && isArray(target)) {\n depsMap.forEach((dep, key2) => {\n if (key2 === \"length\" || key2 >= newValue) {\n add2(dep);\n }\n });\n } else {\n if (key !== void 0) {\n add2(depsMap.get(key));\n }\n switch (type) {\n case \"add\":\n if (!isArray(target)) {\n add2(depsMap.get(ITERATE_KEY));\n if (isMap(target)) {\n add2(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n } else if (isIntegerKey(key)) {\n add2(depsMap.get(\"length\"));\n }\n break;\n case \"delete\":\n if (!isArray(target)) {\n add2(depsMap.get(ITERATE_KEY));\n if (isMap(target)) {\n add2(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n }\n break;\n case \"set\":\n if (isMap(target)) {\n add2(depsMap.get(ITERATE_KEY));\n }\n break;\n }\n }\n const run = (effect3) => {\n if (effect3.options.onTrigger) {\n effect3.options.onTrigger({\n effect: effect3,\n target,\n key,\n type,\n newValue,\n oldValue,\n oldTarget\n });\n }\n if (effect3.options.scheduler) {\n effect3.options.scheduler(effect3);\n } else {\n effect3();\n }\n };\n effects.forEach(run);\n}\nvar isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);\nvar builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));\nvar get2 = /* @__PURE__ */ createGetter();\nvar readonlyGet = /* @__PURE__ */ createGetter(true);\nvar arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();\nfunction createArrayInstrumentations() {\n const instrumentations = {};\n [\"includes\", \"indexOf\", \"lastIndexOf\"].forEach((key) => {\n instrumentations[key] = function(...args) {\n const arr = toRaw(this);\n for (let i = 0, l = this.length; i < l; i++) {\n track(arr, \"get\", i + \"\");\n }\n const res = arr[key](...args);\n if (res === -1 || res === false) {\n return arr[key](...args.map(toRaw));\n } else {\n return res;\n }\n };\n });\n [\"push\", \"pop\", \"shift\", \"unshift\", \"splice\"].forEach((key) => {\n instrumentations[key] = function(...args) {\n pauseTracking();\n const res = toRaw(this)[key].apply(this, args);\n resetTracking();\n return res;\n };\n });\n return instrumentations;\n}\nfunction createGetter(isReadonly = false, shallow = false) {\n return function get3(target, key, receiver) {\n if (key === \"__v_isReactive\") {\n return !isReadonly;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly;\n } else if (key === \"__v_raw\" && receiver === (isReadonly ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {\n return target;\n }\n const targetIsArray = isArray(target);\n if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {\n return Reflect.get(arrayInstrumentations, key, receiver);\n }\n const res = Reflect.get(target, key, receiver);\n if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {\n return res;\n }\n if (!isReadonly) {\n track(target, \"get\", key);\n }\n if (shallow) {\n return res;\n }\n if (isRef(res)) {\n const shouldUnwrap = !targetIsArray || !isIntegerKey(key);\n return shouldUnwrap ? res.value : res;\n }\n if (isObject(res)) {\n return isReadonly ? readonly(res) : reactive2(res);\n }\n return res;\n };\n}\nvar set2 = /* @__PURE__ */ createSetter();\nfunction createSetter(shallow = false) {\n return function set3(target, key, value, receiver) {\n let oldValue = target[key];\n if (!shallow) {\n value = toRaw(value);\n oldValue = toRaw(oldValue);\n if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n return true;\n }\n }\n const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);\n const result = Reflect.set(target, key, value, receiver);\n if (target === toRaw(receiver)) {\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n }\n return result;\n };\n}\nfunction deleteProperty(target, key) {\n const hadKey = hasOwn(target, key);\n const oldValue = target[key];\n const result = Reflect.deleteProperty(target, key);\n if (result && hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n}\nfunction has(target, key) {\n const result = Reflect.has(target, key);\n if (!isSymbol(key) || !builtInSymbols.has(key)) {\n track(target, \"has\", key);\n }\n return result;\n}\nfunction ownKeys(target) {\n track(target, \"iterate\", isArray(target) ? \"length\" : ITERATE_KEY);\n return Reflect.ownKeys(target);\n}\nvar mutableHandlers = {\n get: get2,\n set: set2,\n deleteProperty,\n has,\n ownKeys\n};\nvar readonlyHandlers = {\n get: readonlyGet,\n set(target, key) {\n if (true) {\n console.warn(`Set operation on key \"${String(key)}\" failed: target is readonly.`, target);\n }\n return true;\n },\n deleteProperty(target, key) {\n if (true) {\n console.warn(`Delete operation on key \"${String(key)}\" failed: target is readonly.`, target);\n }\n return true;\n }\n};\nvar toReactive = (value) => isObject(value) ? reactive2(value) : value;\nvar toReadonly = (value) => isObject(value) ? readonly(value) : value;\nvar toShallow = (value) => value;\nvar getProto = (v) => Reflect.getPrototypeOf(v);\nfunction get$1(target, key, isReadonly = false, isShallow = false) {\n target = target[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw(target);\n const rawKey = toRaw(key);\n if (key !== rawKey) {\n !isReadonly && track(rawTarget, \"get\", key);\n }\n !isReadonly && track(rawTarget, \"get\", rawKey);\n const { has: has2 } = getProto(rawTarget);\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n if (has2.call(rawTarget, key)) {\n return wrap(target.get(key));\n } else if (has2.call(rawTarget, rawKey)) {\n return wrap(target.get(rawKey));\n } else if (target !== rawTarget) {\n target.get(key);\n }\n}\nfunction has$1(key, isReadonly = false) {\n const target = this[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw(target);\n const rawKey = toRaw(key);\n if (key !== rawKey) {\n !isReadonly && track(rawTarget, \"has\", key);\n }\n !isReadonly && track(rawTarget, \"has\", rawKey);\n return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);\n}\nfunction size(target, isReadonly = false) {\n target = target[\n \"__v_raw\"\n /* RAW */\n ];\n !isReadonly && track(toRaw(target), \"iterate\", ITERATE_KEY);\n return Reflect.get(target, \"size\", target);\n}\nfunction add(value) {\n value = toRaw(value);\n const target = toRaw(this);\n const proto = getProto(target);\n const hadKey = proto.has.call(target, value);\n if (!hadKey) {\n target.add(value);\n trigger(target, \"add\", value, value);\n }\n return this;\n}\nfunction set$1(key, value) {\n value = toRaw(value);\n const target = toRaw(this);\n const { has: has2, get: get3 } = getProto(target);\n let hadKey = has2.call(target, key);\n if (!hadKey) {\n key = toRaw(key);\n hadKey = has2.call(target, key);\n } else if (true) {\n checkIdentityKeys(target, has2, key);\n }\n const oldValue = get3.call(target, key);\n target.set(key, value);\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n return this;\n}\nfunction deleteEntry(key) {\n const target = toRaw(this);\n const { has: has2, get: get3 } = getProto(target);\n let hadKey = has2.call(target, key);\n if (!hadKey) {\n key = toRaw(key);\n hadKey = has2.call(target, key);\n } else if (true) {\n checkIdentityKeys(target, has2, key);\n }\n const oldValue = get3 ? get3.call(target, key) : void 0;\n const result = target.delete(key);\n if (hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n}\nfunction clear() {\n const target = toRaw(this);\n const hadItems = target.size !== 0;\n const oldTarget = true ? isMap(target) ? new Map(target) : new Set(target) : void 0;\n const result = target.clear();\n if (hadItems) {\n trigger(target, \"clear\", void 0, void 0, oldTarget);\n }\n return result;\n}\nfunction createForEach(isReadonly, isShallow) {\n return function forEach(callback, thisArg) {\n const observed = this;\n const target = observed[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw(target);\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n !isReadonly && track(rawTarget, \"iterate\", ITERATE_KEY);\n return target.forEach((value, key) => {\n return callback.call(thisArg, wrap(value), wrap(key), observed);\n });\n };\n}\nfunction createIterableMethod(method, isReadonly, isShallow) {\n return function(...args) {\n const target = this[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw(target);\n const targetIsMap = isMap(rawTarget);\n const isPair = method === \"entries\" || method === Symbol.iterator && targetIsMap;\n const isKeyOnly = method === \"keys\" && targetIsMap;\n const innerIterator = target[method](...args);\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n !isReadonly && track(rawTarget, \"iterate\", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\n return {\n // iterator protocol\n next() {\n const { value, done } = innerIterator.next();\n return done ? { value, done } : {\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n done\n };\n },\n // iterable protocol\n [Symbol.iterator]() {\n return this;\n }\n };\n };\n}\nfunction createReadonlyMethod(type) {\n return function(...args) {\n if (true) {\n const key = args[0] ? `on key \"${args[0]}\" ` : ``;\n console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));\n }\n return type === \"delete\" ? false : this;\n };\n}\nfunction createInstrumentations() {\n const mutableInstrumentations2 = {\n get(key) {\n return get$1(this, key);\n },\n get size() {\n return size(this);\n },\n has: has$1,\n add,\n set: set$1,\n delete: deleteEntry,\n clear,\n forEach: createForEach(false, false)\n };\n const shallowInstrumentations2 = {\n get(key) {\n return get$1(this, key, false, true);\n },\n get size() {\n return size(this);\n },\n has: has$1,\n add,\n set: set$1,\n delete: deleteEntry,\n clear,\n forEach: createForEach(false, true)\n };\n const readonlyInstrumentations2 = {\n get(key) {\n return get$1(this, key, true);\n },\n get size() {\n return size(this, true);\n },\n has(key) {\n return has$1.call(this, key, true);\n },\n add: createReadonlyMethod(\n \"add\"\n /* ADD */\n ),\n set: createReadonlyMethod(\n \"set\"\n /* SET */\n ),\n delete: createReadonlyMethod(\n \"delete\"\n /* DELETE */\n ),\n clear: createReadonlyMethod(\n \"clear\"\n /* CLEAR */\n ),\n forEach: createForEach(true, false)\n };\n const shallowReadonlyInstrumentations2 = {\n get(key) {\n return get$1(this, key, true, true);\n },\n get size() {\n return size(this, true);\n },\n has(key) {\n return has$1.call(this, key, true);\n },\n add: createReadonlyMethod(\n \"add\"\n /* ADD */\n ),\n set: createReadonlyMethod(\n \"set\"\n /* SET */\n ),\n delete: createReadonlyMethod(\n \"delete\"\n /* DELETE */\n ),\n clear: createReadonlyMethod(\n \"clear\"\n /* CLEAR */\n ),\n forEach: createForEach(true, true)\n };\n const iteratorMethods = [\"keys\", \"values\", \"entries\", Symbol.iterator];\n iteratorMethods.forEach((method) => {\n mutableInstrumentations2[method] = createIterableMethod(method, false, false);\n readonlyInstrumentations2[method] = createIterableMethod(method, true, false);\n shallowInstrumentations2[method] = createIterableMethod(method, false, true);\n shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);\n });\n return [\n mutableInstrumentations2,\n readonlyInstrumentations2,\n shallowInstrumentations2,\n shallowReadonlyInstrumentations2\n ];\n}\nvar [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();\nfunction createInstrumentationGetter(isReadonly, shallow) {\n const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;\n return (target, key, receiver) => {\n if (key === \"__v_isReactive\") {\n return !isReadonly;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly;\n } else if (key === \"__v_raw\") {\n return target;\n }\n return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);\n };\n}\nvar mutableCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, false)\n};\nvar readonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, false)\n};\nfunction checkIdentityKeys(target, has2, key) {\n const rawKey = toRaw(key);\n if (rawKey !== key && has2.call(target, rawKey)) {\n const type = toRawType(target);\n console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);\n }\n}\nvar reactiveMap = /* @__PURE__ */ new WeakMap();\nvar shallowReactiveMap = /* @__PURE__ */ new WeakMap();\nvar readonlyMap = /* @__PURE__ */ new WeakMap();\nvar shallowReadonlyMap = /* @__PURE__ */ new WeakMap();\nfunction targetTypeMap(rawType) {\n switch (rawType) {\n case \"Object\":\n case \"Array\":\n return 1;\n case \"Map\":\n case \"Set\":\n case \"WeakMap\":\n case \"WeakSet\":\n return 2;\n default:\n return 0;\n }\n}\nfunction getTargetType(value) {\n return value[\n \"__v_skip\"\n /* SKIP */\n ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));\n}\nfunction reactive2(target) {\n if (target && target[\n \"__v_isReadonly\"\n /* IS_READONLY */\n ]) {\n return target;\n }\n return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);\n}\nfunction readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}\nfunction createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {\n if (!isObject(target)) {\n if (true) {\n console.warn(`value cannot be made reactive: ${String(target)}`);\n }\n return target;\n }\n if (target[\n \"__v_raw\"\n /* RAW */\n ] && !(isReadonly && target[\n \"__v_isReactive\"\n /* IS_REACTIVE */\n ])) {\n return target;\n }\n const existingProxy = proxyMap.get(target);\n if (existingProxy) {\n return existingProxy;\n }\n const targetType = getTargetType(target);\n if (targetType === 0) {\n return target;\n }\n const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);\n proxyMap.set(target, proxy);\n return proxy;\n}\nfunction toRaw(observed) {\n return observed && toRaw(observed[\n \"__v_raw\"\n /* RAW */\n ]) || observed;\n}\nfunction isRef(r) {\n return Boolean(r && r.__v_isRef === true);\n}\n\n// packages/alpinejs/src/magics/$nextTick.js\nmagic(\"nextTick\", () => nextTick);\n\n// packages/alpinejs/src/magics/$dispatch.js\nmagic(\"dispatch\", (el) => dispatch.bind(dispatch, el));\n\n// packages/alpinejs/src/magics/$watch.js\nmagic(\"watch\", (el, { evaluateLater: evaluateLater2, cleanup: cleanup2 }) => (key, callback) => {\n let evaluate2 = evaluateLater2(key);\n let getter = () => {\n let value;\n evaluate2((i) => value = i);\n return value;\n };\n let unwatch = watch(getter, callback);\n cleanup2(unwatch);\n});\n\n// packages/alpinejs/src/magics/$store.js\nmagic(\"store\", getStores);\n\n// packages/alpinejs/src/magics/$data.js\nmagic(\"data\", (el) => scope(el));\n\n// packages/alpinejs/src/magics/$root.js\nmagic(\"root\", (el) => closestRoot(el));\n\n// packages/alpinejs/src/magics/$refs.js\nmagic(\"refs\", (el) => {\n if (el._x_refs_proxy)\n return el._x_refs_proxy;\n el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el));\n return el._x_refs_proxy;\n});\nfunction getArrayOfRefObject(el) {\n let refObjects = [];\n findClosest(el, (i) => {\n if (i._x_refs)\n refObjects.push(i._x_refs);\n });\n return refObjects;\n}\n\n// packages/alpinejs/src/ids.js\nvar globalIdMemo = {};\nfunction findAndIncrementId(name) {\n if (!globalIdMemo[name])\n globalIdMemo[name] = 0;\n return ++globalIdMemo[name];\n}\nfunction closestIdRoot(el, name) {\n return findClosest(el, (element) => {\n if (element._x_ids && element._x_ids[name])\n return true;\n });\n}\nfunction setIdRoot(el, name) {\n if (!el._x_ids)\n el._x_ids = {};\n if (!el._x_ids[name])\n el._x_ids[name] = findAndIncrementId(name);\n}\n\n// packages/alpinejs/src/magics/$id.js\nmagic(\"id\", (el, { cleanup: cleanup2 }) => (name, key = null) => {\n let cacheKey = `${name}${key ? `-${key}` : \"\"}`;\n return cacheIdByNameOnElement(el, cacheKey, cleanup2, () => {\n let root = closestIdRoot(el, name);\n let id = root ? root._x_ids[name] : findAndIncrementId(name);\n return key ? `${name}-${id}-${key}` : `${name}-${id}`;\n });\n});\ninterceptClone((from, to) => {\n if (from._x_id) {\n to._x_id = from._x_id;\n }\n});\nfunction cacheIdByNameOnElement(el, cacheKey, cleanup2, callback) {\n if (!el._x_id)\n el._x_id = {};\n if (el._x_id[cacheKey])\n return el._x_id[cacheKey];\n let output = callback();\n el._x_id[cacheKey] = output;\n cleanup2(() => {\n delete el._x_id[cacheKey];\n });\n return output;\n}\n\n// packages/alpinejs/src/magics/$el.js\nmagic(\"el\", (el) => el);\n\n// packages/alpinejs/src/magics/index.js\nwarnMissingPluginMagic(\"Focus\", \"focus\", \"focus\");\nwarnMissingPluginMagic(\"Persist\", \"persist\", \"persist\");\nfunction warnMissingPluginMagic(name, magicName, slug) {\n magic(magicName, (el) => warn(`You can't use [$${magicName}] without first installing the \"${name}\" plugin here: https://alpinejs.dev/plugins/${slug}`, el));\n}\n\n// packages/alpinejs/src/directives/x-modelable.js\ndirective(\"modelable\", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2, cleanup: cleanup2 }) => {\n let func = evaluateLater2(expression);\n let innerGet = () => {\n let result;\n func((i) => result = i);\n return result;\n };\n let evaluateInnerSet = evaluateLater2(`${expression} = __placeholder`);\n let innerSet = (val) => evaluateInnerSet(() => {\n }, { scope: { \"__placeholder\": val } });\n let initialValue = innerGet();\n innerSet(initialValue);\n queueMicrotask(() => {\n if (!el._x_model)\n return;\n el._x_removeModelListeners[\"default\"]();\n let outerGet = el._x_model.get;\n let outerSet = el._x_model.set;\n let releaseEntanglement = entangle(\n {\n get() {\n return outerGet();\n },\n set(value) {\n outerSet(value);\n }\n },\n {\n get() {\n return innerGet();\n },\n set(value) {\n innerSet(value);\n }\n }\n );\n cleanup2(releaseEntanglement);\n });\n});\n\n// packages/alpinejs/src/directives/x-teleport.js\ndirective(\"teleport\", (el, { modifiers, expression }, { cleanup: cleanup2 }) => {\n if (el.tagName.toLowerCase() !== \"template\")\n warn(\"x-teleport can only be used on a <template> tag\", el);\n let target = getTarget(expression);\n let clone2 = el.content.cloneNode(true).firstElementChild;\n el._x_teleport = clone2;\n clone2._x_teleportBack = el;\n el.setAttribute(\"data-teleport-template\", true);\n clone2.setAttribute(\"data-teleport-target\", true);\n if (el._x_forwardEvents) {\n el._x_forwardEvents.forEach((eventName) => {\n clone2.addEventListener(eventName, (e) => {\n e.stopPropagation();\n el.dispatchEvent(new e.constructor(e.type, e));\n });\n });\n }\n addScopeToNode(clone2, {}, el);\n let placeInDom = (clone3, target2, modifiers2) => {\n if (modifiers2.includes(\"prepend\")) {\n target2.parentNode.insertBefore(clone3, target2);\n } else if (modifiers2.includes(\"append\")) {\n target2.parentNode.insertBefore(clone3, target2.nextSibling);\n } else {\n target2.appendChild(clone3);\n }\n };\n mutateDom(() => {\n placeInDom(clone2, target, modifiers);\n skipDuringClone(() => {\n initTree(clone2);\n })();\n });\n el._x_teleportPutBack = () => {\n let target2 = getTarget(expression);\n mutateDom(() => {\n placeInDom(el._x_teleport, target2, modifiers);\n });\n };\n cleanup2(\n () => mutateDom(() => {\n clone2.remove();\n destroyTree(clone2);\n })\n );\n});\nvar teleportContainerDuringClone = document.createElement(\"div\");\nfunction getTarget(expression) {\n let target = skipDuringClone(() => {\n return document.querySelector(expression);\n }, () => {\n return teleportContainerDuringClone;\n })();\n if (!target)\n warn(`Cannot find x-teleport element for selector: \"${expression}\"`);\n return target;\n}\n\n// packages/alpinejs/src/directives/x-ignore.js\nvar handler = () => {\n};\nhandler.inline = (el, { modifiers }, { cleanup: cleanup2 }) => {\n modifiers.includes(\"self\") ? el._x_ignoreSelf = true : el._x_ignore = true;\n cleanup2(() => {\n modifiers.includes(\"self\") ? delete el._x_ignoreSelf : delete el._x_ignore;\n });\n};\ndirective(\"ignore\", handler);\n\n// packages/alpinejs/src/directives/x-effect.js\ndirective(\"effect\", skipDuringClone((el, { expression }, { effect: effect3 }) => {\n effect3(evaluateLater(el, expression));\n}));\n\n// packages/alpinejs/src/utils/on.js\nfunction on(el, event, modifiers, callback) {\n let listenerTarget = el;\n let handler4 = (e) => callback(e);\n let options = {};\n let wrapHandler = (callback2, wrapper) => (e) => wrapper(callback2, e);\n if (modifiers.includes(\"dot\"))\n event = dotSyntax(event);\n if (modifiers.includes(\"camel\"))\n event = camelCase2(event);\n if (modifiers.includes(\"passive\"))\n options.passive = true;\n if (modifiers.includes(\"capture\"))\n options.capture = true;\n if (modifiers.includes(\"window\"))\n listenerTarget = window;\n if (modifiers.includes(\"document\"))\n listenerTarget = document;\n if (modifiers.includes(\"debounce\")) {\n let nextModifier = modifiers[modifiers.indexOf(\"debounce\") + 1] || \"invalid-wait\";\n let wait = isNumeric(nextModifier.split(\"ms\")[0]) ? Number(nextModifier.split(\"ms\")[0]) : 250;\n handler4 = debounce(handler4, wait);\n }\n if (modifiers.includes(\"throttle\")) {\n let nextModifier = modifiers[modifiers.indexOf(\"throttle\") + 1] || \"invalid-wait\";\n let wait = isNumeric(nextModifier.split(\"ms\")[0]) ? Number(nextModifier.split(\"ms\")[0]) : 250;\n handler4 = throttle(handler4, wait);\n }\n if (modifiers.includes(\"prevent\"))\n handler4 = wrapHandler(handler4, (next, e) => {\n e.preventDefault();\n next(e);\n });\n if (modifiers.includes(\"stop\"))\n handler4 = wrapHandler(handler4, (next, e) => {\n e.stopPropagation();\n next(e);\n });\n if (modifiers.includes(\"once\")) {\n handler4 = wrapHandler(handler4, (next, e) => {\n next(e);\n listenerTarget.removeEventListener(event, handler4, options);\n });\n }\n if (modifiers.includes(\"away\") || modifiers.includes(\"outside\")) {\n listenerTarget = document;\n handler4 = wrapHandler(handler4, (next, e) => {\n if (el.contains(e.target))\n return;\n if (e.target.isConnected === false)\n return;\n if (el.offsetWidth < 1 && el.offsetHeight < 1)\n return;\n if (el._x_isShown === false)\n return;\n next(e);\n });\n }\n if (modifiers.includes(\"self\"))\n handler4 = wrapHandler(handler4, (next, e) => {\n e.target === el && next(e);\n });\n if (isKeyEvent(event) || isClickEvent(event)) {\n handler4 = wrapHandler(handler4, (next, e) => {\n if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {\n return;\n }\n next(e);\n });\n }\n listenerTarget.addEventListener(event, handler4, options);\n return () => {\n listenerTarget.removeEventListener(event, handler4, options);\n };\n}\nfunction dotSyntax(subject) {\n return subject.replace(/-/g, \".\");\n}\nfunction camelCase2(subject) {\n return subject.toLowerCase().replace(/-(\\w)/g, (match, char) => char.toUpperCase());\n}\nfunction isNumeric(subject) {\n return !Array.isArray(subject) && !isNaN(subject);\n}\nfunction kebabCase2(subject) {\n if ([\" \", \"_\"].includes(\n subject\n ))\n return subject;\n return subject.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[_\\s]/, \"-\").toLowerCase();\n}\nfunction isKeyEvent(event) {\n return [\"keydown\", \"keyup\"].includes(event);\n}\nfunction isClickEvent(event) {\n return [\"contextmenu\", \"click\", \"mouse\"].some((i) => event.includes(i));\n}\nfunction isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {\n let keyModifiers = modifiers.filter((i) => {\n return ![\"window\", \"document\", \"prevent\", \"stop\", \"once\", \"capture\", \"self\", \"away\", \"outside\", \"passive\"].includes(i);\n });\n if (keyModifiers.includes(\"debounce\")) {\n let debounceIndex = keyModifiers.indexOf(\"debounce\");\n keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || \"invalid-wait\").split(\"ms\")[0]) ? 2 : 1);\n }\n if (keyModifiers.includes(\"throttle\")) {\n let debounceIndex = keyModifiers.indexOf(\"throttle\");\n keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || \"invalid-wait\").split(\"ms\")[0]) ? 2 : 1);\n }\n if (keyModifiers.length === 0)\n return false;\n if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0]))\n return false;\n const systemKeyModifiers = [\"ctrl\", \"shift\", \"alt\", \"meta\", \"cmd\", \"super\"];\n const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier));\n keyModifiers = keyModifiers.filter((i) => !selectedSystemKeyModifiers.includes(i));\n if (selectedSystemKeyModifiers.length > 0) {\n const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => {\n if (modifier === \"cmd\" || modifier === \"super\")\n modifier = \"meta\";\n return e[`${modifier}Key`];\n });\n if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {\n if (isClickEvent(e.type))\n return false;\n if (keyToModifiers(e.key).includes(keyModifiers[0]))\n return false;\n }\n }\n return true;\n}\nfunction keyToModifiers(key) {\n if (!key)\n return [];\n key = kebabCase2(key);\n let modifierToKeyMap = {\n \"ctrl\": \"control\",\n \"slash\": \"/\",\n \"space\": \" \",\n \"spacebar\": \" \",\n \"cmd\": \"meta\",\n \"esc\": \"escape\",\n \"up\": \"arrow-up\",\n \"down\": \"arrow-down\",\n \"left\": \"arrow-left\",\n \"right\": \"arrow-right\",\n \"period\": \".\",\n \"comma\": \",\",\n \"equal\": \"=\",\n \"minus\": \"-\",\n \"underscore\": \"_\"\n };\n modifierToKeyMap[key] = key;\n return Object.keys(modifierToKeyMap).map((modifier) => {\n if (modifierToKeyMap[modifier] === key)\n return modifier;\n }).filter((modifier) => modifier);\n}\n\n// packages/alpinejs/src/directives/x-model.js\ndirective(\"model\", (el, { modifiers, expression }, { effect: effect3, cleanup: cleanup2 }) => {\n let scopeTarget = el;\n if (modifiers.includes(\"parent\")) {\n scopeTarget = el.parentNode;\n }\n let evaluateGet = evaluateLater(scopeTarget, expression);\n let evaluateSet;\n if (typeof expression === \"string\") {\n evaluateSet = evaluateLater(scopeTarget, `${expression} = __placeholder`);\n } else if (typeof expression === \"function\" && typeof expression() === \"string\") {\n evaluateSet = evaluateLater(scopeTarget, `${expression()} = __placeholder`);\n } else {\n evaluateSet = () => {\n };\n }\n let getValue = () => {\n let result;\n evaluateGet((value) => result = value);\n return isGetterSetter(result) ? result.get() : result;\n };\n let setValue = (value) => {\n let result;\n evaluateGet((value2) => result = value2);\n if (isGetterSetter(result)) {\n result.set(value);\n } else {\n evaluateSet(() => {\n }, {\n scope: { \"__placeholder\": value }\n });\n }\n };\n if (typeof expression === \"string\" && el.type === \"radio\") {\n mutateDom(() => {\n if (!el.hasAttribute(\"name\"))\n el.setAttribute(\"name\", expression);\n });\n }\n var event = el.tagName.toLowerCase() === \"select\" || [\"checkbox\", \"radio\"].includes(el.type) || modifiers.includes(\"lazy\") ? \"change\" : \"input\";\n let removeListener = isCloning ? () => {\n } : on(el, event, modifiers, (e) => {\n setValue(getInputValue(el, modifiers, e, getValue()));\n });\n if (modifiers.includes(\"fill\")) {\n if ([void 0, null, \"\"].includes(getValue()) || isCheckbox(el) && Array.isArray(getValue()) || el.tagName.toLowerCase() === \"select\" && el.multiple) {\n setValue(\n getInputValue(el, modifiers, { target: el }, getValue())\n );\n }\n }\n if (!el._x_removeModelListeners)\n el._x_removeModelListeners = {};\n el._x_removeModelListeners[\"default\"] = removeListener;\n cleanup2(() => el._x_removeModelListeners[\"default\"]());\n if (el.form) {\n let removeResetListener = on(el.form, \"reset\", [], (e) => {\n nextTick(() => el._x_model && el._x_model.set(getInputValue(el, modifiers, { target: el }, getValue())));\n });\n cleanup2(() => removeResetListener());\n }\n el._x_model = {\n get() {\n return getValue();\n },\n set(value) {\n setValue(value);\n }\n };\n el._x_forceModelUpdate = (value) => {\n if (value === void 0 && typeof expression === \"string\" && expression.match(/\\./))\n value = \"\";\n window.fromModel = true;\n mutateDom(() => bind(el, \"value\", value));\n delete window.fromModel;\n };\n effect3(() => {\n let value = getValue();\n if (modifiers.includes(\"unintrusive\") && document.activeElement.isSameNode(el))\n return;\n el._x_forceModelUpdate(value);\n });\n});\nfunction getInputValue(el, modifiers, event, currentValue) {\n return mutateDom(() => {\n if (event instanceof CustomEvent && event.detail !== void 0)\n return event.detail !== null && event.detail !== void 0 ? event.detail : event.target.value;\n else if (isCheckbox(el)) {\n if (Array.isArray(currentValue)) {\n let newValue = null;\n if (modifiers.includes(\"number\")) {\n newValue = safeParseNumber(event.target.value);\n } else if (modifiers.includes(\"boolean\")) {\n newValue = safeParseBoolean(event.target.value);\n } else {\n newValue = event.target.value;\n }\n return event.target.checked ? currentValue.includes(newValue) ? currentValue : currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));\n } else {\n return event.target.checked;\n }\n } else if (el.tagName.toLowerCase() === \"select\" && el.multiple) {\n if (modifiers.includes(\"number\")) {\n return Array.from(event.target.selectedOptions).map((option) => {\n let rawValue = option.value || option.text;\n return safeParseNumber(rawValue);\n });\n } else if (modifiers.includes(\"boolean\")) {\n return Array.from(event.target.selectedOptions).map((option) => {\n let rawValue = option.value || option.text;\n return safeParseBoolean(rawValue);\n });\n }\n return Array.from(event.target.selectedOptions).map((option) => {\n return option.value || option.text;\n });\n } else {\n let newValue;\n if (isRadio(el)) {\n if (event.target.checked) {\n newValue = event.target.value;\n } else {\n newValue = currentValue;\n }\n } else {\n newValue = event.target.value;\n }\n if (modifiers.includes(\"number\")) {\n return safeParseNumber(newValue);\n } else if (modifiers.includes(\"boolean\")) {\n return safeParseBoolean(newValue);\n } else if (modifiers.includes(\"trim\")) {\n return newValue.trim();\n } else {\n return newValue;\n }\n }\n });\n}\nfunction safeParseNumber(rawValue) {\n let number = rawValue ? parseFloat(rawValue) : null;\n return isNumeric2(number) ? number : rawValue;\n}\nfunction checkedAttrLooseCompare2(valueA, valueB) {\n return valueA == valueB;\n}\nfunction isNumeric2(subject) {\n return !Array.isArray(subject) && !isNaN(subject);\n}\nfunction isGetterSetter(value) {\n return value !== null && typeof value === \"object\" && typeof value.get === \"function\" && typeof value.set === \"function\";\n}\n\n// packages/alpinejs/src/directives/x-cloak.js\ndirective(\"cloak\", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix(\"cloak\")))));\n\n// packages/alpinejs/src/directives/x-init.js\naddInitSelector(() => `[${prefix(\"init\")}]`);\ndirective(\"init\", skipDuringClone((el, { expression }, { evaluate: evaluate2 }) => {\n if (typeof expression === \"string\") {\n return !!expression.trim() && evaluate2(expression, {}, false);\n }\n return evaluate2(expression, {}, false);\n}));\n\n// packages/alpinejs/src/directives/x-text.js\ndirective(\"text\", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2 }) => {\n let evaluate2 = evaluateLater2(expression);\n effect3(() => {\n evaluate2((value) => {\n mutateDom(() => {\n el.textContent = value;\n });\n });\n });\n});\n\n// packages/alpinejs/src/directives/x-html.js\ndirective(\"html\", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2 }) => {\n let evaluate2 = evaluateLater2(expression);\n effect3(() => {\n evaluate2((value) => {\n mutateDom(() => {\n el.innerHTML = value;\n el._x_ignoreSelf = true;\n initTree(el);\n delete el._x_ignoreSelf;\n });\n });\n });\n});\n\n// packages/alpinejs/src/directives/x-bind.js\nmapAttributes(startingWith(\":\", into(prefix(\"bind:\"))));\nvar handler2 = (el, { value, modifiers, expression, original }, { effect: effect3, cleanup: cleanup2 }) => {\n if (!value) {\n let bindingProviders = {};\n injectBindingProviders(bindingProviders);\n let getBindings = evaluateLater(el, expression);\n getBindings((bindings) => {\n applyBindingsObject(el, bindings, original);\n }, { scope: bindingProviders });\n return;\n }\n if (value === \"key\")\n return storeKeyForXFor(el, expression);\n if (el._x_inlineBindings && el._x_inlineBindings[value] && el._x_inlineBindings[value].extract) {\n return;\n }\n let evaluate2 = evaluateLater(el, expression);\n effect3(() => evaluate2((result) => {\n if (result === void 0 && typeof expression === \"string\" && expression.match(/\\./)) {\n result = \"\";\n }\n mutateDom(() => bind(el, value, result, modifiers));\n }));\n cleanup2(() => {\n el._x_undoAddedClasses && el._x_undoAddedClasses();\n el._x_undoAddedStyles && el._x_undoAddedStyles();\n });\n};\nhandler2.inline = (el, { value, modifiers, expression }) => {\n if (!value)\n return;\n if (!el._x_inlineBindings)\n el._x_inlineBindings = {};\n el._x_inlineBindings[value] = { expression, extract: false };\n};\ndirective(\"bind\", handler2);\nfunction storeKeyForXFor(el, expression) {\n el._x_keyExpression = expression;\n}\n\n// packages/alpinejs/src/directives/x-data.js\naddRootSelector(() => `[${prefix(\"data\")}]`);\ndirective(\"data\", (el, { expression }, { cleanup: cleanup2 }) => {\n if (shouldSkipRegisteringDataDuringClone(el))\n return;\n expression = expression === \"\" ? \"{}\" : expression;\n let magicContext = {};\n injectMagics(magicContext, el);\n let dataProviderContext = {};\n injectDataProviders(dataProviderContext, magicContext);\n let data2 = evaluate(el, expression, { scope: dataProviderContext });\n if (data2 === void 0 || data2 === true)\n data2 = {};\n injectMagics(data2, el);\n let reactiveData = reactive(data2);\n initInterceptors(reactiveData);\n let undo = addScopeToNode(el, reactiveData);\n reactiveData[\"init\"] && evaluate(el, reactiveData[\"init\"]);\n cleanup2(() => {\n reactiveData[\"destroy\"] && evaluate(el, reactiveData[\"destroy\"]);\n undo();\n });\n});\ninterceptClone((from, to) => {\n if (from._x_dataStack) {\n to._x_dataStack = from._x_dataStack;\n to.setAttribute(\"data-has-alpine-state\", true);\n }\n});\nfunction shouldSkipRegisteringDataDuringClone(el) {\n if (!isCloning)\n return false;\n if (isCloningLegacy)\n return true;\n return el.hasAttribute(\"data-has-alpine-state\");\n}\n\n// packages/alpinejs/src/directives/x-show.js\ndirective(\"show\", (el, { modifiers, expression }, { effect: effect3 }) => {\n let evaluate2 = evaluateLater(el, expression);\n if (!el._x_doHide)\n el._x_doHide = () => {\n mutateDom(() => {\n el.style.setProperty(\"display\", \"none\", modifiers.includes(\"important\") ? \"important\" : void 0);\n });\n };\n if (!el._x_doShow)\n el._x_doShow = () => {\n mutateDom(() => {\n if (el.style.length === 1 && el.style.display === \"none\") {\n el.removeAttribute(\"style\");\n } else {\n el.style.removeProperty(\"display\");\n }\n });\n };\n let hide = () => {\n el._x_doHide();\n el._x_isShown = false;\n };\n let show = () => {\n el._x_doShow();\n el._x_isShown = true;\n };\n let clickAwayCompatibleShow = () => setTimeout(show);\n let toggle = once(\n (value) => value ? show() : hide(),\n (value) => {\n if (typeof el._x_toggleAndCascadeWithTransitions === \"function\") {\n el._x_toggleAndCascadeWithTransitions(el, value, show, hide);\n } else {\n value ? clickAwayCompatibleShow() : hide();\n }\n }\n );\n let oldValue;\n let firstTime = true;\n effect3(() => evaluate2((value) => {\n if (!firstTime && value === oldValue)\n return;\n if (modifiers.includes(\"immediate\"))\n value ? clickAwayCompatibleShow() : hide();\n toggle(value);\n oldValue = value;\n firstTime = false;\n }));\n});\n\n// packages/alpinejs/src/directives/x-for.js\ndirective(\"for\", (el, { expression }, { effect: effect3, cleanup: cleanup2 }) => {\n let iteratorNames = parseForExpression(expression);\n let evaluateItems = evaluateLater(el, iteratorNames.items);\n let evaluateKey = evaluateLater(\n el,\n // the x-bind:key expression is stored for our use instead of evaluated.\n el._x_keyExpression || \"index\"\n );\n el._x_prevKeys = [];\n el._x_lookup = {};\n effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey));\n cleanup2(() => {\n Object.values(el._x_lookup).forEach((el2) => mutateDom(\n () => {\n destroyTree(el2);\n el2.remove();\n }\n ));\n delete el._x_prevKeys;\n delete el._x_lookup;\n });\n});\nfunction loop(el, iteratorNames, evaluateItems, evaluateKey) {\n let isObject2 = (i) => typeof i === \"object\" && !Array.isArray(i);\n let templateEl = el;\n evaluateItems((items) => {\n if (isNumeric3(items) && items >= 0) {\n items = Array.from(Array(items).keys(), (i) => i + 1);\n }\n if (items === void 0)\n items = [];\n let lookup = el._x_lookup;\n let prevKeys = el._x_prevKeys;\n let scopes = [];\n let keys = [];\n if (isObject2(items)) {\n items = Object.entries(items).map(([key, value]) => {\n let scope2 = getIterationScopeVariables(iteratorNames, value, key, items);\n evaluateKey((value2) => {\n if (keys.includes(value2))\n warn(\"Duplicate key on x-for\", el);\n keys.push(value2);\n }, { scope: { index: key, ...scope2 } });\n scopes.push(scope2);\n });\n } else {\n for (let i = 0; i < items.length; i++) {\n let scope2 = getIterationScopeVariables(iteratorNames, items[i], i, items);\n evaluateKey((value) => {\n if (keys.includes(value))\n warn(\"Duplicate key on x-for\", el);\n keys.push(value);\n }, { scope: { index: i, ...scope2 } });\n scopes.push(scope2);\n }\n }\n let adds = [];\n let moves = [];\n let removes = [];\n let sames = [];\n for (let i = 0; i < prevKeys.length; i++) {\n let key = prevKeys[i];\n if (keys.indexOf(key) === -1)\n removes.push(key);\n }\n prevKeys = prevKeys.filter((key) => !removes.includes(key));\n let lastKey = \"template\";\n for (let i = 0; i < keys.length; i++) {\n let key = keys[i];\n let prevIndex = prevKeys.indexOf(key);\n if (prevIndex === -1) {\n prevKeys.splice(i, 0, key);\n adds.push([lastKey, i]);\n } else if (prevIndex !== i) {\n let keyInSpot = prevKeys.splice(i, 1)[0];\n let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0];\n prevKeys.splice(i, 0, keyForSpot);\n prevKeys.splice(prevIndex, 0, keyInSpot);\n moves.push([keyInSpot, keyForSpot]);\n } else {\n sames.push(key);\n }\n lastKey = key;\n }\n for (let i = 0; i < removes.length; i++) {\n let key = removes[i];\n if (!(key in lookup))\n continue;\n mutateDom(() => {\n destroyTree(lookup[key]);\n lookup[key].remove();\n });\n delete lookup[key];\n }\n for (let i = 0; i < moves.length; i++) {\n let [keyInSpot, keyForSpot] = moves[i];\n let elInSpot = lookup[keyInSpot];\n let elForSpot = lookup[keyForSpot];\n let marker = document.createElement(\"div\");\n mutateDom(() => {\n if (!elForSpot)\n warn(`x-for \":key\" is undefined or invalid`, templateEl, keyForSpot, lookup);\n elForSpot.after(marker);\n elInSpot.after(elForSpot);\n elForSpot._x_currentIfEl && elForSpot.after(elForSpot._x_currentIfEl);\n marker.before(elInSpot);\n elInSpot._x_currentIfEl && elInSpot.after(elInSpot._x_currentIfEl);\n marker.remove();\n });\n elForSpot._x_refreshXForScope(scopes[keys.indexOf(keyForSpot)]);\n }\n for (let i = 0; i < adds.length; i++) {\n let [lastKey2, index] = adds[i];\n let lastEl = lastKey2 === \"template\" ? templateEl : lookup[lastKey2];\n if (lastEl._x_currentIfEl)\n lastEl = lastEl._x_currentIfEl;\n let scope2 = scopes[index];\n let key = keys[index];\n let clone2 = document.importNode(templateEl.content, true).firstElementChild;\n let reactiveScope = reactive(scope2);\n addScopeToNode(clone2, reactiveScope, templateEl);\n clone2._x_refreshXForScope = (newScope) => {\n Object.entries(newScope).forEach(([key2, value]) => {\n reactiveScope[key2] = value;\n });\n };\n mutateDom(() => {\n lastEl.after(clone2);\n skipDuringClone(() => initTree(clone2))();\n });\n if (typeof key === \"object\") {\n warn(\"x-for key cannot be an object, it must be a string or an integer\", templateEl);\n }\n lookup[key] = clone2;\n }\n for (let i = 0; i < sames.length; i++) {\n lookup[sames[i]]._x_refreshXForScope(scopes[keys.indexOf(sames[i])]);\n }\n templateEl._x_prevKeys = keys;\n });\n}\nfunction parseForExpression(expression) {\n let forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\n let stripParensRE = /^\\s*\\(|\\)\\s*$/g;\n let forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\n let inMatch = expression.match(forAliasRE);\n if (!inMatch)\n return;\n let res = {};\n res.items = inMatch[2].trim();\n let item = inMatch[1].replace(stripParensRE, \"\").trim();\n let iteratorMatch = item.match(forIteratorRE);\n if (iteratorMatch) {\n res.item = item.replace(forIteratorRE, \"\").trim();\n res.index = iteratorMatch[1].trim();\n if (iteratorMatch[2]) {\n res.collection = iteratorMatch[2].trim();\n }\n } else {\n res.item = item;\n }\n return res;\n}\nfunction getIterationScopeVariables(iteratorNames, item, index, items) {\n let scopeVariables = {};\n if (/^\\[.*\\]$/.test(iteratorNames.item) && Array.isArray(item)) {\n let names = iteratorNames.item.replace(\"[\", \"\").replace(\"]\", \"\").split(\",\").map((i) => i.trim());\n names.forEach((name, i) => {\n scopeVariables[name] = item[i];\n });\n } else if (/^\\{.*\\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === \"object\") {\n let names = iteratorNames.item.replace(\"{\", \"\").replace(\"}\", \"\").split(\",\").map((i) => i.trim());\n names.forEach((name) => {\n scopeVariables[name] = item[name];\n });\n } else {\n scopeVariables[iteratorNames.item] = item;\n }\n if (iteratorNames.index)\n scopeVariables[iteratorNames.index] = index;\n if (iteratorNames.collection)\n scopeVariables[iteratorNames.collection] = items;\n return scopeVariables;\n}\nfunction isNumeric3(subject) {\n return !Array.isArray(subject) && !isNaN(subject);\n}\n\n// packages/alpinejs/src/directives/x-ref.js\nfunction handler3() {\n}\nhandler3.inline = (el, { expression }, { cleanup: cleanup2 }) => {\n let root = closestRoot(el);\n if (!root._x_refs)\n root._x_refs = {};\n root._x_refs[expression] = el;\n cleanup2(() => delete root._x_refs[expression]);\n};\ndirective(\"ref\", handler3);\n\n// packages/alpinejs/src/directives/x-if.js\ndirective(\"if\", (el, { expression }, { effect: effect3, cleanup: cleanup2 }) => {\n if (el.tagName.toLowerCase() !== \"template\")\n warn(\"x-if can only be used on a <template> tag\", el);\n let evaluate2 = evaluateLater(el, expression);\n let show = () => {\n if (el._x_currentIfEl)\n return el._x_currentIfEl;\n let clone2 = el.content.cloneNode(true).firstElementChild;\n addScopeToNode(clone2, {}, el);\n mutateDom(() => {\n el.after(clone2);\n skipDuringClone(() => initTree(clone2))();\n });\n el._x_currentIfEl = clone2;\n el._x_undoIf = () => {\n mutateDom(() => {\n destroyTree(clone2);\n clone2.remove();\n });\n delete el._x_currentIfEl;\n };\n return clone2;\n };\n let hide = () => {\n if (!el._x_undoIf)\n return;\n el._x_undoIf();\n delete el._x_undoIf;\n };\n effect3(() => evaluate2((value) => {\n value ? show() : hide();\n }));\n cleanup2(() => el._x_undoIf && el._x_undoIf());\n});\n\n// packages/alpinejs/src/directives/x-id.js\ndirective(\"id\", (el, { expression }, { evaluate: evaluate2 }) => {\n let names = evaluate2(expression);\n names.forEach((name) => setIdRoot(el, name));\n});\ninterceptClone((from, to) => {\n if (from._x_ids) {\n to._x_ids = from._x_ids;\n }\n});\n\n// packages/alpinejs/src/directives/x-on.js\nmapAttributes(startingWith(\"@\", into(prefix(\"on:\"))));\ndirective(\"on\", skipDuringClone((el, { value, modifiers, expression }, { cleanup: cleanup2 }) => {\n let evaluate2 = expression ? evaluateLater(el, expression) : () => {\n };\n if (el.tagName.toLowerCase() === \"template\") {\n if (!el._x_forwardEvents)\n el._x_forwardEvents = [];\n if (!el._x_forwardEvents.includes(value))\n el._x_forwardEvents.push(value);\n }\n let removeListener = on(el, value, modifiers, (e) => {\n evaluate2(() => {\n }, { scope: { \"$event\": e }, params: [e] });\n });\n cleanup2(() => removeListener());\n}));\n\n// packages/alpinejs/src/directives/index.js\nwarnMissingPluginDirective(\"Collapse\", \"collapse\", \"collapse\");\nwarnMissingPluginDirective(\"Intersect\", \"intersect\", \"intersect\");\nwarnMissingPluginDirective(\"Focus\", \"trap\", \"focus\");\nwarnMissingPluginDirective(\"Mask\", \"mask\", \"mask\");\nfunction warnMissingPluginDirective(name, directiveName, slug) {\n directive(directiveName, (el) => warn(`You can't use [x-${directiveName}] without first installing the \"${name}\" plugin here: https://alpinejs.dev/plugins/${slug}`, el));\n}\n\n// packages/alpinejs/src/index.js\nalpine_default.setEvaluator(normalEvaluator);\nalpine_default.setReactivityEngine({ reactive: reactive2, effect: effect2, release: stop, raw: toRaw });\nvar src_default = alpine_default;\n\n// packages/alpinejs/builds/module.js\nvar module_default = src_default;\nexport {\n src_default as Alpine,\n module_default as default\n};\n", "import * as models from \"../RiderDetails/RiderDetailsModelBundle\";\r\nimport * as components from \"../RiderDetails/RiderDetailsCompBundle\";\r\n\r\nexport class ProductAndRiderDetailsService {\r\n private static instance: ProductAndRiderDetailsService;\r\n\r\n constructor() {\r\n // Initialization logic here\r\n }\r\n\r\n public static getInstance(): ProductAndRiderDetailsService {\r\n if (!ProductAndRiderDetailsService.instance) {\r\n ProductAndRiderDetailsService.instance = new ProductAndRiderDetailsService();\r\n }\r\n return ProductAndRiderDetailsService.instance;\r\n }\r\n\r\n public getProductAndRiderDetails(productInfoPortlets: components.ProductInfoPortlet[]): models.ProductAndRiderDetails[] {\r\n let productAndRiderDetails: models.ProductAndRiderDetails[] = [];\r\n\r\n for (let i = 0; i < productInfoPortlets.length; i++) {\r\n productAndRiderDetails.push(productInfoPortlets[i].getProductAndRiderDetails());\r\n }\r\n\r\n return productAndRiderDetails;\r\n }\r\n}", "export class RentalAllowedStatus {\r\n private _rentalItemId: number;\r\n private _isAllowed: boolean;\r\n private _errorMessage: string;\r\n\r\n constructor(rentalItemId: number, isAllowed: boolean, errorMessage?: string) {\r\n this._rentalItemId = rentalItemId;\r\n this._isAllowed = isAllowed;\r\n this._errorMessage = errorMessage || \"\";\r\n }\r\n\r\n // Getter methods for each property\r\n get rentalItemId(): number {\r\n return this._rentalItemId;\r\n }\r\n\r\n get isAllowed(): boolean {\r\n return this._isAllowed;\r\n }\r\n\r\n get errorMessage(): string {\r\n return this._errorMessage;\r\n }\r\n}", "import { ProductAndRiderDetailsService } from \"./ProductAndRiderDetailsService\";\r\nimport * as Rental from \"../RiderDetails/RiderDetailsModule\";\r\nimport { AxLoad } from \"../../../Lib/AxSystem/AxLoad\";\r\nimport { RentalAllowedStatus } from \"../../../Models/Rental/RentalAllowedStatus\";\r\n\r\nexport class CheckAllowedRentalIItemsService {\r\n private riderDetailsModule: Rental.RiderDetailsModule;\r\n private static instance: CheckAllowedRentalIItemsService;\r\n\r\n private constructor() {\r\n this.riderDetailsModule = AxLoad.GetModule<Rental.RiderDetailsModule>(\"RiderDetailsModule\");\r\n }\r\n\r\n public static getInstance(): CheckAllowedRentalIItemsService {\r\n if (!CheckAllowedRentalIItemsService.instance) {\r\n CheckAllowedRentalIItemsService.instance = new CheckAllowedRentalIItemsService();\r\n }\r\n return CheckAllowedRentalIItemsService.instance;\r\n }\r\n\r\n public async checkIfItemIsAllowedForPerson(customerAccountNr: number): Promise<RentalAllowedStatus> {\r\n try {\r\n const productAndRiderDetails = ProductAndRiderDetailsService.getInstance()\r\n .getProductAndRiderDetails(this.riderDetailsModule.getAllProductInfoPortlets());\r\n\r\n const rentalItemId = this.riderDetailsModule\r\n .getActiveProductPortlet()\r\n .getProductAndRiderDetails()\r\n .productTripleWithType.id;\r\n\r\n const customerSelectedItems = productAndRiderDetails\r\n .filter(x => x.customerAccountNr === customerAccountNr)\r\n .map(x => (x.productTripleWithType.id));\r\n\r\n const data = {\r\n CustomerAccountNr: customerAccountNr,\r\n RentalItemId: rentalItemId,\r\n CustomerSelectedItems: customerSelectedItems,\r\n };\r\n\r\n const url = `/api/CheckAllowedRentalIItemsApi/CheckAllowedRentalItemsForPerson`;\r\n\r\n return new Promise<RentalAllowedStatus>((resolve, reject) => {\r\n AxessViewer.ajaxRequest(url, data,\r\n (res) => {\r\n const rentalAllowedStatus = new RentalAllowedStatus(res.RentalItemId, res.IsAllowed, res.ErrorMessage);\r\n resolve(rentalAllowedStatus);\r\n },\r\n {\r\n type: 'Post'\r\n });\r\n });\r\n } catch (error) {\r\n console.error('Error checking item allowance:', error);\r\n throw error;\r\n }\r\n }\r\n}", "import { AxModal, AxDropdown, IAxDropdownOptions, AxFormValidation, AxInput, IAxFormValidationOptions } from \"@axess/limestone\";\r\nimport { PriceHelper } from \"../../../../Lib/Helper/PriceHelper\";\r\nimport Alpine, { AlpineComponent } from \"alpinejs\";\r\nimport { AxLoad } from \"../../../../Lib/AxSystem/AxLoad\";\r\nimport * as Rental from \"../RiderDetailsModule\";\r\nimport * as models from \"../RiderDetailsModelBundle\";\r\nimport { CheckAllowedRentalIItemsService } from \"../../Services/CheckAllowedRentalIItemsService\";\r\nimport { ConfigDefinition, ConfigHelper } from \"../../../../Lib/Helper/Config/ConfigHelper\";\r\n\r\nexport class RiderSelection {\r\n private riderDetailsModule: Rental.RiderDetailsModule;\r\n\r\n private personDropDown = new AxDropdown();\r\n\r\n private priceHelper: PriceHelper;\r\n\r\n private headerProdName: HTMLDivElement;\r\n private headerProdPrice: HTMLDivElement;\r\n private innerArea: HTMLDivElement;\r\n private alertBanner: HTMLDivElement;\r\n\r\n private personSelectionDateOfBirth: HTMLInputElement;\r\n private personSelectionMail: HTMLInputElement;\r\n\r\n private mobileCancelBtn: HTMLButtonElement;\r\n private mobileSaveBtn: HTMLButtonElement;\r\n\r\n constructor() {\r\n this.riderDetailsModule = AxLoad.GetModule<Rental.RiderDetailsModule>(\"RiderDetailsModule\");\r\n Alpine.start();\r\n this.priceHelper = new PriceHelper(null, true);\r\n\r\n this.initElements();\r\n this.initMobileButtons();\r\n this.initPersonDropDown();\r\n }\r\n\r\n initElements() {\r\n this.alertBanner = document.getElementById('savePersonDataAlert') as HTMLDivElement;\r\n this.personSelectionDateOfBirth = document.getElementsByClassName('rental_rider_details__person-selection-portlet-dateOfBirth')[0] as HTMLInputElement;\r\n this.personSelectionMail = document.getElementsByClassName('rental_rider_details__person-selection-portlet-mail')[0] as HTMLInputElement;\r\n this.headerProdName = document.getElementsByClassName('rental_detail_rider__right_container-productName')[0] as HTMLDivElement;\r\n this.headerProdPrice = document.getElementsByClassName('rental_detail_rider__right_container-productPrice')[0] as HTMLDivElement;\r\n }\r\n\r\n resetDrownDown() {\r\n this.personDropDown.resetSelection();\r\n }\r\n\r\n resetPortlet() {\r\n this.resetSelectedPersonDataTexts();\r\n this.personDropDown.resetSelection();\r\n }\r\n\r\n setDataAfterSelect(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n this.setDateOfBirthText(productAndRiderDetails.riderData.dateOfBirth);\r\n this.setEmailText(productAndRiderDetails.riderData.customerEmail);\r\n this.personDropDown.setValue(productAndRiderDetails.riderData.customerName);\r\n }\r\n\r\n private initPersonDropDown() {\r\n this.personDropDown = new AxDropdown();\r\n\r\n this.personDropDown.init(`.rental_rider_details__person-dropdown`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n const accountId = parseInt(this.personDropDown.getValue().toString());\r\n\r\n const currentAccountId = this.riderDetailsModule\r\n .getActiveProductPortlet()\r\n .getProductAndRiderDetails()?.customerAccountNr;\r\n\r\n if (accountId === currentAccountId) {\r\n return;\r\n }\r\n\r\n if (this.riderDetailsModule.getActiveProductPortlet().getProductAndRiderDetails().includedPackageItems.length === 0) {\r\n ConfigHelper.getBoolConfigValue(ConfigDefinition.RentalIsAllowedActivated, (rentalIsAllowedActivated) => {\r\n if (rentalIsAllowedActivated) {\r\n this.checkIfRentalIsAllowed(accountId)\r\n .then(rentalAllowed => {\r\n if (rentalAllowed) {\r\n this.riderDetailsModule.loadAccountData(accountId);\r\n } else {\r\n this.resetPortlet();\r\n this.riderDetailsModule\r\n .getActiveProductPortlet()\r\n .setUserNotSelectedState();\r\n }\r\n });\r\n } else {\r\n this.riderDetailsModule.loadAccountData(accountId);\r\n }\r\n });\r\n\r\n } else {\r\n this.riderDetailsModule.loadAccountData(accountId);\r\n }\r\n\r\n $('.rental_detail_rider__btn-add_to_cart').prop(\"disabled\", false);\r\n }\r\n });\r\n }\r\n\r\n private async checkIfRentalIsAllowed(accountId: number): Promise<boolean> {\r\n const checkAllowedRentalIItemsService = CheckAllowedRentalIItemsService.getInstance();\r\n\r\n try {\r\n const rentalAllowedStatus = await checkAllowedRentalIItemsService.checkIfItemIsAllowedForPerson(accountId);\r\n\r\n if (!rentalAllowedStatus.isAllowed) {\r\n this.showAlertBanner(rentalAllowedStatus.errorMessage, 'danger');\r\n return false;\r\n }\r\n\r\n return true;\r\n\r\n } catch (error) {\r\n console.error('An error occurred:', error);\r\n return false;\r\n }\r\n }\r\n\r\n showAlertBanner(text: string, mode: 'success' | 'danger') {\r\n this.alertBanner.querySelectorAll('span')[0].innerHTML = text;\r\n this.alertBanner.classList.remove('hidden');\r\n this.alertBanner.classList.toggle('ax-alert--success', mode === \"success\");\r\n this.alertBanner.classList.toggle('ax-alert--danger', mode === \"danger\");\r\n }\r\n\r\n hideAlertBanner() {\r\n this.alertBanner.classList.add('hidden');\r\n }\r\n\r\n setHeaderValues(productName: string, price: number) {\r\n this.headerProdName.innerHTML = productName;\r\n this.headerProdPrice.innerHTML = this.priceHelper.GetPriceStringWithDecimalDivisorCalced(price);\r\n }\r\n\r\n setSelectedPersonDataTexts(dateOdBirth: string, email: string) {\r\n this.setDateOfBirthText(dateOdBirth);\r\n this.setEmailText(email);\r\n }\r\n\r\n resetSelectedPersonDataTexts() {\r\n this.setDateOfBirthText(\"\");\r\n this.setEmailText(\"\");\r\n }\r\n\r\n showMobilePersonSelection() {\r\n this.innerArea = document.getElementsByClassName('rental_detail_rider__right_container-inner')[0] as HTMLDivElement;\r\n this.innerArea.classList.add('show-mobile');\r\n }\r\n\r\n private setDateOfBirthText(text: string) {\r\n this.personSelectionDateOfBirth.value = text;\r\n }\r\n\r\n private setEmailText(text: string) {\r\n this.personSelectionMail.value = text;\r\n }\r\n\r\n private initMobileButtons() {\r\n this.mobileSaveBtn = document.getElementsByClassName('rental_detail_rider__btn-mobile-save')[0] as HTMLButtonElement;\r\n\r\n this.mobileSaveBtn.addEventListener(\"click\",\r\n x => {\r\n this.innerArea.classList.remove('show-mobile');\r\n this.riderDetailsModule.getActiveProductPortlet().checkFormValidityAndSetStates();\r\n });\r\n\r\n this.mobileCancelBtn = document.getElementsByClassName('rental_detail_rider__btn-mobile-cancel')[0] as HTMLButtonElement;\r\n\r\n this.mobileCancelBtn.addEventListener(\"click\",\r\n x => {\r\n this.innerArea.classList.remove('show-mobile');\r\n this.riderDetailsModule.getActiveProductPortlet().checkFormValidityAndSetStates();\r\n });\r\n }\r\n}\r\n\r\n\r\n\r\n", "import { AxLoading } from \"../../../../Limestone/AxLoading/AxLoading\";\r\nimport { Instance, Props } from \"tippy.js\";\r\nimport { I18nHelper, Translations } from \"../../../../Lib/Helper/I18nHelper\";\r\nimport { AxLoad } from \"../../../../Lib/AxSystem/AxLoad\";\r\nimport * as Rental from \"../RiderDetailsModule\";\r\nimport * as models from \"../RiderDetailsModelBundle\";\r\n\r\nexport class ProductInfoPortlet {\r\n private riderDetailsModule: Rental.RiderDetailsModule;\r\n\r\n private loadingGuid: string;\r\n private axLoading: AxLoading;\r\n\r\n private errorMsgHtmlElement: HTMLElement;\r\n private portletHtmlElement: HTMLDivElement;\r\n private nameLabelHtmlElement: HTMLDivElement;\r\n private mailLabelHtmlElement: HTMLDivElement;\r\n private activeMarker: HTMLDivElement;\r\n\r\n private addToCartModel: models.ProductAndRiderDetails;\r\n\r\n constructor(element: HTMLDivElement, addToCartModel: models.ProductAndRiderDetails) {\r\n this.portletHtmlElement = element;\r\n this.activeMarker = element.parentElement as HTMLDivElement;\r\n this.errorMsgHtmlElement = this.activeMarker.nextElementSibling as HTMLElement;\r\n\r\n this.addToCartModel = addToCartModel;\r\n\r\n this.riderDetailsModule = AxLoad.GetModule<Rental.RiderDetailsModule>(\"RiderDetailsModule\");\r\n\r\n this.axLoading = new AxLoading();\r\n\r\n this.initLabels();\r\n this.initOnClickEvent();\r\n }\r\n\r\n private initOnClickEvent() {\r\n this.portletHtmlElement.addEventListener('click', x => {\r\n this.activatePortlet();\r\n });\r\n }\r\n\r\n private getPortletHtmlElement(): HTMLDivElement {\r\n return this.portletHtmlElement;\r\n }\r\n\r\n getProductAndRiderDetails(): models.ProductAndRiderDetails {\r\n return this.addToCartModel;\r\n }\r\n\r\n activatePortlet() {\r\n this.riderDetailsModule.changeActiveProductPortlet(this);\r\n this.setPortletActive();\r\n }\r\n\r\n showPortletLoadingSpinner() {\r\n this.loadingGuid = this.axLoading.ShowLoadingIndicatorGetId(this.getPortletHtmlElement(), true);\r\n }\r\n\r\n hidePortletLoadingSpinner() {\r\n this.axLoading.HideLoadingIndicatorWithId(this.loadingGuid);\r\n }\r\n\r\n checkFormValidityAndSetStates(): Promise<boolean> {\r\n let valid = true;\r\n\r\n if (this.addToCartModel?.riderData === undefined || this.addToCartModel?.riderData === null) {\r\n this.setUserNotSelectedState();\r\n return Promise.resolve(false);\r\n }\r\n\r\n if (this.riderDetailsModule.getPersonRentalDataForm().hasForm()) {\r\n if (this.riderDetailsModule.getPersonRentalDataForm().formIsValid()) {\r\n this.setUserSelectedState();\r\n valid = true;\r\n } else {\r\n this.setMissingDataState();\r\n return Promise.resolve(false);\r\n }\r\n }\r\n\r\n if (this.riderDetailsModule.lockerIncluded()) {\r\n const prom = this.riderDetailsModule.getLockerDataComponent().lockerFormIsValid();\r\n\r\n prom.then(asyncValid => {\r\n if (!asyncValid) {\r\n this.setMissingDataState();\r\n }\r\n });\r\n\r\n return prom;\r\n }\r\n\r\n this.setUserSelectedState();\r\n return Promise.resolve(valid);\r\n }\r\n\r\n removeUserSelectedState() {\r\n this.portletHtmlElement.classList.remove('rental_details_rider__product_portlet-user_selected');\r\n }\r\n\r\n setUserSelectedState() {\r\n this.portletHtmlElement.classList.add('rental_details_rider__product_portlet-user_selected');\r\n this.removeUserNotSelectedState();\r\n }\r\n\r\n removeMissingDataState() {\r\n this.removeUserNotSelectedState();\r\n }\r\n\r\n setMissingDataState() {\r\n const i18nHelper = new I18nHelper();\r\n this.setUserNotSelectedState(i18nHelper.GetTranslation(Translations.MandatoryRentalDataMissing));\r\n }\r\n\r\n removeUserNotSelectedState() {\r\n this.errorMsgHtmlElement.setAttribute('hidden', '');\r\n this.portletHtmlElement.classList.remove('rental_details_rider__product_portlet-user_not_selected');\r\n }\r\n\r\n setUserNotSelectedState(text?: string) {\r\n if (text) {\r\n this.errorMsgHtmlElement.children[0].innerHTML = text;\r\n } else {\r\n const i18nHelper = new I18nHelper();\r\n this.errorMsgHtmlElement.children[0].innerHTML = i18nHelper.GetTranslation(Translations.RentalNoPersonSelected);\r\n }\r\n\r\n this.portletHtmlElement.classList.add('rental_details_rider__product_portlet-user_not_selected');\r\n this.errorMsgHtmlElement.removeAttribute('hidden');\r\n this.removeUserSelectedState();\r\n }\r\n\r\n initLabels() {\r\n this.nameLabelHtmlElement = this.portletHtmlElement.getElementsByClassName('rental_details_rider__product_portlet-person-name')[0] as HTMLDivElement;\r\n this.mailLabelHtmlElement = this.portletHtmlElement.getElementsByClassName('rental_details_rider__product_portlet-person-mail')[0] as HTMLDivElement;\r\n }\r\n\r\n updatePersonInfoTexts() {\r\n this.updateNameText();\r\n this.updateEmailText();\r\n }\r\n\r\n private updateNameText() {\r\n this.nameLabelHtmlElement.innerHTML = this.addToCartModel.riderData.customerName;\r\n }\r\n\r\n private updateEmailText() {\r\n this.mailLabelHtmlElement.innerHTML = this.addToCartModel.riderData.customerEmail;\r\n }\r\n\r\n private setPortletActive() {\r\n //this.isActive = true;\r\n this.activeMarker.classList.add('active');\r\n }\r\n\r\n setPortletInActive() {\r\n //this.isActive = false;\r\n this.activeMarker.classList.remove('active');\r\n }\r\n\r\n setLockerWtpNumberText($parent: JQuery<HTMLElement>, value: string) {\r\n $('.rental_details_rider__product_portlet-person-wtp', this.portletHtmlElement).removeClass('d-none');\r\n\r\n const intValue = parseInt(value);\r\n let text = \"\";\r\n\r\n if (!isNaN(intValue) && intValue < 0) {\r\n //@ts-ignore\r\n const instance = $parent[0]._tippy as Instance<Props>;\r\n text = $('.ax-dropdown__item.selected', $(instance.popper)).html();\r\n } else {\r\n text = value;\r\n }\r\n\r\n $('.rental_details_rider__product_portlet-person-wtp--value', this.portletHtmlElement).html(text);\r\n }\r\n}", "import { AxModal, AxDropdown, IAxDropdownOptions, AxFormValidation, AxInput, IAxFormValidationOptions } from \"@axess/limestone\";\r\nimport { inputMaskHelper } from \"../../../../Lib/Helper/InputMaskHelper\";\r\nimport { ProductAndRiderDetails as RentalAddToCartProduct } from \"../../../../Models/Rental/RiderDetails/ProductAndRiderDetails\";\r\nimport { AxLoad } from \"../../../../Lib/AxSystem/AxLoad\";\r\nimport * as Rental from \"../RiderDetailsModule\";\r\n\r\nexport class LockerData {\r\n private lockerWtpSelectionDropdown = new AxDropdown();\r\n private riderDetailsModule: Rental.RiderDetailsModule;\r\n\r\n constructor() {\r\n this.riderDetailsModule = AxLoad.GetModule<Rental.RiderDetailsModule>(\"RiderDetailsModule\");\r\n\r\n this.initLockerDropDown();\r\n this.initLockerValidation();\r\n }\r\n\r\n initLockerValidation() {\r\n let validationFormOptions = {\r\n selector: '#lockerDataForm',\r\n rules: this.getLockerValidationRules(),\r\n callback: (form: HTMLElement) => {}\r\n }\r\n\r\n let form = document.getElementById('lockerDataForm');\r\n\r\n let inputs = form.getElementsByClassName(\"ax-form-control rental_customer_details-wtp_inp\");\r\n\r\n new AxFormValidation(validationFormOptions).init();\r\n\r\n for (let i = 0; i < inputs.length; i++) {\r\n let input = inputs.item(i) as HTMLInputElement;\r\n\r\n if (input.id.length === 0) {\r\n continue;\r\n }\r\n\r\n new AxInput('#' + input.id).init();\r\n }\r\n }\r\n\r\n lockerFormIsValid(): Promise<boolean> {\r\n if (this.riderDetailsModule.getActiveProductPortlet().getProductAndRiderDetails().lockerWtpSelection === 2\r\n || this.riderDetailsModule.getActiveProductPortlet().getProductAndRiderDetails().lockerWtpSelection === 3) {\r\n return Promise.resolve(true);\r\n }\r\n\r\n let valid = $('#lockerDataForm')?.valid();\r\n\r\n if (!valid) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n AxessViewer.ajaxRequest(\"/util/checkwtpnr\", { wtpnr: $('[name=rentalLockerWtpNr]').val() }, (resp) => {\r\n resolve(resp);\r\n }, {});\r\n })\r\n }\r\n\r\n private getLockerValidationRules(): JQueryValidation.RulesDictionary {\r\n return {\r\n rentalLockerWtpNr: {\r\n required: {\r\n depends: (element) => {\r\n return true;\r\n }\r\n },\r\n wtpNumber: {\r\n depends: (element) => {\r\n return true;\r\n }\r\n }\r\n }\r\n };\r\n }\r\n\r\n private initLockerDropDown() {\r\n this.lockerWtpSelectionDropdown.init('.rental_customer_details-lockerWtp',\r\n {\r\n onSelect: (p, value: string) => {\r\n this.lockerSelectionUpdate(p, value);\r\n }\r\n });\r\n\r\n $('.rental_customer_details-wtp_inp').inputmask(inputMaskHelper.wtpNumberMask(), inputMaskHelper.wtpMaskOptions());\r\n\r\n $('.rental_customer_details-wtp_inp').on('keyup', x => {\r\n if ($('.rental_customer_details-wtp_inp').inputmask(\"isComplete\")) {\r\n this.riderDetailsModule.getActiveProductPortlet().checkFormValidityAndSetStates();\r\n this.riderDetailsModule.getActiveProductPortlet().getProductAndRiderDetails().lockerWtpNr = $('.rental_customer_details-wtp_inp').val() as string;\r\n }\r\n });\r\n }\r\n\r\n setLockerData(productAndRiderDetails: RentalAddToCartProduct) {\r\n if (productAndRiderDetails != null) {\r\n switch (productAndRiderDetails.lockerWtpSelection) {\r\n case 0:\r\n break;\r\n case 3:\r\n this.lockerWtpSelectionDropdown.setValue(productAndRiderDetails.lockerWtpNr);\r\n break;\r\n //no break since default should still run\r\n case 2:\r\n $('.rental_customer_details-wtp_inp').val(productAndRiderDetails.lockerWtpNr);\r\n default:\r\n // remember wtpNr cause Dropdown.setValue will override it with empty string\r\n const lockerWtpNrTemp = productAndRiderDetails.lockerWtpNr;\r\n this.lockerWtpSelectionDropdown.setValue((productAndRiderDetails.lockerWtpSelection * -1).toString());\r\n $('.rental_customer_details-wtp_inp').val(lockerWtpNrTemp);\r\n productAndRiderDetails.lockerWtpNr = lockerWtpNrTemp;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n private lockerSelectionUpdate(parent: JQuery<HTMLElement>, value: string) {\r\n const intValue = parseInt(value);\r\n let productAndRiderDetails = this.riderDetailsModule.getActiveProductPortlet().getProductAndRiderDetails();\r\n\r\n if (!isNaN(intValue) && intValue < 0) {\r\n productAndRiderDetails.lockerWtpSelection = intValue * -1;\r\n\r\n if (intValue === -1) {\r\n productAndRiderDetails.lockerWtpNr = $('.rental_customer_details-wtp_inp').val() as string;\r\n } else {\r\n productAndRiderDetails.lockerWtpNr = \"\";\r\n }\r\n\r\n } else {\r\n productAndRiderDetails.lockerWtpNr = value;\r\n productAndRiderDetails.lockerWtpSelection = 3;\r\n }\r\n\r\n\r\n $('.rental_customer_details-lockerWtp--warning').toggleClass('d-none', value !== '-2');\r\n $('.rental_customer_details-wtp_inp-wrapper').toggleClass('d-none', value !== '-1');\r\n\r\n this.riderDetailsModule.getActiveProductPortlet().setLockerWtpNumberText(parent, value);\r\n this.riderDetailsModule.getActiveProductPortlet().checkFormValidityAndSetStates();\r\n }\r\n\r\n lockerRequired(): boolean {\r\n return this.lockerWtpSelectionDropdown != null && this.lockerWtpSelectionDropdown.val() === \"-1\";\r\n }\r\n}", "export class RiderData {\r\n unitSystem: number;\r\n shoeSizeSystem: number;\r\n\r\n customerAccountId: number;\r\n customerName: string;\r\n customerEmail: string;\r\n dateOfBirth: string;\r\n\r\n weight: number;\r\n height: number;\r\n soleLength: number;\r\n shoeSize: number;\r\n gender: string;\r\n skillLevel: number;\r\n\r\n city: string;\r\n phone: string;\r\n zipCode: string;\r\n country: string;\r\n street: string;\r\n houseNumber: string;\r\n state: string;\r\n passportId: string;\r\n}", "export * from \"../../../Models/Rental/RiderDetails/ProductAndRiderDetails\";\r\nexport * from \"../../../Models/Rental/RiderDetails/RiderData\";\r\n\r\nexport namespace Models {\r\n export class RiderDetailsModelBundle {}\r\n}", "import { AxModal, AxDropdown, IAxDropdownOptions, AxFormValidation, AxInput, IAxFormValidationOptions } from \"@axess/limestone\";\r\nimport * as Rental from \"../RiderDetailsModule\";\r\nimport * as models from \"../RiderDetailsModelBundle\";\r\nimport { AxLoad } from \"../../../../Lib/AxSystem/AxLoad\";\r\nimport { AxStaticConfigModule } from \"../../../AxConfig/AxStaticConfigModule\";\r\nimport { ConfigHelper, ConfigDefinition } from \"../../../../Lib/Helper/Config/ConfigHelper\";\r\nimport { MaskedTextChangedListener } from 'ts-input-mask';\r\n\r\nexport class PersonDataForm {\r\n private formName = '#personDataForm';\r\n\r\n private unitSystem: number;\r\n\r\n private heightDropDown = new AxDropdown();\r\n private weightDropDown = new AxDropdown();\r\n private shoeSizeDropDown = new AxDropdown();\r\n private shoeSizeSystemDropDown = new AxDropdown();\r\n\r\n private countryDropDown = new AxDropdown();\r\n private genderDropDown = new AxDropdown();\r\n private skillLevelDropDown = new AxDropdown();\r\n\r\n private riderDetailsModule: Rental.RiderDetailsModule;\r\n\r\n constructor(unitSystem: number) {\r\n this.unitSystem = unitSystem;\r\n this.riderDetailsModule = AxLoad.GetModule<Rental.RiderDetailsModule>(\"RiderDetailsModule\");\r\n }\r\n\r\n async initInputsAsync(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n return new Promise<void>((resolve) => {\r\n this.initInputValidation();\r\n this.initUnitSelectionRadios(productAndRiderDetails);\r\n\r\n ConfigHelper.getBoolConfigValueAsync(ConfigDefinition.RentalDataTextInput)\r\n .then(async useTextInput => {\r\n if (productAndRiderDetails != null &&\r\n productAndRiderDetails.riderData != null &&\r\n productAndRiderDetails.riderData != undefined) {\r\n this.initTextInputs(productAndRiderDetails, useTextInput);\r\n this.initDropDowns(productAndRiderDetails, useTextInput);\r\n await this.setValueFromProductAndRiderDetailsToForm(productAndRiderDetails, useTextInput);\r\n resolve();\r\n }\r\n });\r\n });\r\n }\r\n\r\n private initInputValidation() {\r\n let validationFormOptions = {\r\n selector: '#personDataForm',\r\n rules: this.getValidationRules(),\r\n callback: (form: HTMLElement) => {\r\n //this.submitPersonDataForm();\r\n }\r\n }\r\n\r\n let form = document.getElementById('personDataForm');\r\n\r\n let inputs = form.getElementsByClassName(\"ax-form-control\");\r\n\r\n new AxFormValidation(validationFormOptions).init();\r\n\r\n for (let i = 0; i < inputs.length; i++) {\r\n let input = inputs.item(i) as HTMLInputElement;\r\n\r\n if (input.id.length === 0) {\r\n continue;\r\n }\r\n\r\n new AxInput('#' + input.id).init();\r\n }\r\n }\r\n\r\n private initUnitSelectionRadios(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n const radios: NodeListOf<HTMLInputElement> = document.querySelectorAll('input[name=\"unit\"]');\r\n\r\n radios.forEach(radio => {\r\n radio.addEventListener('change', (event) => {\r\n const selectedVal = $(event.currentTarget).val();\r\n productAndRiderDetails.riderData.unitSystem = Number(selectedVal);\r\n this.riderDetailsModule.loadAccountData(productAndRiderDetails.customerAccountNr);\r\n });\r\n });\r\n }\r\n\r\n private initTextInputs(productAndRiderDetails: models.ProductAndRiderDetails, useTextInput: boolean) {\r\n if ($('#City').length > 0) {\r\n $('#City').on('input', e => {\r\n productAndRiderDetails.riderData.city = $('#City').val().toString();\r\n });\r\n }\r\n\r\n if ($('#Phone').length > 0) {\r\n $('#Phone').on('input', e => {\r\n productAndRiderDetails.riderData.phone = $('#Phone').val().toString();\r\n });\r\n }\r\n\r\n if ($('#State').length > 0) {\r\n $('#State').on('input', e => {\r\n productAndRiderDetails.riderData.state = $('#State').val().toString();\r\n });\r\n }\r\n\r\n if ($('#Street').length > 0) {\r\n $('#Street').on('input', e => {\r\n productAndRiderDetails.riderData.street = $('#Street').val().toString();\r\n });\r\n }\r\n\r\n if ($('#ZipCode').length > 0) {\r\n $('#ZipCode').on('input', e => {\r\n productAndRiderDetails.riderData.zipCode = $('#ZipCode').val().toString();\r\n });\r\n }\r\n\r\n if (useTextInput) {\r\n if (this.unitSystem === 1) // imperial == 1\r\n {\r\n if ($('#heightFeet').length > 0) {\r\n $('#heightFeet').on('input', e => {\r\n productAndRiderDetails.riderData.height = Number(this.getInchesToM());\r\n });\r\n }\r\n\r\n if ($('#heightInch').length > 0) {\r\n $('#heightInch').on('input', e => {\r\n productAndRiderDetails.riderData.height = Number(this.getInchesToM());\r\n });\r\n }\r\n\r\n if ($('#Weight').length > 0) {\r\n $('#Weight').on('input', e => {\r\n const weightInLbs = Number($('#Weight').val().toString());\r\n productAndRiderDetails.riderData.weight = this.lbsToKg(weightInLbs);\r\n });\r\n }\r\n } else {\r\n if ($('#Height').length > 0) {\r\n $('#Height').on('input', e => {\r\n const heightInMeter = Number($('#Height').val().toString());\r\n productAndRiderDetails.riderData.height = heightInMeter;\r\n });\r\n }\r\n\r\n if ($('#Weight').length > 0) {\r\n $('#Weight').on('input', e => {\r\n productAndRiderDetails.riderData.weight = Number($('#Weight').val().toString());\r\n });\r\n }\r\n }\r\n }\r\n }\r\n\r\n private kgToLbs(kg: number): number {\r\n const lbs = kg * 2.2046;\r\n return lbs;\r\n }\r\n\r\n private lbsToKg(lbs: number): number {\r\n return lbs * 0.45359237;\r\n }\r\n\r\n private metersToInches(meters: number): number {\r\n const inches = meters * 39.37;\r\n return inches;\r\n }\r\n\r\n private getInchesToM(): number {\r\n const inches = this.getHeightInches();\r\n const meters = inches / 39.370;\r\n return parseFloat(meters.toFixed(2));\r\n }\r\n\r\n private getHeightInches() {\r\n let feet = parseInt($('#heightFeet').val() as string);\r\n let inches = parseInt($('#heightInch').val() as string);\r\n\r\n let convertedInches = this.convertFeetAndInchesToInches(feet, inches);\r\n return convertedInches;\r\n }\r\n\r\n private convertFeetAndInchesToInches(feet: number, inches: number) {\r\n // Convert feet to inches by multiplying by 12\r\n let totalInches = feet * 12;\r\n // Add the remaining inches\r\n totalInches += inches;\r\n // Return the total inches\r\n return totalInches;\r\n }\r\n\r\n private initDropDowns(productAndRiderDetails: models.ProductAndRiderDetails, useTextInput: boolean) {\r\n this.initCountryDropDown(productAndRiderDetails);\r\n this.initGenderDropDown(productAndRiderDetails);\r\n this.initSkillLevelDropDown(productAndRiderDetails);\r\n this.initShoeSizeSystemDropDown(productAndRiderDetails);\r\n this.initShoeSizeDropDown(productAndRiderDetails);\r\n\r\n if (!useTextInput) {\r\n this.initHeightDropDown(productAndRiderDetails);\r\n this.initWeightDropDown(productAndRiderDetails);\r\n }\r\n }\r\n\r\n private async setValueFromProductAndRiderDetailsToForm(productAndRiderDetails: models.ProductAndRiderDetails, useTextInput: boolean) {\r\n return new Promise<void>((resolve) => {\r\n\r\n if ($('#City').length > 0) {\r\n $('#City').val(productAndRiderDetails.riderData.city);\r\n $('#City').text(productAndRiderDetails.riderData.city);\r\n }\r\n\r\n if ($('#Phone').length > 0) {\r\n $('#Phone').val(productAndRiderDetails.riderData.phone);\r\n $('#Phone').text(productAndRiderDetails.riderData.phone);\r\n }\r\n\r\n if ($('#State').length > 0) {\r\n $('#State').val(productAndRiderDetails.riderData.state);\r\n $('#State').text(productAndRiderDetails.riderData.state);\r\n }\r\n\r\n if ($('#Street').length > 0) {\r\n $('#Street').val(productAndRiderDetails.riderData.street);\r\n $('#Street').text(productAndRiderDetails.riderData.street);\r\n }\r\n\r\n if ($('#ZipCode').length > 0) {\r\n $('#ZipCode').val(productAndRiderDetails.riderData.zipCode);\r\n $('#ZipCode').text(productAndRiderDetails.riderData.zipCode);\r\n }\r\n\r\n if (useTextInput) {\r\n if (this.unitSystem === 1) {\r\n\r\n if (productAndRiderDetails.riderData.height != undefined || productAndRiderDetails.riderData.height != null) {\r\n\r\n const heightInInches = this.metersToInches(productAndRiderDetails.riderData.height);\r\n\r\n let feet = Math.floor(heightInInches / 12);\r\n let inches = Math.ceil(heightInInches % 12);\r\n\r\n $('#heightFeet').val(feet).trigger('change');\r\n $('#heightFeet').text(feet);\r\n\r\n $('#heightInch').val(inches).trigger('change');\r\n $('#heightInch').text(inches);\r\n }\r\n\r\n if (productAndRiderDetails.riderData.weight != undefined || productAndRiderDetails.riderData.weight != null) {\r\n\r\n let weightInLbs = this.kgToLbs(productAndRiderDetails.riderData.weight);\r\n let weight = parseFloat(weightInLbs.toFixed(2));\r\n $('#Weight').val(weight).trigger('change');\r\n $('#Weight').text(weight);\r\n }\r\n } else {\r\n if ($('#Height').length > 0) {\r\n\r\n let height = productAndRiderDetails.riderData?.height;\r\n\r\n this.applyMeterMask($('#Height')[0] as HTMLInputElement);\r\n\r\n $('#Height').val(height).trigger('change');\r\n $('#Height').text(height);\r\n }\r\n\r\n if ($('#Weight').length > 0) {\r\n\r\n let weight = productAndRiderDetails.riderData.weight;\r\n\r\n if (weight != undefined || weight != null) {\r\n weight = parseFloat(weight.toFixed(2));\r\n }\r\n\r\n $('#Weight').val(weight).trigger('change');\r\n $('#Weight').text(weight);\r\n }\r\n }\r\n }\r\n\r\n resolve();\r\n });\r\n }\r\n\r\n hasForm(): boolean {\r\n if ($(this.formName).length === 0) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n formIsValid(): boolean {\r\n let valid = $(this.formName)?.valid();\r\n return valid;\r\n }\r\n\r\n setEmptyValues(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n productAndRiderDetails.riderData = new models.RiderData();\r\n productAndRiderDetails.riderData.customerName = \"name\";\r\n productAndRiderDetails.riderData.customerEmail = \"mail\";\r\n }\r\n\r\n private initShoeSizeSystemDropDown(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n if ($('.rental_customer_details-shoeSizeSystem').length === 0) {\r\n return;\r\n }\r\n\r\n this.shoeSizeSystemDropDown = new AxDropdown();\r\n this.shoeSizeSystemDropDown.init(`.rental_customer_details-shoeSizeSystem`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n try {\r\n const value = this.shoeSizeSystemDropDown.getValue().toString();\r\n if (productAndRiderDetails.riderData.shoeSizeSystem !== Number(value)) {\r\n productAndRiderDetails.riderData.shoeSizeSystem = Number(value);\r\n this.riderDetailsModule.loadAccountData(productAndRiderDetails.customerAccountNr);\r\n }\r\n } catch (e) {\r\n\r\n }\r\n }\r\n });\r\n\r\n if (productAndRiderDetails.riderData.shoeSizeSystem != undefined || productAndRiderDetails.riderData.shoeSizeSystem != null) {\r\n this.shoeSizeSystemDropDown.setValue(productAndRiderDetails.riderData.shoeSizeSystem.toString());\r\n }\r\n }\r\n\r\n private initHeightDropDown(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n if ($('.rental_customer_details-height').length === 0) {\r\n return;\r\n }\r\n\r\n this.heightDropDown = new AxDropdown();\r\n this.heightDropDown.init(`.rental_customer_details-height`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n try {\r\n const value = this.heightDropDown.getValue().toString();\r\n $('#Height').val(value);\r\n productAndRiderDetails.riderData.height = Number(value);\r\n } catch (e) {\r\n\r\n }\r\n }\r\n });\r\n\r\n if (productAndRiderDetails.riderData.height != undefined || productAndRiderDetails.riderData.height != null) {\r\n this.heightDropDown.setValue(productAndRiderDetails.riderData.height.toString());\r\n }\r\n }\r\n\r\n private initShoeSizeDropDown(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n if ($('.rental_customer_details-shoeSize').length === 0) {\r\n return;\r\n }\r\n\r\n this.shoeSizeDropDown = new AxDropdown();\r\n this.shoeSizeDropDown.init(`.rental_customer_details-shoeSize`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n try {\r\n const value = this.shoeSizeDropDown.getValue().toString();\r\n $('#ShoeSize').val(value);\r\n productAndRiderDetails.riderData.shoeSize = Number(value);\r\n } catch (e) {\r\n\r\n }\r\n }\r\n });\r\n\r\n if (productAndRiderDetails.riderData.shoeSize != undefined || productAndRiderDetails.riderData.shoeSize != null) {\r\n this.shoeSizeDropDown.setValue(productAndRiderDetails.riderData.shoeSize.toString());\r\n }\r\n }\r\n\r\n private initWeightDropDown(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n if ($('.rental_customer_details-weight').length === 0) {\r\n return;\r\n }\r\n\r\n this.weightDropDown = new AxDropdown();\r\n this.weightDropDown.init(`.rental_customer_details-weight`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n try {\r\n const value = this.weightDropDown.getValue().toString();\r\n $('#Weight').val(value);\r\n productAndRiderDetails.riderData.weight = Number(value);\r\n } catch (e) {\r\n\r\n }\r\n }\r\n });\r\n\r\n if (productAndRiderDetails.riderData.weight != undefined || productAndRiderDetails.riderData.weight != null) {\r\n this.weightDropDown.setValue(productAndRiderDetails.riderData.weight.toString());\r\n }\r\n }\r\n\r\n private initCountryDropDown(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n if ($('.rental_customer_details-country').length === 0) {\r\n return;\r\n }\r\n\r\n this.countryDropDown = new AxDropdown();\r\n this.countryDropDown.init(`.rental_customer_details-country`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n const value = this.countryDropDown.getValue().toString();\r\n $('#CustomerCountry').val(value);\r\n productAndRiderDetails.riderData.country = value;\r\n }\r\n });\r\n\r\n if (productAndRiderDetails.riderData.country != undefined || productAndRiderDetails.riderData.country != null) {\r\n this.countryDropDown.setValue(productAndRiderDetails.riderData.country);\r\n }\r\n }\r\n\r\n private initGenderDropDown(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n if ($('.rental_customer_details-gender').length === 0) {\r\n return;\r\n }\r\n\r\n this.genderDropDown = new AxDropdown();\r\n this.genderDropDown.init(`.rental_customer_details-gender`,\r\n {\r\n searchBar: true,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n const value = this.genderDropDown.getValue().toString();\r\n $('#Gender').val(value);\r\n productAndRiderDetails.riderData.gender = value;\r\n }\r\n });\r\n\r\n if (productAndRiderDetails.riderData.gender != undefined || productAndRiderDetails.riderData.gender != null) {\r\n this.genderDropDown.setValue(productAndRiderDetails.riderData.gender);\r\n }\r\n }\r\n\r\n private initSkillLevelDropDown(productAndRiderDetails: models.ProductAndRiderDetails) {\r\n if ($('.rental_customer_details-skillLevel').length === 0) {\r\n return;\r\n }\r\n\r\n this.skillLevelDropDown = new AxDropdown();\r\n this.skillLevelDropDown.init(`.rental_customer_details-skillLevel`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n const value = this.skillLevelDropDown.getValue().toString();\r\n $('#SkillLevel').val(value);\r\n productAndRiderDetails.riderData.skillLevel = Number(value);\r\n }\r\n });\r\n\r\n if (productAndRiderDetails.riderData.skillLevel != undefined || productAndRiderDetails.riderData.skillLevel != null) {\r\n this.skillLevelDropDown.setValue(productAndRiderDetails.riderData.skillLevel.toString());\r\n }\r\n }\r\n\r\n private getValidationRules(): JQueryValidation.RulesDictionary {\r\n const that = this;\r\n return {\r\n hiddenPhone: {\r\n required: true,\r\n regex: /([0-9]{10})|(\\([0-9]{3}\\)\\s+[0-9]{3}\\-[0-9]{4})/\r\n },\r\n phone: {\r\n required: true,\r\n regex: /([0-9]{10})|(\\([0-9]{3}\\)\\s+[0-9]{3}\\-[0-9]{4})/,\r\n normalizer: function (value) {\r\n let dropdownVal = $(this).parents(\".ax-phone-field\").find(\".hidden-input\").val() as string;\r\n }\r\n },\r\n email: {\r\n required: true,\r\n email: true,\r\n regex: /^\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b$/i,\r\n }\r\n };\r\n }\r\n\r\n applyMeterMask(inputElement: HTMLInputElement) {\r\n const meterFormat = \"[0].[00]\";\r\n //const feetAndInchesFormat = '9999\\'99\"';\r\n\r\n const listener = MaskedTextChangedListener.installOn(meterFormat, inputElement,\r\n new class implements MaskedTextChangedListener.ValueListener {\r\n public onTextChanged(maskFilled: boolean, extractedValue: string, formattedText: string): void {\r\n $('#Height').trigger('input');\r\n }\r\n }(),\r\n [], // affineFormats\r\n [], // customNotations\r\n null, // affinityCalculationStrategy\r\n true // autocomplete\r\n );\r\n }\r\n\r\n applyFeetAndInchesMask(inputElement: HTMLInputElement) {\r\n const feetAndInchesFormat = \"[00]' [00]''\";\r\n //const feetAndInchesFormat = '9999\\'99\"';\r\n\r\n const listener = MaskedTextChangedListener.installOn(feetAndInchesFormat, inputElement,\r\n new class implements MaskedTextChangedListener.ValueListener {\r\n public onTextChanged(maskFilled: boolean, extractedValue: string, formattedText: string): void {\r\n $()\r\n }\r\n }(),\r\n [], // affineFormats\r\n [], // customNotations\r\n null, // affinityCalculationStrategy\r\n true // autocomplete\r\n );\r\n }\r\n}", "import { AxDropdown } from \"@axess/limestone\";\r\nimport { RentalPropertyDto } from \"../../Dto/Rental/Properties/Result/RentalPropertyDto\";\r\n\r\nexport class DropdownOption {\r\n constructor(label: string, value: string) {\r\n this.label = label;\r\n this.value = value;\r\n }\r\n label: string;\r\n value: string;\r\n}\r\n\r\nexport class DropdownComponent {\r\n private selector: string;\r\n private parentId: string;\r\n private element: HTMLElement;\r\n private options: DropdownOption[];\r\n private allRentalProperties: RentalPropertyDto[] = [];\r\n private notAvailableOptions: DropdownOption[] = [];\r\n private labelText: string;\r\n private axDropdown = new AxDropdown();\r\n private ulElement: HTMLUListElement;\r\n private holder: HTMLElement;\r\n\r\n constructor(\r\n selector: string,\r\n parentId: string,\r\n labelText: string,\r\n options: DropdownOption[],\r\n allRentalProperties: RentalPropertyDto[],\r\n onSelectCallback: Function,\r\n ) {\r\n this.selector = selector;\r\n this.parentId = parentId;\r\n this.labelText = labelText;\r\n this.options = options;\r\n this.allRentalProperties = allRentalProperties;\r\n this.render();\r\n this.initAxDropDown(onSelectCallback);\r\n }\r\n\r\n updateOptions(options: DropdownOption[], initialOptions: DropdownOption[] = []) {\r\n const notAvailableOptions: DropdownOption[] = initialOptions.filter((option) => (\r\n !options.some((opt) => opt.value === option.value && opt.label === option.label))\r\n );\r\n this.options = initialOptions;\r\n this.setInactiveOptions(this.allRentalProperties.length > 1 ? notAvailableOptions : []);\r\n this.updateDropdownContent();\r\n }\r\n\r\n private setInactiveOptions(notAvailableOptions: DropdownOption[]) {\r\n this.notAvailableOptions = notAvailableOptions;\r\n }\r\n\r\n isDuplicate(item: DropdownOption, array: DropdownOption[]): boolean {\r\n return array.some(existingItem =>\r\n existingItem.value === item.value &&\r\n existingItem.label === item.label\r\n );\r\n }\r\n\r\n getElement(): HTMLElement {\r\n return this.element;\r\n };\r\n\r\n resetDropDownSelection() {\r\n this.axDropdown.resetSelection();\r\n }\r\n\r\n setValue(value: string) {\r\n this.axDropdown.setValue(value);\r\n }\r\n\r\n setSelectionWithoutEvent(value: string) {\r\n this.axDropdown.setValue(value);\r\n }\r\n\r\n hideDropdown() {\r\n this.holder.style.display = 'none';\r\n }\r\n\r\n showDropdown() {\r\n this.holder.style.display = 'block';\r\n }\r\n\r\n private initAxDropDown(onSelectCallback: Function) {\r\n this.axDropdown = new AxDropdown();\r\n const selector = `.` + this.selector;\r\n this.axDropdown.init(selector,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n let value = '' + this.axDropdown.val();\r\n\r\n if (value === 'select') {\r\n value = null;\r\n }\r\n\r\n onSelectCallback(value);\r\n }\r\n });\r\n }\r\n\r\n private render() {\r\n this.holder = document.createElement('div');\r\n this.holder.classList.add('row', 'p-0', 'ax-mb-2', 'ax-pt-2');\r\n document.getElementById(this.parentId).appendChild(this.holder);\r\n\r\n const dropdown = document.createElement('div');\r\n dropdown.classList.add(this.selector);\r\n dropdown.classList.add('ax-dropdown', 'col-12');\r\n this.holder.appendChild(dropdown);\r\n\r\n const dropdownTrigger = document.createElement('a');\r\n dropdownTrigger.classList.add('ax-dropdown__trigger');\r\n dropdown.appendChild(dropdownTrigger);\r\n\r\n const label = document.createElement('label');\r\n label.classList.add('ax-dropdown__label');\r\n label.textContent = this.labelText;\r\n dropdownTrigger.appendChild(label);\r\n\r\n const selectionSpan = document.createElement('span');\r\n selectionSpan.classList.add('ax-dropdown__selection');\r\n dropdownTrigger.appendChild(selectionSpan);\r\n\r\n this.ulElement = document.createElement('ul');\r\n this.ulElement.classList.add('ax-dropdown__menu');\r\n dropdown.appendChild(this.ulElement);\r\n\r\n this.renderOptions(this.ulElement);\r\n\r\n this.element = dropdown;\r\n }\r\n\r\n private renderOptions(ul: HTMLElement) {\r\n this.options.forEach((option) => {\r\n const optionElement = document.createElement('li');\r\n optionElement.classList.add('ax-dropdown__item');\r\n optionElement.setAttribute('data-value', option.value);\r\n\r\n let notValid = this.notAvailableOptions.includes(option);\r\n\r\n if (notValid) {\r\n optionElement.classList.add('ax-dropdown__item--disabled');\r\n } else {\r\n optionElement.classList.remove('ax-dropdown__item--disabled');\r\n }\r\n\r\n ul.appendChild(optionElement);\r\n\r\n const textLeft = document.createElement('div');\r\n textLeft.classList.add('text-left');\r\n optionElement.appendChild(textLeft);\r\n\r\n const text = document.createElement('div');\r\n text.classList.add('text-body-2');\r\n text.textContent = option.label;\r\n text.innerText = option.label;\r\n text.innerHTML = option.label;\r\n textLeft.appendChild(text);\r\n });\r\n }\r\n\r\n private updateDropdownContent(): void {\r\n this.ulElement.innerHTML = '';\r\n this.renderOptions(this.ulElement);\r\n }\r\n}\r\n\r\n", "export class WtpRentalPropertyRequestData {\r\n constructor(propertyId: number, propertyType: number, isStringValue: boolean) {\r\n this.propertyId = propertyId;\r\n this.propertyType = propertyType;\r\n this.isStringValue = isStringValue;\r\n }\r\n\r\n propertyId: number;\r\n propertyType: number;\r\n propertyNumericValue: number;\r\n propertyTextValue: string;\r\n isStringValue: boolean;\r\n}", "import { RentalPropertyDto } from \"./RentalPropertyDto\";\r\n\r\nexport class GetRentalPropertiesResultDto {\r\n constructor(message: string, success: boolean) {\r\n this.message = message;\r\n this.success = success;\r\n }\r\n\r\n rentalProperties: RentalPropertyDto[];\r\n message: string;\r\n success: boolean;\r\n}", "import { DropdownComponent, DropdownOption } from \"../../../../Components/AxForm/DropDownComponent\";\r\nimport { WtpRentalPropertyRequestData } from \"../../../../Dto/Rental/Properties/Request/WtpRentalPropertyRequestData\";\r\nimport { GetRentalPropertiesResultDto } from \"../../../../Dto/Rental/Properties/Result/GetRentalPropertiesResultDto\";\r\nimport { RentalPropertyDto } from \"../../../../Dto/Rental/Properties/Result/RentalPropertyDto\";\r\nimport { RentalPropertyValueDto } from \"../../../../Dto/Rental/Properties/Result/RentalPropertyValueDto\";\r\nimport { I18nHelper, Translations } from \"../../../../Lib/Helper/I18nHelper\";\r\nimport { RandomHelper } from \"../../../../Lib/Helper/RandomHelper\";\r\nimport { AxLoading } from \"../../../../Limestone/AxLoading/AxLoading\";\r\nimport * as models from \"../RiderDetailsModelBundle\";\r\n\r\nconst setSelectedProperties = (portlet) => (property) => {\r\n const retrievedProperty = portlet.allPropertiesToSelect.find((prop) => (\r\n prop.getWtpRentalPropertyRequestData().propertyId === property.propertyId\r\n ));\r\n if (retrievedProperty) {\r\n retrievedProperty.setValue(property.propertyNumericValue.toString());\r\n }\r\n}\r\nexport class RentalPropertiesSelection {\r\n private portlets: RentalPropertyPortlet[] = [];\r\n\r\n private prodRiderAndDetails: models.ProductAndRiderDetails;\r\n private i18nHelper = new I18nHelper();\r\n\r\n private arcNr: number;\r\n private durationId: number;\r\n private rentalStartSoapDateTime: string;\r\n\r\n private projNr: number;\r\n\r\n private allRentalProperties: RentalPropertyDto[] = [];\r\n\r\n constructor(prodRiderAndDetails: models.ProductAndRiderDetails) {\r\n this.prodRiderAndDetails = prodRiderAndDetails;\r\n\r\n this.arcNr = prodRiderAndDetails.locationAndTimeSelection.selectedLocationId;\r\n this.durationId = prodRiderAndDetails.locationAndTimeSelection.durationId;\r\n this.rentalStartSoapDateTime = prodRiderAndDetails.locationAndTimeSelection.startDateTime;\r\n\r\n this.projNr = prodRiderAndDetails.productTripleWithType.projNr;\r\n\r\n let portlet: RentalPropertyPortlet;\r\n if (this.prodRiderAndDetails.includedPackageItems?.length > 0) {\r\n this.prodRiderAndDetails.includedPackageItems.forEach((item) => {\r\n portlet = new RentalPropertyPortlet(\r\n item.productId,\r\n item.productName,\r\n item.packagePosition\r\n );\r\n this.portlets = [...this.portlets, portlet];\r\n this.initialLoadAllRentalPropertiesAndShowDropDowns(portlet);\r\n });\r\n } else {\r\n portlet = new RentalPropertyPortlet(\r\n this.prodRiderAndDetails.productTripleWithType.id,\r\n this.prodRiderAndDetails.productName\r\n );\r\n this.portlets = [...this.portlets, portlet];\r\n this.initialLoadAllRentalPropertiesAndShowDropDowns(portlet);\r\n }\r\n }\r\n\r\n private createOnSelectCallback(portlet: RentalPropertyPortlet, propertyToSelect: PropertyToSelect): (selectedValue: string) => void {\r\n return (selectedValue: string) => {\r\n const property = propertyToSelect.getWtpRentalPropertyRequestData();\r\n\r\n if (\r\n (property?.isStringValue && property?.propertyTextValue === selectedValue)\r\n || (property?.propertyNumericValue?.toString() === selectedValue)\r\n ) {\r\n return;\r\n }\r\n\r\n // remove the selected property from the list to prevent duplicates\r\n this.prodRiderAndDetails.selectedProperties = this.prodRiderAndDetails.selectedProperties.filter((item) => (\r\n item.propertyId !== property.propertyId\r\n ));\r\n\r\n // if default value is selected reload without the selected property\r\n if (!selectedValue || selectedValue == '') {\r\n propertyToSelect.resetDropDownSelection();\r\n this.reloadAllRentalPropertiesAndShowDropDowns(portlet);\r\n return;\r\n }\r\n\r\n\r\n // set the selected value to the property depending on the type\r\n if (property.isStringValue) {\r\n propertyToSelect.setStringValue(selectedValue);\r\n } else {\r\n propertyToSelect.setNumericValue(selectedValue);\r\n }\r\n\r\n // add the selected value to the list\r\n if (this.prodRiderAndDetails.includedPackageItems.length > 0) {\r\n const packItem = this.prodRiderAndDetails.includedPackageItems.find(x => x.productId == portlet.itemId && x.packagePosition == portlet.packagePosition);\r\n if (packItem) {\r\n packItem.selectedProperties = [\r\n ...(packItem?.selectedProperties || []),\r\n propertyToSelect.getWtpRentalPropertyRequestData(),\r\n ];\r\n }\r\n } else {\r\n this.prodRiderAndDetails.selectedProperties = [\r\n ...(this.prodRiderAndDetails?.selectedProperties || []),\r\n propertyToSelect.getWtpRentalPropertyRequestData(),\r\n ];\r\n }\r\n\r\n this.reloadAllRentalPropertiesAndShowDropDowns(portlet);\r\n };\r\n }\r\n\r\n private initialLoadAllRentalPropertiesAndShowDropDowns(portlet: RentalPropertyPortlet) {\r\n portlet.showLoadingSpinner();\r\n\r\n this.getAllRentalPropertiesForItem(portlet.itemId)\r\n .then((result) => {\r\n if (result.success === false) {\r\n portlet.hideLoadingSpinner();\r\n return;\r\n }\r\n\r\n portlet.renderPortlet();\r\n\r\n this.allRentalProperties = result.rentalProperties;\r\n result.rentalProperties?.forEach((property) => {\r\n const requestData = new WtpRentalPropertyRequestData(\r\n property.propertyId,\r\n property.rentalPropertyValues[0].propertyTye,\r\n !!property.rentalPropertyValues[0].propertyStringValue,\r\n );\r\n\r\n const propertySelection = new PropertyToSelect(requestData);\r\n const options = propertySelection.createOptionsFromRentalPropertyValues(property.rentalPropertyValues);\r\n const onSelectCallback = this.createOnSelectCallback(portlet, propertySelection);\r\n const dropDown = new DropdownComponent(\r\n `dropDown_${portlet.portletBody.id}-${property.propertyId}`,\r\n portlet.portletBody.id,\r\n property.propertyName,\r\n options,\r\n this.allRentalProperties,\r\n onSelectCallback,\r\n );\r\n\r\n propertySelection.setInitalOptions(options);\r\n propertySelection.setDropdownComponent(dropDown);\r\n propertySelection.setActive();\r\n portlet.allPropertiesToSelect = [...(portlet.allPropertiesToSelect || []), propertySelection];\r\n\r\n // load for setting already selected properties\r\n if (this.prodRiderAndDetails.selectedProperties.length > 0) {\r\n this.setSelectedForSingle(portlet);\r\n } else {\r\n this.setSelectedForPackage(portlet);\r\n }\r\n });\r\n })\r\n .finally(() => portlet.hideLoadingSpinner());\r\n }\r\n\r\n private setSelectedForSingle(portlet: RentalPropertyPortlet) {\r\n this.prodRiderAndDetails.selectedProperties?.forEach(setSelectedProperties(portlet));\r\n }\r\n\r\n private setSelectedForPackage(portlet: RentalPropertyPortlet) {\r\n const packItem = this.prodRiderAndDetails.includedPackageItems.find((item)=> (\r\n item.productId === portlet.itemId && item.packagePosition === portlet.packagePosition)\r\n );\r\n\r\n if (!packItem || !packItem.selectedProperties || packItem.selectedProperties?.length === 0) {\r\n return;\r\n }\r\n\r\n packItem.selectedProperties?.forEach(setSelectedProperties(portlet));\r\n }\r\n\r\n private reloadAllRentalPropertiesAndShowDropDowns(portlet: RentalPropertyPortlet) {\r\n portlet.showLoadingSpinner();\r\n\r\n this.getAllRentalPropertiesForItemFiltered(portlet.itemId)\r\n .then((result) => {\r\n // update the dropdowns/properties to select\r\n portlet.allPropertiesToSelect?.forEach((propertyToSelect) => {\r\n const property = result.rentalProperties.find(x => x.propertyId == propertyToSelect.getWtpRentalPropertyRequestData().propertyId);\r\n if (property) {\r\n const options = propertyToSelect.createOptionsFromRentalPropertyValues(property.rentalPropertyValues);\r\n propertyToSelect.upDateDropDownOptions(options);\r\n } else {\r\n propertyToSelect.upDateDropDownOptions([]);\r\n }\r\n\r\n });\r\n })\r\n .finally(() => portlet.hideLoadingSpinner());\r\n }\r\n\r\n private async getAllRentalPropertiesForItem(itemId: number): Promise<GetRentalPropertiesResultDto> {\r\n const url = `/api/GetRentalPropertiesApi/GetAllRentalPropertiesForItem`;\r\n const data = {\r\n ArcNr: this.arcNr,\r\n ProjNr: this.projNr,\r\n RentalItemNr: itemId,\r\n RentalStartSoapDateTime: this.rentalStartSoapDateTime,\r\n DurationId: this.durationId,\r\n };\r\n\r\n return new Promise<GetRentalPropertiesResultDto>((resolve) => {\r\n AxessViewer.ajaxRequest(url, data, (res) => {\r\n resolve(this.GetResultFromResponse(res));\r\n }, {\r\n type: 'Post',\r\n });\r\n });\r\n }\r\n\r\n private async getAllRentalPropertiesForItemFiltered(itemId: number): Promise<GetRentalPropertiesResultDto> {\r\n const url = `/api/GetRentalPropertiesApi/GetAllRentalPropertiesForItemFiltered`;\r\n const data = {\r\n ArcNr: this.arcNr,\r\n ProjNr: this.projNr,\r\n RentalItemNr: itemId,\r\n RentalStartSoapDateTime: this.rentalStartSoapDateTime,\r\n DurationId: this.durationId,\r\n wtpRentalProperties: this.prodRiderAndDetails.selectedProperties,\r\n };\r\n\r\n return new Promise<GetRentalPropertiesResultDto>((resolve) => {\r\n AxessViewer.ajaxRequest(url, data, (res) => {\r\n resolve(this.GetResultFromResponse(res));\r\n }, {\r\n type: 'Post',\r\n });\r\n });\r\n }\r\n\r\n private GetResultFromResponse(res: any): GetRentalPropertiesResultDto {\r\n const getRentalPropertiesResult = new GetRentalPropertiesResultDto('', true);\r\n\r\n if (res.Success === false) {\r\n getRentalPropertiesResult.message = res.message;\r\n getRentalPropertiesResult.success = false;\r\n return getRentalPropertiesResult;\r\n }\r\n\r\n getRentalPropertiesResult.rentalProperties = res.RentalProperties?.map((property) => {\r\n const rentalPropertyValues = property.RentalPropertyValues?.map((value) => (<RentalPropertyValueDto> {\r\n propertyTye: value.PropertyTye,\r\n propertyNumberValue: value.PropertyNumberValue,\r\n propertyStringValue: value.PropertyStringValue,\r\n showPropertyValue: value.ShowPropertyValue,\r\n isStringVal: value.PropertyStringValue,\r\n }));\r\n return <RentalPropertyDto> {\r\n propertyId: property.PropertyId,\r\n propertyName: property.PropertyName,\r\n availableItems: property.AvailableItems,\r\n rentalPropertyValues,\r\n }\r\n });\r\n return getRentalPropertiesResult;\r\n }\r\n}\r\n\r\nclass RentalPropertyPortlet {\r\n portlet: HTMLDivElement ;\r\n portletBody: HTMLDivElement;\r\n alert: HTMLDivElement;\r\n\r\n private axLoading: AxLoading;\r\n private i18nHelper = new I18nHelper();\r\n\r\n itemId: number;\r\n itemName: string;\r\n packagePosition?: number;\r\n\r\n allPropertiesToSelect: PropertyToSelect[] = [];\r\n\r\n constructor(itemId: number, itemName: string, packagePosition?: number) {\r\n this.axLoading = new AxLoading();\r\n this.itemId = itemId;\r\n this.itemName = itemName;\r\n this.packagePosition = packagePosition;\r\n }\r\n\r\n renderPortlet() {\r\n const holder = document.getElementsByClassName('rental_detail_rider__right_container-rental-properties')[0];\r\n\r\n this.portlet = document.createElement('div');\r\n this.portlet.classList.add('ax-portlet', 'ax-portlet--md', 'ax-mt-2', 'rental-properties__portlet');\r\n holder.appendChild(this.portlet);\r\n\r\n this.portletBody = document.createElement('div');\r\n this.portletBody.classList.add('ax-portlet__body', 'rental-properties__portlet_body', 'position-relative');\r\n this.portletBody.id = RandomHelper.GenerateUniqueId();\r\n this.portlet.appendChild(this.portletBody);\r\n\r\n const header = document.createElement('h4');\r\n header.classList.add('ax-pb-2');\r\n header.innerHTML = `${this.itemName} - ${this.i18nHelper.GetTranslation(Translations.RentalNoProperties)}`;\r\n this.portletBody.appendChild(header);\r\n\r\n this.alert = document.createElement('div');\r\n this.alert.classList.add('ax-alert');\r\n this.alert.classList.add('ax-alert--inline');\r\n this.alert.classList.add('ax-alert--success');\r\n this.alert.innerHTML = this.i18nHelper.GetTranslation(Translations.RentalYouCanSkipThisPart);\r\n this.portletBody.appendChild(this.alert);\r\n }\r\n\r\n setNoPropertiesAvailableAlert() {\r\n this.alert.innerHTML = `${this.itemName} - ${this.i18nHelper.GetTranslation(Translations.RentalNoProperties)}`;\r\n this.alert.classList.remove('ax-alert--success');\r\n this.alert.classList.add('ax-alert--info');\r\n }\r\n\r\n showLoadingSpinner() {\r\n this.axLoading.ShowLoadingIndicator(this.portletBody);\r\n }\r\n\r\n hideLoadingSpinner() {\r\n this.axLoading.HideLoadingIndicator(this.portletBody);\r\n }\r\n}\r\n\r\nclass PropertyToSelect {\r\n constructor(wtpRentalPropertyRequestData: WtpRentalPropertyRequestData) {\r\n this.wtpRentalPropertyRequestData = wtpRentalPropertyRequestData;\r\n }\r\n\r\n private isActive: boolean = false;\r\n private dropdownComponent: DropdownComponent;\r\n private wtpRentalPropertyRequestData: WtpRentalPropertyRequestData;\r\n private i18nHelper = new I18nHelper();\r\n\r\n private initialOptions: DropdownOption[] = [];\r\n\r\n setNumericValue(value: string) {\r\n this.wtpRentalPropertyRequestData.propertyNumericValue = Number(value);\r\n }\r\n\r\n setInitalOptions(options: DropdownOption[]) {\r\n this.initialOptions = options;\r\n }\r\n\r\n setStringValue(value: string) {\r\n this.wtpRentalPropertyRequestData.propertyTextValue = value;\r\n }\r\n\r\n setDropdownComponent(dropdownComponent: DropdownComponent) {\r\n this.dropdownComponent = dropdownComponent;\r\n }\r\n\r\n resetDropDownSelection() {\r\n this.dropdownComponent.resetDropDownSelection();\r\n }\r\n\r\n getWtpRentalPropertyRequestData(): WtpRentalPropertyRequestData {\r\n return this.wtpRentalPropertyRequestData;\r\n }\r\n\r\n createOptionsFromRentalPropertyValues(availableValues: RentalPropertyValueDto[]): DropdownOption[] {\r\n const options: DropdownOption[] = availableValues.map((value) => (\r\n new DropdownOption(\r\n value.showPropertyValue, value.isStringVal\r\n ? value.propertyStringValue\r\n : value.propertyNumberValue.toString()\r\n )\r\n ));\r\n options.unshift(this.getDefaultOption());\r\n return options;\r\n }\r\n\r\n upDateDropDownOptions(options: DropdownOption[]) {\r\n this.dropdownComponent.updateOptions(options, this.initialOptions);\r\n }\r\n\r\n setValue(value: string) {\r\n this.dropdownComponent.setValue(value);\r\n }\r\n\r\n setActive(): void {\r\n this.isActive = true;\r\n this.dropdownComponent.showDropdown();\r\n }\r\n\r\n setInactive(): void {\r\n this.isActive = false;\r\n this.dropdownComponent.hideDropdown();\r\n }\r\n\r\n private getDefaultOption(): DropdownOption {\r\n const defaultOption = new DropdownOption(this.i18nHelper.GetTranslation(Translations.ResetSelection), 'select');\r\n return defaultOption;\r\n }\r\n}", "\r\nexport * from \"./Components/RiderSelection\";\r\nexport * from \"./Components/ProductInfoPortlet\";\r\nexport * from \"./Components/LockerData\";\r\nexport * from \"./Components/PersonDataForm\";\r\nexport * from \"./Components/RentalPropertiesSelection\";\r\nexport * from \"../../../Models/Rental/RiderDetails/ProductAndRiderDetails\";\r\n\r\nexport namespace Components {\r\n export class RiderDetailsCompBundle {}\r\n}", "import { AxDatePicker, Cell, Mode, Options } from \"../../Components/AxDatepicker/AxDatepicker\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { AxCounter } from '../../Limestone/AxCounter/AxCounter';\r\nimport { AxDropdown } from \"@axess/limestone\"\r\nimport { Subject } from \"rxjs\";\r\n\r\nexport class LessonFilter {\r\n datePickers: AxDatePicker[];\r\n initData: ILessonFilterInitData;\r\n\r\n levelDropdown: AxDropdown;\r\n pTypeDropdown: AxDropdown;\r\n dateDropdown: AxDropdown;\r\n\r\n currentSearch: SearchDto;\r\n currentSearchDate: moment.Moment;\r\n\r\n searchSubjection: Subject<SearchDto>;\r\n searchUpdateSubject: Subject<SearchDto>;\r\n\r\n counterArr: AxCounter[];\r\n\r\n init(initData: ILessonFilterInitData) {\r\n this.counterArr = [];\r\n this.searchSubjection = new Subject<SearchDto>();\r\n this.searchUpdateSubject = new Subject<SearchDto>();\r\n this.initData = initData;\r\n this.initLibs();\r\n this.initEventHandler();\r\n }\r\n\r\n updateDate(date: string) {\r\n let dateM = moment(date, 'YYYY-MM-DD');\r\n\r\n for (let picker of this.datePickers) {\r\n picker.setDate(dateM);\r\n }\r\n }\r\n\r\n setDefaults(searchDto: SearchDto) {\r\n if (searchDto.date != null && searchDto.date != '') {\r\n for (let picker of this.datePickers) {\r\n picker.setDate(moment(searchDto.date, 'YYYY-MM-DD'));\r\n }\r\n }\r\n\r\n if (searchDto.levels != null && searchDto.levels.length > 0) {\r\n for (const level of searchDto.levels) {\r\n $(`input[name=\"lessonPackage_filter_level-input\"][value=\"${level}\"]`).prop('checked', true);\r\n }\r\n }\r\n\r\n if (searchDto.locations != null && searchDto.locations.length > 0) {\r\n for (const location of searchDto.locations) {\r\n $(`input[name=\"lessonPackage_filter_location-input\"][value=\"${location}\"]`).prop('checked', true);\r\n }\r\n }\r\n\r\n if (searchDto.quantity != null && searchDto.quantity.length > 0) {\r\n for (const quantity of searchDto.quantity.filter(x => x.quantity > 0)) {\r\n this.counterArr[quantity.id].setValue(quantity.quantity);\r\n }\r\n }\r\n\r\n this.currentSearch = searchDto;\r\n }\r\n\r\n getSearchUpdateSubject() {\r\n return this.searchUpdateSubject;\r\n }\r\n\r\n getSearchSubject() {\r\n return this.searchSubjection;\r\n }\r\n\r\n initLibs() {\r\n this.datePickers = [];\r\n\r\n //Datepicker has to be invoked before dropdowns since tippy removes them from DOM\r\n const datePickerOptions: Options = {\r\n StartOfWeek: this.initData.startOfWeek,\r\n Lang: this.initData.lang,\r\n StartDate: moment(),\r\n DayRange: 0,\r\n Target: '#tariff_date_mobile',\r\n Mode: Mode.Endless,\r\n LegendTarget: '#tariff_date_mobile__legend',\r\n scrollTargetQuerySelector: '[data-lp-landing=\"datepicker\"]'\r\n };\r\n let tmp = new AxDatePicker();\r\n tmp.Init(datePickerOptions);\r\n this.datePickers.push(tmp);\r\n\r\n for (let elem of $(`[data-display-lp=\"datepicker\"]`)) {\r\n let tmp2 = new AxDatePicker();\r\n tmp2.Init({\r\n StartOfWeek: this.initData.startOfWeek,\r\n Lang: this.initData.lang,\r\n StartDate: moment(),\r\n DayRange: 0,\r\n Target: elem,\r\n Mode: Mode.Inline,\r\n EndDate: null,\r\n monthsShown: 1\r\n });\r\n this.datePickers.push(tmp2);\r\n }\r\n\r\n\r\n this.levelDropdown = new AxDropdown();\r\n this.levelDropdown.init('.lessonPackage_filter_level-drpdn');\r\n\r\n this.pTypeDropdown = new AxDropdown();\r\n this.pTypeDropdown.init('.lessonPackage_filter_pType-drpdn');\r\n\r\n this.dateDropdown = new AxDropdown();\r\n this.dateDropdown.init('.lessonPackage_filter_date-drpdn');\r\n\r\n\r\n for (let pType of this.initData.pTypes) {\r\n const tmpCounter = new AxCounter();\r\n tmpCounter.Init({\r\n Selector: `.filter__counter_${pType.id}`,\r\n Value: pType.quantity\r\n });\r\n\r\n tmpCounter.Subscribe(n => {\r\n pType.quantity = n;\r\n this.updatePTypeText();\r\n this.saveSearchValues();\r\n });\r\n\r\n this.counterArr[pType.id] = tmpCounter;\r\n }\r\n this.updatePTypeText();\r\n this.saveSearchValues();\r\n }\r\n\r\n initEventHandler() {\r\n for (let picker of this.datePickers) {\r\n picker.ActivationSubject.subscribe((cell: Cell) => {\r\n if (cell != null) {\r\n this.setDate(cell);\r\n\r\n if ($(picker.parentElement).is('[data-display-lp-calendar-nav=\"trigger\"]')) {\r\n this.triggerSearch();\r\n }\r\n }\r\n });\r\n }\r\n $('.lessonPackage_filter-search').on('click',\r\n () => {\r\n this.triggerSearch();\r\n });\r\n\r\n $('input[name=lessonPackage_filter_location-input]').on('change',\r\n (e) => {\r\n let $target = $(e.delegateTarget);\r\n $(`input[name=lessonPackage_filter_location-input][value=${$target.val()}]`).prop('checked', $target.prop('checked'));\r\n\r\n this.saveSearchValues();\r\n });\r\n\r\n $('input[name=lessonPackage_filter_level-input]').on('change',\r\n () => {\r\n this.updateLessonLevelText();\r\n this.saveSearchValues();\r\n });\r\n }\r\n\r\n triggerSearch() {\r\n if (this.currentSearch?.date != null) {\r\n const currentMom = moment(this.currentSearch.date, 'YYYY-MM-DD');\r\n\r\n if (currentMom.isValid()) {\r\n for (let p of this.datePickers) {\r\n p.setDate(currentMom, false);\r\n }\r\n let monthDisplay = $('[data-display-lp-calendar-nav=\"month\"]');\r\n\r\n if (monthDisplay.length > 0) {\r\n this.dateDropdown.setValue(currentMom.format(`MMMM YYYY`), monthDisplay);\r\n }\r\n }\r\n }\r\n this.searchSubjection.next(this.currentSearch);\r\n }\r\n\r\n saveSearchValues() {\r\n const searchData = new SearchDto();\r\n\r\n searchData.levels = [];\r\n for (let checkbox of $('input[name=lessonPackage_filter_level-input]:checked')) {\r\n searchData.levels.push(parseInt($(checkbox).val() as string));\r\n }\r\n\r\n searchData.locations = [];\r\n for (let checkbox of $('input[name=lessonPackage_filter_location-input]:checked')) {\r\n searchData.locations.push(parseInt($(checkbox).val() as string));\r\n }\r\n\r\n searchData.quantity = [];\r\n for (let pType of this.initData.pTypes) {\r\n searchData.quantity.push({\r\n id: pType.id,\r\n quantity: pType.quantity\r\n });\r\n }\r\n\r\n const currentDateValue = this.currentSearchDate;\r\n\r\n if (currentDateValue != null) {\r\n searchData.date = this.currentSearchDate.format(\"YYYY-MM-DD\");\r\n }\r\n\r\n this.currentSearch = searchData;\r\n this.searchUpdateSubject.next(this.currentSearch);\r\n }\r\n\r\n setDate(cell: Cell) {\r\n if (cell != null) {\r\n this.dateDropdown.setValue(cell.Date.format(this.initData.datePattern));\r\n this.dateDropdown.close();\r\n this.currentSearchDate = cell.Date;\r\n this.saveSearchValues();\r\n }\r\n }\r\n\r\n updateLessonLevelText() {\r\n if ($('.lessonPackage_filter_level-drpdn').length === 0) return;\r\n\r\n let selectedLevelNames = [];\r\n $('input[name=lessonPackage_filter_level-input]:checked').each((i, e) => {\r\n selectedLevelNames.push($(e).parent().find('.lessonPackage_filter_level-name span').text());\r\n });\r\n\r\n if (selectedLevelNames.length > 0) {\r\n this.levelDropdown.setValue(selectedLevelNames.join(' • '));\r\n } else {\r\n this.levelDropdown.resetSelection();\r\n }\r\n }\r\n\r\n updatePTypeText() {\r\n if ($('.lessonPackage_filter_pType-drpdn').length === 0) return;\r\n\r\n let text: string[] = [];\r\n for (let pType of this.initData.pTypes) {\r\n if (pType.quantity === 0 || pType.quantity == null) continue;\r\n\r\n text.push(`${pType.quantity}x ${this.decodeHtml(pType.name)}`);\r\n }\r\n\r\n if (text.length > 0) {\r\n this.pTypeDropdown.setValue(text.join(' • '));\r\n } else {\r\n this.pTypeDropdown.resetSelection();\r\n }\r\n }\r\n\r\n decodeHtml(html: string) {\r\n let txt = document.createElement(\"textarea\");\r\n txt.innerHTML = html;\r\n return txt.value;\r\n }\r\n}\r\nexport interface ILessonFilterInitData {\r\n startOfWeek: number;\r\n lang: string;\r\n datePattern: string;\r\n pTypes: IPersonTypeList[];\r\n targetUrl: string;\r\n}\r\n\r\nexport interface IPersonTypeList {\r\n id: number;\r\n name: string;\r\n quantity: number;\r\n}\r\n\r\nexport class SearchDto {\r\n quantity?: { id: number; quantity: number; }[];\r\n levels?: number[];\r\n locations?: number[];\r\n date?: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxModal } from \"@axess/limestone\"\r\nimport { ILessonFilterInitData, LessonFilter, SearchDto } from \"./LessonFilter\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { LessonPackageStorage } from \"./LessonPackageStorage\"\r\n\r\n@ModuleName(\"LessonPackage.LandingPage\")\r\nexport class LandingPage implements AxInit {\r\n levelModal: AxModal;\r\n pTypeModal: AxModal;\r\n dateModal: AxModal;\r\n initData: ILessonFilterInitData;\r\n\r\n packageStorage: LessonPackageStorage;\r\n\r\n constructor(private _lessonFilter = new LessonFilter(), private _requestHelper = new RequestHelper()) { }\r\n\r\n AxInit(initData: ILessonFilterInitData): void {\r\n this.initData = initData;\r\n\r\n //LevelStuff\r\n this.levelModal = new AxModal();\r\n this.levelModal.init({\r\n selector: '.lessonPackage_filter_level-drpdn'\r\n });\r\n\r\n //personTypeStuff\r\n this.pTypeModal = new AxModal();\r\n this.pTypeModal.init({\r\n selector: '.lessonPackage_filter_pType-drpdn'\r\n });\r\n\r\n //dateStuff\r\n this.dateModal = new AxModal();\r\n this.dateModal.init({\r\n selector: '.lessonPackage_filter_date-drpdn',\r\n closeModalBtnSelector: '.lessonPackage_landing_close'\r\n });\r\n\r\n $('.lessonPackage_landing_level-next').on('click',\r\n () => {\r\n this.levelModal.close($('#lessonPackage_landing_level-modal')[0]);\r\n });\r\n\r\n $('.lessonPackage_landing_pType-next').on('click',\r\n () => {\r\n this.levelModal.close($('#lessonPackage_landing_pType-modal')[0]);\r\n });\r\n \r\n $('.lessonPackage_landing_date-next').on('click',\r\n () => {\r\n this.levelModal.close($('#lessonPackage_landing_date-modal')[0]);\r\n });\r\n\r\n this.search.bind(this);\r\n this._lessonFilter.init(initData);\r\n\r\n\r\n this.packageStorage = AxLoad.GetModule<LessonPackageStorage>(\"LessonPackageStorage\");\r\n const defaultLevel = this.packageStorage.getDefaultLevelStorage();\r\n\r\n if (defaultLevel != null && defaultLevel.length !== 0) {\r\n this._lessonFilter.setDefaults({\r\n levels: defaultLevel\r\n });\r\n this._lessonFilter.updateLessonLevelText();\r\n }\r\n\r\n\r\n this._lessonFilter.getSearchSubject().subscribe((x) => {\r\n this.packageStorage.cleanDefaultLevelStorage();\r\n this.search(x);\r\n });\r\n }\r\n\r\n search(currentSearch: SearchDto) {\r\n this._requestHelper.postToUrl(this.initData.targetUrl, currentSearch);\r\n }\r\n}\r\n", "import { AxInit } from \"../Lib/AxSystem/AxInit\";\r\nimport { BodyUtility } from \"../Components/AxUtility/BodyUtility\";\r\nimport { ModuleName } from \"../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"AxFilterOverlay\")\r\nexport class AxFilterOverlay implements AxInit {\r\n constructor(private _bodyUtility = new BodyUtility()) { }\r\n\r\n AxInit(init): void {\r\n $('body').on('click', '[data-toggle=\"filterBar\"]', e => {\r\n if ($('.filter_bar').hasClass('active')) {\r\n this.toggleFilterBar(false);\r\n }\r\n window.scrollTo(0, 0);\r\n this.toggleFilterBar(true);\r\n });\r\n\r\n $('.filter_bar .filter_bar-close').click(e => {\r\n this.toggleFilterBar(false);\r\n });\r\n }\r\n\r\n toggleFilterBar(active: boolean) {\r\n $('.filter_bar').toggleClass('active', active);\r\n\r\n if (active) {\r\n this._bodyUtility.enableOverlay();\r\n } else {\r\n this._bodyUtility.disableOverlay();\r\n }\r\n }\r\n}", "import { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { LocalizationModule } from \"../Global/LocalizationModule\";\r\nimport { LessonFilter } from \"./LessonFilter\";\r\nimport { PriceHelper } from \"../../Lib/Helper/PriceHelper\";\r\nimport { AxModal } from \"@axess/limestone\"\r\nimport { ProductTriple } from \"../../Models/Products/ProductTriple\";\r\nimport { ILessonPackageSelectionInit } from \"./Selection\";\r\nimport { AxCounter } from '../../Limestone/AxCounter/AxCounter';\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\n\r\nexport class SelectionAddSlot {\r\n constructor(private _priceHelper = new PriceHelper(null, false),\r\n private _requestHelper = new RequestHelper(),\r\n private _i18nHelper = new I18nHelper,\r\n private _axLimestone = new AxLimeStone(),\r\n private _axLoading = new AxLoading()) { }\r\n\r\n localizationModule: LocalizationModule;\r\n pTypeSelectionModal: AxModal;\r\n summaryListModal: AxModal;\r\n lessonFilter: LessonFilter;\r\n initData: ILessonPackageSelectionInit;\r\n\r\n counterArr: AxCounter[] = [];\r\n\r\n displayedResult: ISelectionSlotResult;\r\n currentAvailableSlots: number = 0;\r\n\r\n cart: SelectionCart[] = [];\r\n\r\n init(lessonFilter: LessonFilter, init: ILessonPackageSelectionInit) {\r\n this.lessonFilter = lessonFilter;\r\n this.initData = init;\r\n this.localizationModule = AxLoad.GetModule<LocalizationModule>('LocalizationModule');\r\n\r\n this.pTypeSelectionModal = new AxModal();\r\n this.pTypeSelectionModal.init({\r\n selector: '.lessonPackage_filter_level-drpdn'\r\n });\r\n\r\n this.summaryListModal = new AxModal();\r\n this.summaryListModal.init({\r\n selector: '[data-display-lp-summary=\"expand\"]'\r\n });\r\n this.initCounter();\r\n this.checkQuantity();\r\n\r\n\r\n $('[data-trigger-lp=\"addSlot\"]').on('click',\r\n () => {\r\n this.addToTmpCart();\r\n this.pTypeSelectionModal.close($('#lessonPackage_selection_pType-modal')[0]);\r\n });\r\n\r\n $('[data-trigger-lp=\"editSlot\"]').on('click',\r\n () => {\r\n this.editToTmpCart();\r\n this.pTypeSelectionModal.close($('#lessonPackage_selection_pType-modal')[0]);\r\n });\r\n\r\n //$('[data-display-lp-summary=\"expand\"]').on('click',\r\n // () => {\r\n // $('[data-display-lp-summary=\"detail\"]').toggleClass('d-none');\r\n // $('[data-display-lp-summary=\"expand\"] i').toggleClass('la-angle-up la-angle-down');\r\n // });\r\n\r\n\r\n $('[data-display-lp-summary=\"slotList\"]').on('click',\r\n \"button[data-lessonwebnr][data-arc][data-lessondefnr][data-lessonnr]\",\r\n (e) => {\r\n this.summaryListModal.close(document.getElementById(`lessonPackage_summaryList-modal`));\r\n this.loadSlotList(e.currentTarget, $(e.currentTarget).attr('data-date')).then(x => {\r\n this.setEditStateToModal();\r\n });\r\n });\r\n\r\n $('[data-display-lp-summary=\"submit\"]').on('click',\r\n () => {\r\n const dataToSend = this.cart.map(x => {\r\n return x.packages.filter(y => y.quantity > 0).map((y) => {\r\n return {\r\n ...y,\r\n ...{\r\n from: x.from,\r\n to: x.to,\r\n lessonNr: x.lessonNr,\r\n lessonWebNr: x.lessonWebNr,\r\n lessonArcNr: x.arcNr,\r\n lessonDefNr: x.lessonDefNr,\r\n lessonPackagePositionNr: y.packagePosNr\r\n }\r\n }\r\n });\r\n }).reduce((pre, cur) => {\r\n return pre.concat(cur);\r\n }).map(y => {\r\n return {\r\n ...y.productTriple,\r\n ...{\r\n quantity: y.quantity,\r\n from: y.from,\r\n to: y.to,\r\n lessonNr: y.lessonNr,\r\n lessonWebNr: y.lessonWebNr,\r\n lessonArcNr: y.lessonArcNr,\r\n lessonDefNr: y.lessonDefNr,\r\n lessonPackagePositionNr: y.lessonPackagePositionNr\r\n }\r\n }\r\n });\r\n\r\n const queryString = this._requestHelper.base64UrlSave(dataToSend);\r\n\r\n window.location.href = `${this.initData.submitUrl}?r=${queryString}`;\r\n //this._requestHelper.postToUrl(this.initData.submitUrl, dataToSend);\r\n });\r\n }\r\n\r\n initListEvents(parent: HTMLElement) {\r\n $(parent).find('button[data-lessonwebnr][data-arc][data-lessondefnr][data-lessonnr]').on('click', (e) => {\r\n const $parent = $(parent);\r\n this.loadSlotList(e.delegateTarget, $parent.attr('data-date')).then(x => {\r\n let currentLesson = this.getCurrentLesson();\r\n\r\n if (currentLesson == null) {\r\n this.setAddStateToModal();\r\n } else {\r\n this.setEditStateToModal();\r\n }\r\n });\r\n });\r\n }\r\n\r\n setAddStateToModal() {\r\n $('[data-display-lp-add=\"edit\"]').toggleClass('d-none', true);\r\n $('[data-display-lp-add=\"add\"]').toggleClass('d-none', false);\r\n this._axLoading.HideLoadingIndicator($('#lessonPackage_selection_pType-modal')[0]);\r\n $('#lessonPackage_selection_pType-modal .ax-modal-dialog').removeClass('d-none');\r\n }\r\n\r\n setEditStateToModal() {\r\n const existingCart = this.getCurrentLesson();\r\n\r\n for (let pack of existingCart.packages) {\r\n this.counterArr[pack.personTypeLink].setValue(pack.quantity);\r\n }\r\n this.checkQuantity();\r\n this.updatePrice();\r\n $('[data-display-lp-add=\"edit\"]').toggleClass('d-none', false);\r\n $('[data-display-lp-add=\"add\"]').toggleClass('d-none', true);\r\n\r\n this._axLoading.HideLoadingIndicator($('#lessonPackage_selection_pType-modal')[0]);\r\n $('#lessonPackage_selection_pType-modal .ax-modal-dialog').removeClass('d-none');\r\n }\r\n\r\n initCounter() {\r\n for (let pType of this.initData.filterData.pTypes) {\r\n const tmpCounter = new AxCounter();\r\n tmpCounter.Init({\r\n Selector: `[data-display-lp-pType=${pType.id}]`,\r\n Value: 0,\r\n Min: 0\r\n });\r\n this.counterArr[pType.id] = tmpCounter;\r\n tmpCounter.Subscribe(n => {\r\n this.checkQuantity();\r\n this.updatePrice();\r\n this.updateCounter();\r\n });\r\n }\r\n }\r\n\r\n loadSlotList(e: HTMLElement, date: string): Promise<ISelectionSlotResult> {\r\n const $target = $(e);\r\n const arcNr = $target.data('arc');\r\n const lessonWebNr = $target.data('lessonwebnr');\r\n const lessonDefNr = $target.data('lessondefnr');\r\n const lessonNr = $target.data('lessonnr');\r\n const locationId = $target.data('location');\r\n const levelNr = $target.data('level');\r\n\r\n return new Promise<ISelectionSlotResult>((resolve) => {\r\n $('#lessonPackage_selection_pType-modal .ax-modal-dialog').addClass('d-none');\r\n this.pTypeSelectionModal.open($('#lessonPackage_selection_pType-modal')[0]);\r\n this._axLoading.ShowLoadingIndicator($('#lessonPackage_selection_pType-modal')[0], true);\r\n\r\n AxessViewer.loadPartialView('/LessonPackage/_SelectionSlot',\r\n {\r\n arcNr: arcNr,\r\n lessonWebNr: lessonWebNr,\r\n lessonDefNr: lessonDefNr,\r\n lessonNr: lessonNr,\r\n date: date\r\n },\r\n (resp: ISelectionSlotResult) => {\r\n resp.locationId = locationId;\r\n resp.lessonLevelNr = levelNr;\r\n this.displayedResult = resp;\r\n this.currentAvailableSlots = resp.availableSlots;\r\n\r\n this.resetQuantity();\r\n this.updateCounter();\r\n\r\n //$('[data-display-lp=available]').html(this._i18nHelper.GetTranslation(Translations.SlotsAvailable, resp.availableSlots.toString()));\r\n $('[data-display-lp=name]').html(resp.name);\r\n\r\n const from = moment(resp.from, 'YYYY-MM-DD HH:mm:ss');\r\n const to = moment(resp.to, 'YYYY-MM-DD HH:mm:ss');\r\n\r\n $('[data-display-lp=date]')\r\n .html(`${from.format(this.initData.filterData.datePattern)}, ${from.format('LT')}-${to.format('LT')}`);\r\n\r\n\r\n $('[data-display-lp=description]')\r\n .toggleClass('d-none', resp.description == null || resp.description == '');\r\n $('[data-display-lp=description]').html(resp.description);\r\n\r\n\r\n $('[data-display-lp-pType]').addClass('d-none');\r\n\r\n for (const pack of resp.packages) {\r\n $(`[data-display-lp-pType=\"${pack.personTypeLink}\"]`).removeClass('d-none');\r\n }\r\n resolve(resp);\r\n },\r\n {});\r\n });\r\n }\r\n\r\n\r\n renderCartList() {\r\n $(`[data-display-lp-summary=\"slotList\"]`).html('');\r\n for (let entry of this.cart) {\r\n const $template = $('[data-display-lp=\"slotTemplate\"]').clone();\r\n const location = this.initData.locations.find(x => x.locationId === entry.locationId);\r\n const level = this.initData.levels.find(x => x.lessonLevelNr === entry.lessonLevelNr);\r\n\r\n const from = moment(entry.from, 'YYYY-MM-DD HH:mm:ss');\r\n const to = moment(entry.to, 'YYYY-MM-DD HH:mm:ss');\r\n\r\n $template.removeAttr('data-display-lp');\r\n $template.find('[data-display-lp-slotTemplate=\"name\"]').html(`${typeof level?.name != 'undefined' ? `${level?.name}: ` : \"\"} ${entry.name}`);\r\n $template.css('background-color', level?.backgroundColor);\r\n $template.css('border-color', level?.borderColor);\r\n\r\n $template.find('[data-display-lp-slotTemplate=\"icon\"]').css('background-image', `url('${level?.iconPath}')`);\r\n\r\n\r\n const quantity = entry.packages.reduce((n, { quantity }) => n + quantity, 0);\r\n $template.find('[data-display-lp-slotTemplate=\"quantity\"]').html(quantity.toString());\r\n $template.find('[data-display-lp-slotTemplate=\"price\"]').html(this._priceHelper.GetPriceStringWithCurrencySymbol(this._priceHelper.GetPrice(entry.packages[0].price)));\r\n\r\n $template.find('[data-display-lp-slotTemplate=\"quantity\"]').html(quantity.toString());\r\n\r\n $template.attr('data-lessonWebNr', entry.lessonWebNr);\r\n $template.attr('data-lessonWebNr', entry.lessonWebNr);\r\n $template.attr('data-arc', entry.arcNr);\r\n $template.attr('data-lessonDefNr', entry.lessonDefNr);\r\n $template.attr('data-lessonNr', entry.lessonNr);\r\n $template.attr('data-location', entry.locationId);\r\n $template.attr('data-level', entry.lessonLevelNr);\r\n $template.attr('data-date', from.format('YYYY-MM-DD'));\r\n\r\n $template.find('[data-display-lp-slotTemplate=\"info\"]').html(`${from.format('DD MMMM, LT').replace(`:00`, '')}-${to.format('LT').replace(`:00`, '')} • ${location.locationName}`);\r\n\r\n $(`[data-display-lp-summary=\"slotList\"]`).append($template);\r\n }\r\n\r\n this.markSelectedSlots();\r\n }\r\n\r\n markSelectedSlots() {\r\n $('button[data-lessonwebnr][data-arc][data-lessondefnr][data-lessonnr]').removeClass('ax-border-primary');\r\n\r\n for (let entry of this.cart) {\r\n const from = moment(entry.from, 'YYYY-MM-DD HH:mm:ss');\r\n\r\n const $lessonButton = $(`.calendar-body[data-date=${from.format('YYYY-MM-DD')}] button[data-lessonwebnr=${entry.lessonWebNr\r\n }][data-arc=${entry.arcNr}][data-lessondefnr=${entry.lessonDefNr}][data-lessonnr=${entry.lessonNr}]`);\r\n\r\n if ($lessonButton.length > 0) {\r\n $lessonButton.addClass('ax-border-primary');\r\n }\r\n }\r\n }\r\n\r\n editToTmpCart() {\r\n const existingCart = this.getCurrentLesson();\r\n\r\n for (let pack of this.displayedResult.packages) {\r\n const quantity = this.counterArr[pack.personTypeLink].GetValue();\r\n let existingEntry = existingCart.packages.find(x => x.personTypeLink === pack.personTypeLink);\r\n\r\n if (existingEntry != null) {\r\n existingEntry.quantity = quantity;\r\n } else {\r\n existingCart.packages.push({\r\n name: pack.name,\r\n price: pack.price,\r\n personTypeLink: pack.personTypeLink,\r\n productTriple: pack.productTriple,\r\n quantity: quantity,\r\n packagePosNr: pack.packagePosNr\r\n });\r\n }\r\n }\r\n this.updateSummary();\r\n }\r\n\r\n addToTmpCart() {\r\n let quantities: { id: number; quantity: number; }[] = [];\r\n\r\n const existingCart = this.getCurrentLesson();\r\n\r\n if (existingCart != null) {\r\n for (let pack of this.displayedResult.packages) {\r\n const quantity = this.counterArr[pack.personTypeLink].GetValue();\r\n if (quantity === 0) continue;\r\n\r\n let existingEntry = existingCart.packages.find(x => x.personTypeLink === pack.personTypeLink);\r\n\r\n if (existingEntry != null) {\r\n existingEntry.quantity += quantity;\r\n } else {\r\n existingCart.packages.push({\r\n name: pack.name,\r\n price: pack.price,\r\n personTypeLink: pack.personTypeLink,\r\n productTriple: pack.productTriple,\r\n quantity: quantity,\r\n packagePosNr: pack.packagePosNr\r\n });\r\n }\r\n }\r\n } else {\r\n for (let pack of this.displayedResult.packages) {\r\n const quantity = this.counterArr[pack.personTypeLink].GetValue();\r\n if (quantity === 0) continue;\r\n\r\n\r\n quantities.push({ id: pack.personTypeLink, quantity: quantity });\r\n }\r\n this.cart.push(new SelectionCart(this.displayedResult, quantities));\r\n }\r\n\r\n this.updateSummary();\r\n }\r\n\r\n getCurrentLesson() {\r\n return this.cart.find(x => x.arcNr === this.displayedResult.arcNr &&\r\n x.lessonWebNr === this.displayedResult.lessonWebNr &&\r\n x.lessonDefNr === this.displayedResult.lessonDefNr &&\r\n x.lessonNr === this.displayedResult.lessonNr);\r\n }\r\n\r\n cleanUpCart() {\r\n let tmpCart = this.cart.filter(x => x.packages.filter(y => y.quantity > 0).length > 0);\r\n this.cart = tmpCart;\r\n }\r\n\r\n updateSummary() {\r\n this.cleanUpCart();\r\n if (this.cart.length === 0) {\r\n $(`[data-display-lp=\"summary\"]`).css('display', 'none');\r\n return;\r\n }\r\n\r\n this.renderCartList();\r\n let quantity = 0;\r\n let price = 0;\r\n\r\n for (let cartItem of this.cart) {\r\n quantity += cartItem.packages.reduce((n, { quantity }) => n + quantity, 0);\r\n price += cartItem.packages.reduce((n, { quantity, price }) => n + (quantity * price), 0);\r\n }\r\n\r\n let unique = [...new Set(this.cart.map(x => x.from))];\r\n\r\n if (unique.length === 1) {\r\n $('[data-display-lp-summary=\"date\"')\r\n .html(moment(unique[0], 'YYYY-MM-DD').format(this.initData.filterData.datePattern));\r\n } else {\r\n $('[data-display-lp-summary=\"date\"')\r\n .html(this._i18nHelper.GetTranslation(Translations.Various));\r\n }\r\n\r\n $('[data-display-lp-summary=\"quantity\"').html(this._i18nHelper.GetTranslation(Translations.SlotsN, quantity.toString()));\r\n $('[data-display-lp-summary=\"price\"').html(this._priceHelper.GetPriceStringWithDecimalDivisorCalced(price).toString());\r\n $(`[data-display-lp=\"summary\"]`).css('display', '');\r\n }\r\n\r\n updateCounter() {\r\n let quantity = this.counterArr.map(x => {\r\n return x.GetValue();\r\n }).reduce((n, curr) => n + curr, 0);\r\n\r\n const existingCart = this.getCurrentLesson();\r\n\r\n if (existingCart != null) {\r\n let existingQ = existingCart.packages.reduce((n, { quantity }) => n + quantity, 0);\r\n quantity += existingQ;\r\n }\r\n\r\n let maxQ = this.currentAvailableSlots - quantity;\r\n\r\n for (let pType of this.initData.filterData.pTypes) {\r\n\r\n this.counterArr[pType.id].updateMax(maxQ + this.counterArr[pType.id].GetValue());\r\n }\r\n $('[data-display-lp=available]').html(this._i18nHelper.GetTranslation(Translations.SlotsAvailable, (this.currentAvailableSlots - quantity).toString()));\r\n }\r\n\r\n updatePrice() {\r\n if (this.displayedResult?.packages == null) {\r\n return;\r\n }\r\n\r\n let total = 0;\r\n let totalQ = 0;\r\n\r\n for (let pack of this.displayedResult.packages) {\r\n const quantity = this.counterArr[pack.personTypeLink].GetValue();\r\n total += pack.price * quantity;\r\n totalQ += quantity;\r\n\r\n const listElem = $(`[data-display-lp-pType=\"${pack.personTypeLink}\"]`);\r\n\r\n listElem.find('[data-display-lp-pType-price=\"single\"]').html(\r\n this._priceHelper.GetPriceStringWithCurrencySymbol(pack.price /\r\n this.localizationModule.getPriceToDecimalDivisor()));\r\n listElem.find('[data-display-lp-pType-price=\"total\"]').html(\r\n this._priceHelper.GetPriceStringWithCurrencySymbol(pack.price * quantity /\r\n this.localizationModule.getPriceToDecimalDivisor()));\r\n }\r\n\r\n $('[data-display-lp=price]').html(`${this._priceHelper.GetPriceStringWithCurrencySymbol(total / this.localizationModule.getPriceToDecimalDivisor())}`);\r\n $('[data-display-lp-add=\"quantity\"]').toggleClass('d-none', totalQ === 0).html(`${this._i18nHelper.GetTranslation(Translations.SlotsN, totalQ.toString())}, `);\r\n }\r\n\r\n checkQuantity() {\r\n let totalQuantity = 0;\r\n for (let pType of this.initData.filterData.pTypes) {\r\n totalQuantity += this.counterArr[pType.id].GetValue();\r\n }\r\n $(`[data-trigger-lp=\"addSlot\"]`).prop('disabled', totalQuantity === 0);\r\n }\r\n\r\n resetQuantity() {\r\n let availableSlots = this.currentAvailableSlots;\r\n for (let pType of this.initData.filterData.pTypes) {\r\n const pTypeQuantity =\r\n this.lessonFilter.currentSearch?.quantity?.find(x => x.id === pType.id)?.quantity ?? 0;\r\n const tmpQuantity = pTypeQuantity <= availableSlots ? pTypeQuantity : availableSlots;\r\n this.counterArr[pType.id].setValue(tmpQuantity);\r\n availableSlots -= tmpQuantity;\r\n }\r\n this.checkQuantity();\r\n this.updatePrice();\r\n }\r\n}\r\n\r\ninterface ISelectionSlotResult {\r\n availableSlots: number;\r\n description: string;\r\n from: string;\r\n to: string;\r\n name: string;\r\n lessonLevelNr: number;\r\n locationId: number;\r\n arcNr: number,\r\n lessonWebNr: number,\r\n lessonDefNr: number,\r\n lessonNr: number,\r\n packages: {\r\n name: string;\r\n price: number;\r\n personTypeLink: number;\r\n productTriple: ProductTriple;\r\n packagePosNr: number;\r\n }[];\r\n}\r\n\r\n\r\nclass SelectionCart {\r\n constructor(base: ISelectionSlotResult, quantity: { id: number; quantity: number; }[]) {\r\n this.arcNr = base.arcNr;\r\n this.lessonWebNr = base.lessonWebNr;\r\n this.lessonDefNr = base.lessonDefNr;\r\n this.lessonNr = base.lessonNr;\r\n this.name = base.name;\r\n this.from = base.from;\r\n this.to = base.to;\r\n this.availableSlots = base.availableSlots;\r\n this.lessonLevelNr = base.lessonLevelNr;\r\n this.locationId = base.locationId;\r\n let tmpPackages = base.packages.map((x) => {\r\n let tmpQuantity = quantity.find(y => y.id === x.personTypeLink)?.quantity ?? 0;\r\n return {\r\n ...x,\r\n ...{\r\n quantity: Number(tmpQuantity)\r\n }\r\n }\r\n });\r\n this.packages = tmpPackages.filter(x => x.quantity !== 0);\r\n }\r\n\r\n arcNr: number;\r\n lessonWebNr: number;\r\n lessonDefNr: number;\r\n lessonNr: number;\r\n availableSlots: number;\r\n from: string;\r\n to: string;\r\n name: string;\r\n lessonLevelNr: number;\r\n locationId: number;\r\n packages: {\r\n name: string;\r\n price: number;\r\n personTypeLink: number;\r\n productTriple: ProductTriple;\r\n quantity: number;\r\n packagePosNr: number;\r\n }[];\r\n}\r\n", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { LessonFilter, ILessonFilterInitData, SearchDto } from \"./LessonFilter\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxFilterOverlay } from \"../../Utility/AxFilterOverlay\";\r\nimport Glide from \"@glidejs/glide\";\r\nimport { LessonLevel } from \"../../Models/Lesson/LessonLevel\";\r\nimport { RentalPersonType } from \"../../Models/Rental/RentalPersonType\";\r\nimport { LessonLocation } from \"../../Models/Lesson/LessonLocation\";\r\nimport { SelectionAddSlot } from \"./SelectionAddSlot\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { LessonPackageStorage } from \"./LessonPackageStorage\";\r\nimport tippy from 'tippy.js';\r\n\r\n@ModuleName(\"LessonPackage.Selection\")\r\nexport class Selection implements AxInit {\r\n init: ILessonPackageSelectionInit;\r\n allIntersectionObserversRegistered: boolean = false;\r\n glide: Glide;\r\n trackedDates: string[] = [];\r\n packageStorage: LessonPackageStorage;\r\n\r\n\r\n dateSelectionLoading: boolean = false;\r\n dateSelectionBuffer: {\r\n $target: JQuery<HTMLElement>;\r\n source: HTMLElement;\r\n count: number;\r\n date: string;\r\n }[] = [];\r\n\r\n constructor(private _axLoading = new AxLoading(),\r\n private _lessonFilter = new LessonFilter(),\r\n private _filterOverlay = new AxFilterOverlay(),\r\n private _selectionAddSlot = new SelectionAddSlot(),\r\n private _i18nHelper = new I18nHelper()) { }\r\n\r\n AxInit(init: ILessonPackageSelectionInit): void {\r\n //LevelStuff\r\n this.init = init;\r\n this._selectionAddSlot.init(this._lessonFilter, init);\r\n\r\n this.initLibs();\r\n\r\n this.updateFilterLabel(init.currentSearch);\r\n\r\n $(`[data-display-lp-calendar-nav-dir]`).on('click',\r\n (e) => {\r\n const $targetButton = $(e.delegateTarget);\r\n const direction = $targetButton.attr('data-display-lp-calendar-nav-dir');\r\n\r\n this.shiftTrackedDates(direction);\r\n });\r\n\r\n $('.lessonPackage_selection_dateSlider > div:not(.inactive)').on('click',\r\n (e) => {\r\n let targetDate = $(e.delegateTarget).attr('data-date');\r\n this._lessonFilter.updateDate(targetDate);\r\n });\r\n\r\n $('[data-display-lp-reset=\"level\"]').on('click', (e) => {\r\n $('[name=lessonPackage_filter_level-input]').prop('checked', false);\r\n $('[name=lessonPackage_filter_level-input]').trigger('change');\r\n });\r\n\r\n $('[data-display-lp-reset=\"location\"]').on('click', (e) => {\r\n $('[name=lessonPackage_filter_location-input]').prop('checked', false);\r\n $('[name=lessonPackage_filter_location-input]').trigger('change');\r\n });\r\n }\r\n\r\n initLibs() {\r\n const init = this.init;\r\n this.initCurrentSearch(init);\r\n this.setStorageSearch();\r\n this._lessonFilter.init(init.filterData);\r\n this._lessonFilter.setDefaults(init.currentSearch);\r\n this.initDateSwiper();\r\n\r\n this._lessonFilter.getSearchSubject().subscribe((x) => {\r\n\r\n //@ts-ignore\r\n $(`[data-display-lp-calendar-nav=\"dropdown\"`)[0]._tippy.hide();\r\n const searchDate = x.date;\r\n\r\n this.updateTrackedDates(searchDate);\r\n this.loadSelectionList(x);\r\n this._filterOverlay.toggleFilterBar(false);\r\n });\r\n\r\n this._lessonFilter.getSearchUpdateSubject().subscribe((x) => {\r\n this.packageStorage.cleanDefaultLevelStorage();\r\n this.updateFilterLabel(x);\r\n });\r\n\r\n this.initCalendarObserver();\r\n\r\n $(document).ajaxStart(() => {\r\n if (!this.dateSelectionLoading) return;\r\n\r\n this.setupSkeletons();\r\n });\r\n\r\n $(document).ajaxStop(() => {\r\n if (this.dateSelectionBuffer.length === 0) return;\r\n\r\n $('.calendar-body').removeClass('is-loading');\r\n\r\n for (let bufferE of this.dateSelectionBuffer) {\r\n const $target = $(`.lessonPackage_selection_dateList [data-date=${bufferE.date}]`);\r\n\r\n if ($target.length === 0) continue;\r\n\r\n bufferE.$target.html(bufferE.source);\r\n bufferE.$target.toggleClass('ax-bg-lg-gray-100', bufferE.count === 0);\r\n $target.toggleClass('ax-bg-lg-gray-100', bufferE.count === 0);\r\n\r\n this._selectionAddSlot.initListEvents(bufferE.$target[0]);\r\n }\r\n\r\n this._selectionAddSlot.markSelectedSlots();\r\n this.dateSelectionBuffer = [];\r\n for (let bodyE of $('.calendar-body')) {\r\n this._axLoading.HideLoadingIndicator(bodyE);\r\n }\r\n this.dateSelectionLoading = false;\r\n });\r\n\r\n //$(`[data-display-lp-calendar-nav=\"dropdown\"]`).on('click',\r\n // () => {\r\n // const instance = tippy(document.querySelector('[data-display-lp-calendar-nav=\"month\"]'));\r\n // instance.show();\r\n // });\r\n //@ts-ignore\r\n const instance = tippy($(`[data-display-lp-calendar-nav=\"dropdown\"]`)[0], {\r\n //@ts-ignore\r\n content: $(`[data-display-lp-calendar-nav=\"month\"]`)[0]._tippy.popper,\r\n allowHTML: true,\r\n placement: 'bottom',\r\n trigger: 'click',\r\n arrow: false,\r\n interactive: true,\r\n maxWidth: 'none',\r\n animation: false,\r\n onShow: (instance) => {\r\n let $parent = $(instance.reference as HTMLElement);\r\n let $popperInstance = $(instance.popper);\r\n instance.popper.style.width = instance.reference.getBoundingClientRect().width + 'px';\r\n //@ts-ignore\r\n this._lessonFilter.dateDropdown.axDropdownEvents.interaction.afterOpen($parent, $popperInstance);\r\n },\r\n appendTo: () => document.body,\r\n });\r\n }\r\n\r\n initCurrentSearch(init: ILessonPackageSelectionInit) {\r\n init.currentSearch.date = init.currentSearch.date ?? moment().format('YYYY-MM-DD');\r\n\r\n if (init.currentSearch.quantity == null && init.personTypes.length === 1) {\r\n init.currentSearch.quantity = [\r\n {\r\n id: init.personTypes[0].personTypeNr,\r\n quantity: 1\r\n }\r\n ];\r\n }\r\n }\r\n\r\n setStorageSearch() {\r\n this.packageStorage = AxLoad.GetModule<LessonPackageStorage>(\"LessonPackageStorage\");\r\n const defaultLevel = this.packageStorage.getDefaultLevelStorage();\r\n\r\n if (defaultLevel != null && defaultLevel.length !== 0) {\r\n this.init.currentSearch.levels = defaultLevel;\r\n }\r\n }\r\n\r\n shiftTrackedDates(direction: string) {\r\n const currentTargetDate = moment(this.trackedDates[0], 'YYYY-MM-DD');\r\n currentTargetDate.add(this.trackedDates.length * (direction === '<' ? -1 : 1), 'days');\r\n\r\n const lastDate = currentTargetDate.clone().add(this.trackedDates.length, 'days');\r\n if (lastDate.isBefore(moment())) return;\r\n\r\n this._lessonFilter.updateDate(currentTargetDate.format('YYYY-MM-DD'));\r\n }\r\n\r\n updateTrackedDates(searchDate: string) {\r\n if (searchDate === $('.calendar-body').attr('data-date')) return;\r\n\r\n const currentMom = moment(searchDate, 'YYYY-MM-DD');\r\n const tmpMom = currentMom.clone();\r\n\r\n $(`[data-display-lp-calendar-nav=\"dates\"]`)\r\n .html(`${tmpMom.format('MMM D')} - ${tmpMom.add(this.trackedDates.length, 'days').format('MMM D')}`);\r\n\r\n for (let i = 0; i < $('.calendar-body').length; i++) {\r\n const target = currentMom.format('YYYY-MM-DD');\r\n const $targetElem = $($('.calendar-body')[i]);\r\n const $targetHead = $($('.lessonPackage_selection_dateList [data-date]')[i]);\r\n\r\n $targetHead.find(`[data-display-lp-calendar=\"day\"]`).html(currentMom.format('dddd'));\r\n $targetHead.find(`[data-display-lp-calendar=\"date\"]`).html(currentMom.format('D'));\r\n\r\n $targetHead.attr('data-date', target);\r\n $targetElem.attr('data-date', target);\r\n\r\n if (this.trackedDates.length > i) {\r\n this.trackedDates[i] = target;\r\n }\r\n currentMom.add(1, 'days');\r\n }\r\n }\r\n\r\n updateFilterLabel(currentSearch: SearchDto) {\r\n let levelText = this._i18nHelper.GetTranslation(Translations.LevelsAll);\r\n let infoText: string[] = [];\r\n\r\n if (currentSearch.levels != null && currentSearch.levels.length > 0) {\r\n levelText = this.init.levels.filter(x => currentSearch.levels.indexOf(x.lessonLevelNr) !== -1).map(x => x.name).join(', ');\r\n }\r\n\r\n $('.lessonPackage_selection_filterLabel-level').html(levelText);\r\n\r\n if (currentSearch.date != null && currentSearch.date != '') {\r\n let text = moment(currentSearch.date).format(this.init.filterData.datePattern);\r\n infoText.push(text);\r\n }\r\n\r\n if (currentSearch.quantity != null && currentSearch.quantity.filter(x => x.quantity > 0).length > 0) {\r\n let pTypeArr: string[] = [];\r\n for (let pType of currentSearch.quantity.filter(x => x.quantity > 0)) {\r\n let name = this.init.personTypes.find(x => x.personTypeNr === pType.id).name;\r\n let text = `${pType.quantity} ${name}`;\r\n pTypeArr.push(text);\r\n }\r\n infoText.push(pTypeArr.join(', '));\r\n } else {\r\n infoText.push(`<span class=\"font-italic\">${this._i18nHelper.GetTranslation(Translations.People)}</span>`);\r\n }\r\n\r\n if (currentSearch.locations != null && currentSearch.locations.length > 0) {\r\n let locationArray = this.init.locations.filter(x => currentSearch.locations.indexOf(x.locationId) !== -1)\r\n .map(x => x.locationName);\r\n\r\n infoText.push(locationArray.join(', '));\r\n } else {\r\n infoText.push(`<span class=\"font-italic\">${this._i18nHelper.GetTranslation(Translations.Location)}</span>`);\r\n }\r\n\r\n $('.lessonPackage_selection_filterLabel-level').html(levelText);\r\n $('.lessonPackage_selection_filterLabel-info').html(infoText.join(' | '));\r\n }\r\n\r\n loadSelectionList(currentSearch: SearchDto) {\r\n if (this.trackedDates.length === 0) return;\r\n\r\n this.dateSelectionLoading = true;\r\n for (let date of this.trackedDates) {\r\n let clone = { ...currentSearch }\r\n clone.date = date;\r\n AxessViewer.loadPartialView('/LessonPackage/_SelectionList',\r\n clone,\r\n (resp) => {\r\n const $target = $(`.calendar-body[data-date=${resp.firstValidDate}]`);\r\n this.dateSelectionBuffer.push({\r\n $target: $target,\r\n count: resp.count,\r\n source: resp.view,\r\n date: resp.firstValidDate\r\n });\r\n },\r\n {});\r\n }\r\n $(`.lessonPackage_selection_dateSlider > div`).removeClass('active');\r\n $(`.lessonPackage_selection_dateSlider > div[data-date=\"${this.trackedDates[0]}\"]`).addClass('active');\r\n\r\n const startOfWeek = moment(this.trackedDates[0], 'YYYY-MM-DD').startOf('week');\r\n const activeIndex = $('.lessonPackage_selection_dateSlider > div')\r\n .index($(`.lessonPackage_selection_dateSlider > div[data-date=\"${startOfWeek.format('YYYY-MM-DD')}\"]`));\r\n this.glide.go(`=${activeIndex}`);\r\n }\r\n\r\n setupSkeletons() {\r\n let count = 0;\r\n $('.calendar-body').addClass('is-loading');\r\n for (let bodyE of $('.calendar-body')) {\r\n const $bodyE = $(bodyE);\r\n $bodyE.toggleClass('ax-bg-lg-gray-100', false);\r\n $(`.lessonPackage_selection_dateList > div`).toggleClass('ax-bg-lg-gray-100', false);\r\n $bodyE.html($($('.skeleton > div')[count]).html());\r\n count++;\r\n }\r\n }\r\n\r\n initCalendarObserver() {\r\n let options = {\r\n root: document.querySelector(\".ax-calendar-planer\"),\r\n rootMargin: \"0px\",\r\n threshold: [0.5],\r\n };\r\n\r\n let callback: IntersectionObserverCallback = (entries, observer) => {\r\n const originalTrack = [...this.trackedDates];\r\n entries.forEach((entry) => {\r\n const trackedDate = $(entry.target).attr('data-date');\r\n\r\n if (!entry.isIntersecting) {\r\n this.trackedDates = this.trackedDates.filter(x => x !== trackedDate);\r\n } else if (this.trackedDates.findIndex(x => trackedDate === x) === -1) {\r\n this.trackedDates.push(trackedDate);\r\n }\r\n });\r\n\r\n if (this.trackedDates.length > originalTrack.length) {\r\n this.loadSelectionList(this._lessonFilter.currentSearch);\r\n }\r\n };\r\n\r\n let observer = new IntersectionObserver(callback, options);\r\n $('.calendar-body').each((i, e) => {\r\n observer.observe(e);\r\n });\r\n }\r\n\r\n initDateSwiper() {\r\n\r\n this.glide = new Glide('.glide', {\r\n type: 'slider',\r\n perView: 7,\r\n touchRatio: 0.8,\r\n rewind: false,\r\n gap: 0,\r\n focusAt: 0\r\n });\r\n this.glide.on('swipe.move', (move) => {\r\n console.log(move);\r\n });\r\n this.glide.on('run.before', (move) => {\r\n console.log(move);\r\n if (move.direction === '=') return;\r\n\r\n let orgDate = moment($(this.glide._c.Html.slides[this.glide.index]).attr('data-date'),\r\n 'YYYY-MM-DD');\r\n let currentDate = orgDate.clone().add(move.steps * -1, 'd');\r\n\r\n let startOfWeek = currentDate.clone();\r\n startOfWeek.startOf('week');\r\n let thisWeekDiff = currentDate.diff(startOfWeek, 'days');\r\n if (thisWeekDiff === 0) return;\r\n\r\n if (thisWeekDiff > 3) {\r\n thisWeekDiff = (7 - thisWeekDiff) * -1;\r\n startOfWeek.add(1, 'weeks');\r\n }\r\n\r\n if (orgDate.isSame(startOfWeek)) {\r\n move.steps = this.glide.index;\r\n move.direction = '=';\r\n } else {\r\n move.steps = move.steps + thisWeekDiff;\r\n }\r\n });\r\n\r\n\r\n //This is a self check, if the swiper shows weird behavior (sometimes 1 or 2 days of SoW) activate this\r\n //glide.on('move.after', (move) => {\r\n // let currentDate = moment($(glide._c.Html.slides[glide.index]).attr('data-date'),\r\n // 'YYYY-MM-DD');\r\n // let startOfWeek = currentDate.clone();\r\n // startOfWeek.startOf('week');\r\n // let thisWeekDiff = currentDate.diff(startOfWeek, 'days');\r\n\r\n // console.log(`Date: ${currentDate.format('YYYY-MM-DD')} - SoW: ${startOfWeek.format('YYYY-MM-DD')}`);\r\n // console.log(`Diff to sow: ${thisWeekDiff}`);\r\n // if (thisWeekDiff === 0) return;\r\n\r\n // console.log(`Glide Go to current: ${glide.index} - Target: ${glide.index + thisWeekDiff * -1}`);\r\n // setTimeout(() => {\r\n // glide.go(`=${glide.index + thisWeekDiff * -1}`);\r\n // },\r\n // 25);\r\n //});\r\n\r\n this.glide.mount();\r\n\r\n let options = {\r\n root: document.querySelector(\".glide\"),\r\n rootMargin: \"0px\",\r\n threshold: [0.3, 0.5, 0.7, 1],\r\n };\r\n\r\n let previousX = 0;\r\n let previousRatio = 0;\r\n\r\n let callback: IntersectionObserverCallback = (entries, observer) => {\r\n entries.forEach((entry) => {\r\n if (!this.allIntersectionObserversRegistered) return;\r\n\r\n const date = moment($(entry.target).attr('data-date'), 'YYYY-MM-DD');\r\n const firstOfMonth = date.clone().startOf('month');\r\n\r\n if (!date.isSame(firstOfMonth, 'date')) return;\r\n\r\n const currTrans = $('.lessonPackage_selection_dateSlider').css('-webkit-transform').split(/[()]/)[1];\r\n const currentX = parseInt(currTrans.split(',')[4]);\r\n\r\n const currentRatio = entry.intersectionRatio;\r\n\r\n let switchDirection = '';\r\n let firstOfMonthDow = parseInt(firstOfMonth.format(\"e\"));\r\n\r\n if (currentX < previousX) {\r\n if (currentRatio > previousRatio && firstOfMonthDow <= 3) {\r\n //state = \"Scrolling right enter\";\r\n switchDirection = '>';\r\n } else if (currentRatio < previousRatio && firstOfMonthDow > 3) {\r\n //state = \"Scrolling right leave\";\r\n switchDirection = '>';\r\n }\r\n } else if (currentX > previousX) {\r\n if (currentRatio < previousRatio && firstOfMonthDow <= 3) {\r\n //state = \"Scrolling left leave\";\r\n switchDirection = '<';\r\n } else if (currentRatio > previousRatio && firstOfMonthDow > 3) {\r\n //state = \"Scrolling left enter\";\r\n switchDirection = '<';\r\n }\r\n }\r\n\r\n previousX = currentX;\r\n previousRatio = currentRatio;\r\n\r\n if (switchDirection === '') return;\r\n\r\n let nextMonth;\r\n if (switchDirection === '>') {\r\n nextMonth = firstOfMonth.clone();\r\n } else if (switchDirection === '<') {\r\n nextMonth = firstOfMonth.clone().add(-1, 'days');\r\n }\r\n\r\n if (nextMonth == null) return;\r\n\r\n const newMonthName = nextMonth.format('MMMM');\r\n $('.lessonPackage_selection_monthname').html(newMonthName);\r\n });\r\n };\r\n let observer = new IntersectionObserver(callback, options);\r\n\r\n $('.lessonPackage_selection_dateSlider > div').each((i, e) => {\r\n observer.observe(e);\r\n });\r\n setTimeout(() => {\r\n this.allIntersectionObserversRegistered = true;\r\n }, 300);\r\n }\r\n\r\n insertBeforeIndex(element: HTMLElement, index: number) {\r\n this.glide.track.insertBefore(element, this.glide.track.children[index]);\r\n this.glide.refresh();\r\n }\r\n\r\n insertEnd(element: HTMLElement) {\r\n this.glide.track.insertBefore(element, this.glide.track.children.ength);\r\n this.glide.refresh();\r\n }\r\n}\r\n\r\ninterface IPersonType {\r\n maskName: string;\r\n name: string;\r\n personTypeNr: number;\r\n shortName: string;\r\n}\r\n\r\nexport interface ILessonPackageSelectionInit {\r\n filterData: ILessonFilterInitData;\r\n currentSearch: SearchDto;\r\n levels: LessonLevel[];\r\n personTypes: IPersonType[];\r\n locations: LessonLocation[];\r\n submitUrl: string;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxDropdown, AxFormValidation, AxModal } from \"@axess/limestone\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport Swal from \"sweetalert2\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { PersonDataForm } from \"./Components/PersonDataForm\";\r\nimport * as models from \"../Rental/RiderDetails/RiderDetailsModelBundle\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\nimport { ProductTriple } from \"../../Models/Products/ProductTriple\";\r\nimport { PriceHelper } from \"../../Lib/Helper/PriceHelper\";\r\nimport * as Popper from '@popperjs/core';\r\n\r\n@ModuleName(\"LessonPackage.Personalization\")\r\nexport class Personalization implements AxInit {\r\n initData: IPersonalizationInitData;\r\n persDropdowns: AxDropdown;\r\n currentPersonData: models.RiderData;\r\n personModal: AxModal;\r\n\r\n constructor(private _axLoading = new AxLoading(),\r\n private _i18NHelper = new I18nHelper(),\r\n private _axLimestone = new AxLimeStone(),\r\n private _priceHelper = new PriceHelper(null, false),\r\n private _requestHelper = new RequestHelper()) {\r\n }\r\n\r\n AxInit(init: IPersonalizationInitData): void {\r\n this.initData = init;\r\n\r\n const persDropdowns = new AxDropdown();\r\n\r\n this.initPackageList();\r\n\r\n this.personModal = new AxModal();\r\n this.personModal.init({\r\n selector: `[data-target=\"family_edit_modal_0\"]`\r\n });\r\n\r\n persDropdowns.init(`[data-display-lp-pers=\"selection\"]`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onSelect: (p, e) => {\r\n const $parent = $(p.parent());\r\n\r\n this.getPersonForm($parent, e as string);\r\n }\r\n }\r\n );\r\n this.persDropdowns = persDropdowns;\r\n\r\n $('[data-parent=\"#lessonPackage_pers_list\"]').on('show.bs.collapse',\r\n (e) => {\r\n let $parent = $(e.currentTarget);\r\n let $packageBlock = $($parent.attr('data-parent'));\r\n let currentPersonValue = persDropdowns.getValue($($parent.find(`[data-display-lp-pers=\"selection\"]`)));\r\n\r\n let $header = $($packageBlock.find(`[data-target=\"#${$parent.attr('id')}\"]`));\r\n\r\n $(e.delegateTarget).find(`[data-display-lp-pers=\"form\"]`).html(``);\r\n this.currentPersonData = null;\r\n\r\n if (currentPersonValue != null) {\r\n this.getPersonForm($parent, currentPersonValue as string);\r\n $header.find('[data-display-lp-pers=\"name\"]').addClass('d-none');\r\n $header.find('[data-display-lp-pers=\"rule\"]').removeClass('d-none');\r\n\r\n }\r\n });\r\n\r\n $('[data-parent=\"#lessonPackage_pers_list\"]').on('hidden.bs.collapse',\r\n (e) => {\r\n $(e.delegateTarget).find(`[data-display-lp-pers=\"form\"]`).html(``);\r\n this.currentPersonData = null;\r\n });\r\n\r\n $(`[data-parent=\"#lessonPackage_pers_list\"]`).on('click', '[data-display-lp-pers=\"apply\"]',\r\n (e) => {\r\n if (!($(\"#personDataForm\")?.valid() ?? false)) return;\r\n\r\n const $blockTrigger = $(`.lessonPackage_pers_list__head button[aria-expanded=\"true\"]`);\r\n $blockTrigger.find('[data-display-lp-pers=\"name\"] span').html($($blockTrigger.attr('data-target')).find('[data-display-lp-pers=\"selection\"] .ax-dropdown__selection').html())\r\n $blockTrigger.find('[data-display-lp-pers=\"rule\"]').addClass('d-none');\r\n $blockTrigger.find('[data-display-lp-pers=\"name\"]').removeClass('d-none');\r\n\r\n AxessViewer.loadPartialView(\"/LessonPackage/SavePersonData\",\r\n this.currentPersonData,\r\n (resp) => {\r\n //const $blockTrigger = $(`.lessonPackage_pers_list__head button[aria-expanded=\"true\"]`);\r\n let newCount = parseInt($blockTrigger.attr('data-count')) + 1;\r\n $blockTrigger.addClass('done');\r\n const $nextBlockTrigger = $(`.lessonPackage_pers_list__head button[data-count=\"${newCount}\"]`);\r\n\r\n if ($nextBlockTrigger.length > 0) {\r\n const $nextTargetBlock = $($nextBlockTrigger.data('target'));\r\n $nextTargetBlock.collapse('show');\r\n } else {\r\n const $activeTargetBlock = $($blockTrigger.data('target'));\r\n $activeTargetBlock.collapse('hide');\r\n }\r\n\r\n $(e.delegateTarget).find(`[data-display-lp-pers=\"form\"]`).html(``);\r\n this.currentPersonData = null;\r\n\r\n this.validateInput();\r\n });\r\n });\r\n\r\n $(`[data-display-lp-summary=\"submit\"]`).on('click',\r\n (x) => {\r\n this._axLimestone.LockButton(x.delegateTarget);\r\n\r\n AxessViewer.loadPartialView('/LessonPackage/AddToCart',\r\n { model: this.initData.packages },\r\n result => {\r\n this._axLimestone.UnlockButton(x.delegateTarget);\r\n if (!result.success) {\r\n this._axLoading.HideLoadingIndicator($('.compPack_bookingOptions_body')[0]);\r\n\r\n Swal.fire({\r\n title: this._i18NHelper.GetTranslation(Translations.Error),\r\n icon: 'warning',\r\n html: result.errorMsg\r\n });\r\n } else {\r\n window.location.href = this.initData.shoppingCartUrl;\r\n }\r\n });\r\n });\r\n\r\n $('#family_edit_modal_0').on('submit', '#updateFamilyMember-form', (e) => {\r\n e.preventDefault();\r\n this.addPerson(e);\r\n })\r\n }\r\n\r\n updatePrice() {\r\n let price = 0;\r\n for (let pack of this.initData.packages) {\r\n const pPrice = this.initData.positionPrices.find(x => x.triple.id === pack.packageId &&\r\n x.triple.productGroupIdentifier === pack.tariffSheetId &&\r\n x.triple.projNr === pack.projNr)\r\n\r\n for (let pos of pPrice.positions) {\r\n if (pack.rentalOrderPlaceHolder?.find(x => x.packagePositionNr === pos.packagePosNo) == null) {\r\n price += pos.price;\r\n }\r\n }\r\n }\r\n $('[data-display-lp-summary=\"price\"').html(this._priceHelper.GetPriceStringWithDecimalDivisorCalced(price).toString());\r\n }\r\n\r\n validateInput() {\r\n if (this.initData.packages.filter(x => x.accountId === -1).length === 0) {\r\n $(`[data-display-lp-summary=\"submit\"]`).prop('disabled', '');\r\n } else {\r\n $(`[data-display-lp-summary=\"submit\"]`).prop('disabled', 'disabled');\r\n }\r\n }\r\n\r\n addPerson(e: JQuery.SubmitEvent) {\r\n AxessViewer.onSubmit(e,\r\n e.currentTarget,\r\n '/ProfileSettings/AddFamilyMember',\r\n (resp) => {\r\n if (resp.members == null) return;\r\n\r\n let newestMember = resp.members.sort((a, b) => b.CustomerAccountNo - a.CustomerAccountNo)[0];\r\n\r\n for (let dropdownE of this.persDropdowns.getElements()) {\r\n //@ts-ignore\r\n const instance = dropdownE._tippy as Instance<Props>;\r\n const popperE: Popper.Instance = instance.popper;\r\n const template = $($(popperE).find('.ax-dropdown__item')[0]).clone();\r\n template.attr('data-value', newestMember.CustomerAccountNo);\r\n template.find('[data-display-lp-pers=\"famName\"]')\r\n .html(`${newestMember.FirstName} ${newestMember.LastName}`);\r\n $(popperE).find('.ax-dropdown__menu .ax-dropdown__item[data-value]').not('[data-toggle]').last().after(template);\r\n\r\n if ($(dropdownE).closest('.accordion-collapse').hasClass('show')) {\r\n $(template).trigger('click');\r\n }\r\n }\r\n this.personModal.close($(\"#family_edit_modal_0\")[0]);\r\n },\r\n { lockButtonSelector: '#updateFamilyMember-form button' },\r\n { returnList: true });\r\n }\r\n\r\n getPersonForm($parent: JQuery<HTMLElement>, value: string, riderData?: models.RiderData) {\r\n const packNr = $parent.data('package');\r\n const tariffSheetNr = $parent.data('tariffsheet');\r\n const index = $parent.data('index');\r\n const lessonNr = $parent.data('lessonnr');\r\n\r\n let cartEntry = this.getPackageEntry(lessonNr, tariffSheetNr, packNr, index);\r\n cartEntry.accountId = parseInt(value);\r\n\r\n $parent.find(`[data-display-lp-pers=\"form\"]`).html('');\r\n\r\n if (cartEntry.accountId == -1) {\r\n return;\r\n }\r\n\r\n //@ts-ignore\r\n riderData = riderData ?? {\r\n customerAccountId: cartEntry.accountId,\r\n unitSystem: 0,\r\n shoeSizeSystem: 30\r\n };\r\n\r\n AxessViewer.loadPartialView('/LessonPackage/_PersonForm',\r\n {\r\n package: {\r\n id: cartEntry.packageId,\r\n productGroupIdentifier: cartEntry.tariffSheetId,\r\n projNr: cartEntry.projNr\r\n },\r\n lesson: cartEntry.lessonOrderValues[0],\r\n riderData: riderData\r\n },\r\n result => {\r\n const div = document.createElement('div');\r\n div.innerHTML = result.returnView.trim();\r\n\r\n const $div = $(div);\r\n $div.find('.ax-portlet').removeClass('ax-portlet ax-portlet--md');\r\n $div.find('.ax-portlet__body').removeClass('ax-portlet__body');\r\n\r\n $parent.find(`[data-display-lp-pers=\"form\"]`).html(div);\r\n\r\n this.currentPersonData = result.customerRentalData;\r\n const personDataForm = new PersonDataForm(result.unitSystem);\r\n personDataForm.initInputsAsync(this.currentPersonData).then((x) => {\r\n $parent.find('[data-display-lp-pers=\"apply\"]').prop('disabled', $(\"#personDataForm\")?.valid() ?? true ? null : \"disabled\");\r\n\r\n let inputs = $parent.find(\".ax-form-control\");\r\n for (let input of inputs) {\r\n if (input.id.length === 0) continue;\r\n\r\n $(input).trigger('mouseleave');\r\n $(input).on('change',\r\n () => {\r\n $parent.find('[data-display-lp-pers=\"apply\"]').prop('disabled',\r\n $(\"#personDataForm\")?.valid() ?? true ? null : \"disabled\");\r\n });\r\n }\r\n });\r\n personDataForm.getReloadSubject().subscribe((data) => {\r\n this.getPersonForm($parent, value, data);\r\n });\r\n });\r\n }\r\n\r\n\r\n initPackageList() {\r\n for (let elem of $(`[data-parent=\"#lessonPackage_pers_list\"]`)) {\r\n this.optionalItemCheck(elem);\r\n\r\n $(elem).on('click', '[data-lp-pers=\"rentalitem\"]', (e) => {\r\n this.optionalItemCheck(e.delegateTarget, e.currentTarget);\r\n });\r\n }\r\n this.updatePrice();\r\n }\r\n\r\n optionalItemCheck(elem: HTMLElement, checkbox?: HTMLElement) {\r\n const $elem = $(elem);\r\n\r\n const packageNr = parseInt($elem.data('package'));\r\n const tariffSheet = parseInt($elem.data('tariffsheet'));\r\n const index = parseInt($elem.data('index'));\r\n const lessonNr = parseInt($elem.data('lessonnr'));\r\n\r\n const packageEntry = this.getPackageEntry(lessonNr, tariffSheet, packageNr, index);\r\n packageEntry.rentalOrderPlaceHolder = packageEntry.rentalOrderPlaceHolder ?? [];\r\n\r\n const itemList = checkbox != null ? [checkbox] : $elem.find(`[data-lp-pers=\"rentalitem\"]`);\r\n\r\n for (let box of itemList) {\r\n const checked = $(box).prop('checked');\r\n const packagePosNr = parseInt($(box).data('packagepos'));\r\n this.toggleOptionalItems(packageEntry, packagePosNr, checked);\r\n }\r\n\r\n this.updatePrice();\r\n }\r\n\r\n toggleOptionalItems(packageEntry, packagePosNr: number, toggle: boolean) {\r\n if (!toggle) {\r\n const tmpRentalItem =\r\n packageEntry.additionalRentalOrderValues.find(x => x.packagePositionNr === packagePosNr);\r\n\r\n if (typeof tmpRentalItem != 'undefined') {\r\n packageEntry.rentalOrderPlaceHolder.push(tmpRentalItem);\r\n }\r\n packageEntry.additionalRentalOrderValues =\r\n packageEntry.additionalRentalOrderValues.filter(x => x.packagePositionNr !== packagePosNr);\r\n } else {\r\n const tmpRentalItem =\r\n packageEntry.rentalOrderPlaceHolder.find(x => x.packagePositionNr === packagePosNr);\r\n\r\n if (typeof tmpRentalItem != 'undefined') {\r\n packageEntry.additionalRentalOrderValues.push(tmpRentalItem);\r\n }\r\n\r\n packageEntry.rentalOrderPlaceHolder =\r\n packageEntry.rentalOrderPlaceHolder.filter(x => x.packagePositionNr !== packagePosNr);\r\n }\r\n }\r\n\r\n\r\n getPackageEntry(lessonNr: number, tariffSheetNr: number, packageNr: number, index: number) {\r\n return this.initData.packages.filter(x => x.tariffSheetId === tariffSheetNr &&\r\n x.packageId === packageNr && typeof x.lessonOrderValues.find(y => y.lessonNr === lessonNr) != 'undefined')[index];\r\n }\r\n}\r\n\r\ninterface IPersonalizationInitData {\r\n packages: {\r\n accountId: number;\r\n additionalRentalOrderValues: IRentalOrder[];\r\n rentalOrderValues: IRentalOrder[];\r\n rentalOrderPlaceHolder: IRentalOrder[];\r\n packageId: number;\r\n projNr: number;\r\n soapDateEnd: string;\r\n soapDateStart: string;\r\n tariffSheetId: number;\r\n lessonOrderValues: {\r\n lessonArcNr: number;\r\n lessonDefNr: number;\r\n lessonNr: number;\r\n lessonWebNr: number;\r\n packagePositionNr: number;\r\n }[];\r\n ticketOrderValues: {\r\n packagePositionNr: number;\r\n hasTimeSlots: boolean;\r\n poolNr: number;\r\n projNr: number;\r\n ticketTypeNr: number;\r\n timeSlotKeys: [];\r\n }[];\r\n }[];\r\n positionPrices: {\r\n triple: ProductTriple,\r\n positions: {\r\n price: number,\r\n packagePosNo: number\r\n }[]\r\n }[],\r\n shoppingCartUrl: string;\r\n signedIn: boolean;\r\n loginUrl: string;\r\n}\r\n\r\ninterface IRentalOrder {\r\n rentalItemNr: number;\r\n rentalPersTypeNr: number;\r\n packagePositionNr: number;\r\n}", "import { AxModal, AxDropdown, IAxDropdownOptions, AxFormValidation, AxInput, IAxFormValidationOptions } from \"@axess/limestone\";\r\nimport * as models from \"../../Rental/RiderDetails/RiderDetailsModelBundle\";\r\nimport { AxStaticConfigModule } from \"../../AxConfig/AxStaticConfigModule\";\r\nimport { ConfigHelper, ConfigDefinition } from \"../../../Lib/Helper/Config/ConfigHelper\";\r\nimport { MaskedTextChangedListener } from 'ts-input-mask';\r\nimport { Subject } from \"rxjs\";\r\n\r\nexport class PersonDataForm {\r\n private formName = '#personDataForm';\r\n\r\n private unitSystem: number;\r\n\r\n private heightDropDown = new AxDropdown();\r\n private weightDropDown = new AxDropdown();\r\n private shoeSizeDropDown = new AxDropdown();\r\n private shoeSizeSystemDropDown = new AxDropdown();\r\n\r\n private countryDropDown = new AxDropdown();\r\n private genderDropDown = new AxDropdown();\r\n private skillLevelDropDown = new AxDropdown();\r\n\r\n private reloadSubject: Subject<models.RiderData>;\r\n\r\n constructor(unitSystem: number) {\r\n this.unitSystem = unitSystem;\r\n }\r\n\r\n async initInputsAsync(riderData: models.RiderData) {\r\n return new Promise<void>((resolve) => {\r\n this.initInputValidation();\r\n this.initUnitSelectionRadios(riderData);\r\n this.reloadSubject = new Subject<models.RiderData>();\r\n\r\n ConfigHelper.getBoolConfigValueAsync(ConfigDefinition.RentalDataTextInput)\r\n .then(async useTextInput => {\r\n this.initTextInputs(riderData, useTextInput);\r\n this.initDropDowns(riderData, useTextInput);\r\n await this.setValueFromProductAndRiderDetailsToForm(riderData, useTextInput);\r\n resolve();\r\n });\r\n });\r\n }\r\n\r\n public getReloadSubject() {\r\n return this.reloadSubject;\r\n }\r\n\r\n private initInputValidation() {\r\n let validationFormOptions = {\r\n selector: '#personDataForm',\r\n rules: this.getValidationRules(),\r\n callback: (form: HTMLElement) => {\r\n //this.submitPersonDataForm();\r\n }\r\n }\r\n\r\n let form = document.getElementById('personDataForm');\r\n\r\n let inputs = form.getElementsByClassName(\"ax-form-control\");\r\n\r\n new AxFormValidation(validationFormOptions).init();\r\n\r\n for (let i = 0; i < inputs.length; i++) {\r\n let input = inputs.item(i) as HTMLInputElement;\r\n\r\n if (input.id.length === 0) {\r\n continue;\r\n }\r\n\r\n new AxInput('#' + input.id).init();\r\n }\r\n }\r\n\r\n private initUnitSelectionRadios(riderData: models.RiderData) {\r\n const radios: NodeListOf<HTMLInputElement> = document.querySelectorAll('input[name=\"unit\"]');\r\n\r\n radios.forEach(radio => {\r\n radio.addEventListener('change', (event) => {\r\n const selectedVal = $(event.currentTarget).val();\r\n riderData.unitSystem = Number(selectedVal);\r\n this.reloadSubject.next(riderData);\r\n });\r\n });\r\n }\r\n\r\n private initTextInputs(riderData: models.RiderData, useTextInput: boolean) {\r\n if ($('#City').length > 0) {\r\n $('#City').on('input', e => {\r\n riderData.city = $('#City').val().toString();\r\n });\r\n }\r\n\r\n if ($('#Phone').length > 0) {\r\n $('#Phone').on('input', e => {\r\n riderData.phone = $('#Phone').val().toString();\r\n });\r\n }\r\n\r\n if ($('#State').length > 0) {\r\n $('#State').on('input', e => {\r\n riderData.state = $('#State').val().toString();\r\n });\r\n }\r\n\r\n if ($('#Street').length > 0) {\r\n $('#Street').on('input', e => {\r\n riderData.street = $('#Street').val().toString();\r\n });\r\n }\r\n\r\n if ($('#ZipCode').length > 0) {\r\n $('#ZipCode').on('input', e => {\r\n riderData.zipCode = $('#ZipCode').val().toString();\r\n });\r\n }\r\n\r\n if (useTextInput) {\r\n if (this.unitSystem === 1) // imperial == 1\r\n {\r\n if ($('#heightFeet').length > 0) {\r\n $('#heightFeet').on('input', e => {\r\n riderData.height = Number(this.getInchesToMeters());\r\n });\r\n }\r\n\r\n if ($('#heightInch').length > 0) {\r\n $('#heightInch').on('input', e => {\r\n riderData.height = Number(this.getInchesToMeters());\r\n });\r\n }\r\n\r\n if ($('#Weight').length > 0) {\r\n $('#Weight').on('input', e => {\r\n const weightInLbs = Number($('#Weight').val().toString());\r\n riderData.weight = this.lbsToKg(weightInLbs);\r\n });\r\n }\r\n } else {\r\n if ($('#Height').length > 0) {\r\n $('#Height').on('input', e => {\r\n const heightInMeter = Number($('#Height').val().toString());\r\n riderData.height = heightInMeter * 100;\r\n });\r\n }\r\n\r\n if ($('#Weight').length > 0) {\r\n $('#Weight').on('input', e => {\r\n riderData.weight = Number($('#Weight').val().toString());\r\n });\r\n }\r\n }\r\n }\r\n }\r\n\r\n private kgToLbs(kg: number): number {\r\n const lbs = kg * 2.2046;\r\n return lbs;\r\n }\r\n\r\n private lbsToKg(lbs: number): number {\r\n return lbs * 0.45359237;\r\n }\r\n\r\n private metersToInches(meters: number): number {\r\n const inches = meters * 39.37;\r\n return inches;\r\n }\r\n\r\n private getInchesToMeters(): number {\r\n const inches = this.getHeightInches();\r\n const meters = inches / 39.370;\r\n return meters;\r\n }\r\n\r\n private getHeightInches() {\r\n let feet = $('#heightFeet').val();\r\n let inches = $('#heightInch').val();\r\n\r\n let convertedInches = this.convertFeetAndInchesToInches(feet, inches);\r\n return convertedInches;\r\n }\r\n\r\n private convertFeetAndInchesToInches(feet, inches) {\r\n // Convert feet to inches by multiplying by 12\r\n let totalInches = feet * 12;\r\n // Add the remaining inches\r\n totalInches += inches;\r\n // Return the total inches\r\n return totalInches;\r\n }\r\n\r\n private initDropDowns(riderData: models.RiderData, useTextInput: boolean) {\r\n this.initCountryDropDown(riderData);\r\n this.initGenderDropDown(riderData);\r\n this.initSkillLevelDropDown(riderData);\r\n this.initShoeSizeSystemDropDown(riderData);\r\n this.initShoeSizeDropDown(riderData);\r\n\r\n if (!useTextInput) {\r\n this.initHeightDropDown(riderData);\r\n this.initWeightDropDown(riderData);\r\n }\r\n }\r\n\r\n private async setValueFromProductAndRiderDetailsToForm(riderData: models.RiderData, useTextInput: boolean) {\r\n return new Promise<void>((resolve) => {\r\n\r\n if ($('#City').length > 0) {\r\n $('#City').val(riderData.city);\r\n $('#City').text(riderData.city);\r\n }\r\n\r\n if ($('#Phone').length > 0) {\r\n $('#Phone').val(riderData.phone);\r\n $('#Phone').text(riderData.phone);\r\n }\r\n\r\n if ($('#State').length > 0) {\r\n $('#State').val(riderData.state);\r\n $('#State').text(riderData.state);\r\n }\r\n\r\n if ($('#Street').length > 0) {\r\n $('#Street').val(riderData.street);\r\n $('#Street').text(riderData.street);\r\n }\r\n\r\n if ($('#ZipCode').length > 0) {\r\n $('#ZipCode').val(riderData.zipCode);\r\n $('#ZipCode').text(riderData.zipCode);\r\n }\r\n\r\n if (useTextInput) {\r\n if (this.unitSystem === 1) {\r\n\r\n if (riderData.height != undefined || riderData.height != null) {\r\n\r\n const heightInInches = this.metersToInches(riderData.height / 100);\r\n\r\n let feet = Math.floor(heightInInches / 12);\r\n let inches = heightInInches % 12;\r\n\r\n $('#heightFeet').val(feet);\r\n $('#heightFeet').text(feet);\r\n\r\n $('#heightInch').val(inches.toFixed(2));\r\n $('#heightInch').text(inches.toFixed(2));\r\n }\r\n\r\n if (riderData.weight != undefined || riderData.weight != null) {\r\n\r\n let weightInLbs = this.kgToLbs(riderData.weight);\r\n let weight = parseFloat(weightInLbs.toFixed(2));\r\n $('#Weight').val(weight);\r\n $('#Weight').text(weight);\r\n }\r\n } else {\r\n if ($('#Height').length > 0) {\r\n\r\n let height = riderData?.height;\r\n\r\n this.applyMeterMask($('#Height')[0] as HTMLInputElement);\r\n\r\n $('#Height').val(height);\r\n $('#Height').text(height);\r\n }\r\n\r\n if ($('#Weight').length > 0) {\r\n\r\n let weight = riderData.weight;\r\n\r\n if (weight != undefined || weight != null) {\r\n weight = parseFloat(weight.toFixed(2));\r\n }\r\n\r\n $('#Weight').val(weight);\r\n $('#Weight').text(weight);\r\n }\r\n }\r\n }\r\n\r\n resolve();\r\n });\r\n }\r\n\r\n hasForm(): boolean {\r\n if ($(this.formName).length === 0) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n\r\n formIsValid(): boolean {\r\n let valid = $(this.formName)?.valid();\r\n return valid;\r\n }\r\n\r\n setEmptyValues(riderData: models.RiderData) {\r\n riderData = new models.RiderData();\r\n riderData.customerName = \"name\";\r\n riderData.customerEmail = \"mail\";\r\n }\r\n\r\n private initShoeSizeSystemDropDown(riderData: models.RiderData) {\r\n if ($('.rental_customer_details-shoeSizeSystem').length === 0) {\r\n return;\r\n }\r\n\r\n this.shoeSizeSystemDropDown = new AxDropdown();\r\n this.shoeSizeSystemDropDown.init(`.rental_customer_details-shoeSizeSystem`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n try {\r\n const value = this.shoeSizeSystemDropDown.getValue().toString();\r\n if (riderData.shoeSizeSystem !== Number(value)) {\r\n riderData.shoeSizeSystem = Number(value);\r\n this.reloadSubject.next(riderData);\r\n }\r\n } catch (e) {\r\n\r\n }\r\n }\r\n });\r\n\r\n if (riderData.shoeSizeSystem != undefined || riderData.shoeSizeSystem != null) {\r\n this.shoeSizeSystemDropDown.setValue(riderData.shoeSizeSystem.toString());\r\n }\r\n }\r\n\r\n private initHeightDropDown(riderData: models.RiderData) {\r\n if ($('.rental_customer_details-height').length === 0) {\r\n return;\r\n }\r\n\r\n this.heightDropDown = new AxDropdown();\r\n this.heightDropDown.init(`.rental_customer_details-height`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n try {\r\n const value = this.heightDropDown.getValue().toString();\r\n $('#Height').val(value);\r\n riderData.height = Number(value);\r\n } catch (e) {\r\n\r\n }\r\n }\r\n });\r\n\r\n if (riderData.height != undefined || riderData.height != null) {\r\n this.heightDropDown.setValue(riderData.height.toString());\r\n }\r\n }\r\n\r\n private initShoeSizeDropDown(riderData: models.RiderData) {\r\n if ($('.rental_customer_details-shoeSize').length === 0) {\r\n return;\r\n }\r\n\r\n this.shoeSizeDropDown = new AxDropdown();\r\n this.shoeSizeDropDown.init(`.rental_customer_details-shoeSize`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n try {\r\n const value = this.shoeSizeDropDown.getValue().toString();\r\n $('#ShoeSize').val(value);\r\n riderData.shoeSize = Number(value);\r\n } catch (e) {\r\n\r\n }\r\n }\r\n });\r\n\r\n if (riderData.shoeSize != undefined || riderData.shoeSize != null) {\r\n this.shoeSizeDropDown.setValue(riderData.shoeSize.toString());\r\n }\r\n }\r\n\r\n private initWeightDropDown(riderData: models.RiderData) {\r\n if ($('.rental_customer_details-weight').length === 0) {\r\n return;\r\n }\r\n\r\n this.weightDropDown = new AxDropdown();\r\n this.weightDropDown.init(`.rental_customer_details-weight`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n try {\r\n const value = this.weightDropDown.getValue().toString();\r\n $('#Weight').val(value);\r\n riderData.weight = Number(value);\r\n } catch (e) {\r\n\r\n }\r\n }\r\n });\r\n\r\n if (riderData.weight != undefined || riderData.weight != null) {\r\n this.weightDropDown.setValue(riderData.weight.toString());\r\n }\r\n }\r\n\r\n private initCountryDropDown(riderData: models.RiderData) {\r\n if ($('.rental_customer_details-country').length === 0) {\r\n return;\r\n }\r\n\r\n this.countryDropDown = new AxDropdown();\r\n this.countryDropDown.init(`.rental_customer_details-country`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n const value = this.countryDropDown.getValue().toString();\r\n $('#CustomerCountry').val(value);\r\n riderData.country = value;\r\n }\r\n });\r\n\r\n if (riderData.country != undefined || riderData.country != null) {\r\n this.countryDropDown.setValue(riderData.country);\r\n }\r\n }\r\n\r\n private initGenderDropDown(riderData: models.RiderData) {\r\n if ($('.rental_customer_details-gender').length === 0) {\r\n return;\r\n }\r\n\r\n this.genderDropDown = new AxDropdown();\r\n this.genderDropDown.init(`.rental_customer_details-gender`,\r\n {\r\n searchBar: true,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n const value = this.genderDropDown.getValue().toString();\r\n $('#Gender').val(value);\r\n riderData.gender = value;\r\n }\r\n });\r\n\r\n if (riderData.gender != undefined || riderData.gender != null) {\r\n this.genderDropDown.setValue(riderData.gender);\r\n }\r\n }\r\n\r\n private initSkillLevelDropDown(riderData: models.RiderData) {\r\n if ($('.rental_customer_details-skillLevel').length === 0) {\r\n return;\r\n }\r\n\r\n this.skillLevelDropDown = new AxDropdown();\r\n this.skillLevelDropDown.init(`.rental_customer_details-skillLevel`,\r\n {\r\n searchBar: false,\r\n multiSelect: false,\r\n onOpen: () => {\r\n\r\n },\r\n onSelect: (elem: any) => {\r\n const value = this.skillLevelDropDown.getValue().toString();\r\n $('#SkillLevel').val(value);\r\n riderData.skillLevel = Number(value);\r\n }\r\n });\r\n\r\n if (riderData.skillLevel != undefined || riderData.skillLevel != null) {\r\n this.skillLevelDropDown.setValue(riderData.skillLevel.toString());\r\n }\r\n }\r\n\r\n private getValidationRules(): JQueryValidation.RulesDictionary {\r\n const that = this;\r\n return {\r\n hiddenPhone: {\r\n required: true,\r\n regex: /([0-9]{10})|(\\([0-9]{3}\\)\\s+[0-9]{3}\\-[0-9]{4})/\r\n },\r\n phone: {\r\n required: true,\r\n regex: /([0-9]{10})|(\\([0-9]{3}\\)\\s+[0-9]{3}\\-[0-9]{4})/,\r\n normalizer: function (value) {\r\n let dropdownVal = $(this).parents(\".ax-phone-field\").find(\".hidden-input\").val() as string;\r\n }\r\n },\r\n email: {\r\n required: true,\r\n email: true,\r\n regex: /^\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b$/i,\r\n }\r\n };\r\n }\r\n\r\n applyMeterMask(inputElement: HTMLInputElement) {\r\n const meterFormat = \"[0].[00]\";\r\n //const feetAndInchesFormat = '9999\\'99\"';\r\n\r\n const listener = MaskedTextChangedListener.installOn(meterFormat, inputElement,\r\n new class implements MaskedTextChangedListener.ValueListener {\r\n public onTextChanged(maskFilled: boolean, extractedValue: string, formattedText: string): void {\r\n console.log(maskFilled, extractedValue, formattedText);\r\n }\r\n }(),\r\n [], // affineFormats\r\n [], // customNotations\r\n null, // affinityCalculationStrategy\r\n true // autocomplete\r\n );\r\n }\r\n\r\n applyFeetAndInchesMask(inputElement: HTMLInputElement) {\r\n const feetAndInchesFormat = \"[00]' [00]''\";\r\n //const feetAndInchesFormat = '9999\\'99\"';\r\n\r\n const listener = MaskedTextChangedListener.installOn(feetAndInchesFormat, inputElement,\r\n new class implements MaskedTextChangedListener.ValueListener {\r\n public onTextChanged(maskFilled: boolean, extractedValue: string, formattedText: string): void {\r\n console.log(maskFilled, extractedValue, formattedText);\r\n }\r\n }(),\r\n [], // affineFormats\r\n [], // customNotations\r\n null, // affinityCalculationStrategy\r\n true // autocomplete\r\n );\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"LessonPackageStorage\")\r\nexport class LessonPackageStorage implements AxInit {\r\n AxInit(init): void {\r\n const url = new URL(window.location.href);\r\n const options = url.searchParams.getAll(\"options[]\") as string[];\r\n\r\n\r\n if (options.length > 0) {\r\n const optionsValid = options.reduce((b, curr) => b && !Number.isNaN(parseInt(curr)), true);\r\n\r\n if (optionsValid) {\r\n this.setDefaultLevelStorage(options.map(x => parseInt(x)));\r\n window.history.replaceState({}, document.title, window.location.pathname);\r\n }\r\n }\r\n }\r\n\r\n setDefaultLevelStorage(levels: number[]) {\r\n this.saveItem(\"lessonLevel\", levels);\r\n }\r\n\r\n getDefaultLevelStorage() {\r\n return this.getItem<number[]>(\"lessonLevel\");\r\n }\r\n\r\n cleanDefaultLevelStorage() {\r\n this.removeItem(\"lessonLevel\");\r\n }\r\n \r\n removeItem(key: string) {\r\n localStorage.removeItem(`ax-lp-${key}`);\r\n }\r\n\r\n saveItem(key: string, value: any) {\r\n localStorage.setItem(`ax-lp-${key}`, JSON.stringify(value));\r\n }\r\n\r\n getItem<T>(key: string) {\r\n return JSON.parse(localStorage.getItem(`ax-lp-${key}`));\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { RequestHelper } from \"../../Lib/Helper/RequestHelper\";\r\nimport { ProgressBarMode } from \"../Global/Progressbar\";\r\n\r\n@ModuleName(\"ToCheckout\")\r\nexport class ToCheckout implements AxInit {\r\n constructor(private _requestHelper = new RequestHelper()) { }\r\n\r\n initData: ToCheckoutInitData;\r\n\r\n AxInit(init: ToCheckoutInitData): void {\r\n this.initData = init;\r\n AxessViewer.loadPartialView('/ShoppingCart/Checkout', init.formData, (result) => {\r\n\r\n if (result.success) {\r\n if (this.initData.processIndicatorActive) {\r\n result.successLink = this._requestHelper.insertParam(result.successLink, \"ref\", this.initData.progressBarMode == ProgressBarMode.Suballotment ? \"pit\" : \"pi\");\r\n }\r\n window.location.href = result.successLink;\r\n }\r\n else {\r\n if (typeof result.redirect != 'undefined') {\r\n window.location.href = result.redirect;\r\n }\r\n\r\n let errors = JSON.parse(result.errors);\r\n this._requestHelper.postToUrl(this.initData.shoppingCartUrl, errors);\r\n }\r\n }, {});\r\n }\r\n}\r\n\r\ninterface ToCheckoutInitData {\r\n formData: any;\r\n shoppingCartUrl: string;\r\n processIndicatorActive: boolean;\r\n progressBarMode: ProgressBarMode;\r\n}", "import { BodyUtility } from '../../Components/AxUtility/BodyUtility';\r\nimport { AxInit, ModuleName } from '../../Lib/AxSystem/AxInit';\r\nimport { AxLoad } from '../../Lib/AxSystem/AxLoad';\r\n\r\n@ModuleName(\"PopUpShoppingCart\")\r\nexport class PopUpShoppingCart implements AxInit {\r\n constructor(protected _bodyUtility: BodyUtility = new BodyUtility()) { }\r\n\r\n AxInit() {\r\n $(document).on('click', '.ax-nav-item-sc', (e) => {\r\n e.preventDefault();\r\n $('.pop-up-cart').removeClass('collapsed');\r\n $('.pop-up-cart--filler').show();\r\n setTimeout(() => $('.pop-up-cart--filler').removeClass('collapsed'), 10);\r\n this.loadPopUpShoppingCart();\r\n });\r\n\r\n $(document).on('click', '.pop-up-cart--closeBtn, .pop-up-cart--filler', (e) => {\r\n e.preventDefault();\r\n $('.pop-up-cart, .pop-up-cart--filler').addClass('collapsed');\r\n setTimeout(() => $('.pop-up-cart--filler').hide(), 300);\r\n setTimeout(() => this.unloadPopUpShoppingCart(), 350);\r\n });\r\n\r\n $(document).on('click', '.pop-up-cart--deleteItemBtn', (e) => {\r\n e.preventDefault();\r\n const cartEntryID = $(e.target).attr('data-position-id');\r\n this.removeCartEntry(cartEntryID);\r\n });\r\n\r\n $(document).on('click', '.pop-up-cart--giftCardRemove', (e) => {\r\n e.preventDefault();\r\n const cartEntryID = $(e.target).attr('data-position-id');\r\n this.removeCartEntry(cartEntryID);\r\n });\r\n\r\n $(document).on('click', '#btnApplyPromoCode', (e) => {\r\n e.preventDefault();\r\n this.applyPromoCode();\r\n });\r\n\r\n $(document).on('click',\r\n '.pop-up-cart--entryPromoCode',\r\n (e) => {\r\n e.preventDefault();\r\n let promocode = $(e.target).attr('data');\r\n this.unloadPopUpShoppingCart();\r\n AxessViewer.loadPartialView('/ShoppingCart/RemovePromoCode',\r\n { code: promocode },\r\n () => {\r\n this.loadPopUpShoppingCart();\r\n },\r\n {\r\n reload: false,\r\n });\r\n });\r\n\r\n $(() => {\r\n if (localStorage.getItem('reloadFlag') === 'true') {\r\n const popUpCartFiller$ = $('.pop-up-cart--filler');\r\n const popUpShoppingCart = new PopUpShoppingCart();\r\n localStorage.removeItem('reloadFlag');\r\n $('.pop-up-cart').removeClass('collapsed');\r\n popUpCartFiller$.css('display', 'block');\r\n setTimeout(() => popUpCartFiller$.css('opacity', 0.7), 10);\r\n\r\n popUpShoppingCart.loadPopUpShoppingCart();\r\n }\r\n });\r\n }\r\n\r\n private loadPopUpShoppingCart() {\r\n const url = '/ShoppingCart/GetPopUpShoppingCart';\r\n const data = {};\r\n $('html').css('top', 0).scrollTop(0);\r\n\r\n AxessViewer.loadPartialView(url, data, (res) => {\r\n $('#popUpShoppingCart').html(res);\r\n this._bodyUtility.DisableScroll();\r\n\r\n\r\n AxLoad.LoadModule(\"ShoppingCartReservationTimer\");\r\n }, {\r\n dataType: 'html',\r\n })\r\n }\r\n\r\n private unloadPopUpShoppingCart() {\r\n this._bodyUtility.EnableScroll();\r\n const spinner$ = $('<div>', { class: 'ax-loading-spinner pop-up-cart--loader' });\r\n $('#popUpShoppingCart').html(spinner$.html());\r\n }\r\n\r\n private removeCartEntry(cartEntryID: string) {\r\n this.unloadPopUpShoppingCart();\r\n\r\n AxessViewer.loadPartialView('/ShoppingCart/RemoveCartPosition',\r\n { targetPositionId: cartEntryID },\r\n () => this.loadPopUpShoppingCart(),\r\n { reload: false },\r\n );\r\n }\r\n\r\n private applyPromoCode() {\r\n $('[data-promocode=\"result\"]').remove();\r\n\r\n const giftCardSerialNr: string | number | string[] = $('#PromoCodePop').val();\r\n\r\n AxessViewer.loadPartialView('/ShoppingCart/CheckPromoCodes', {\r\n promoCodes: [giftCardSerialNr],\r\n }, (result: ICheckPromoCodeResult) => {\r\n if (result.success && result.discountFound) {\r\n if (result?.isPromocodeApplied == false) {\r\n this.applyGiftCardEMoney(giftCardSerialNr, result);\r\n } else {\r\n localStorage.setItem('reloadFlag', 'true');\r\n location.reload();\r\n }\r\n } else if (result?.isPromocodeApplied === false) {\r\n this.applyGiftCardEMoney(giftCardSerialNr, result);\r\n }\r\n });\r\n }\r\n\r\n\r\n private getGiftCardSerialNr() {\r\n const promocode: string | number | string[] = $('#PromoCodePop').val();\r\n if (!promocode) {\r\n return;\r\n }\r\n return promocode;\r\n }\r\n\r\n private applyGiftCardEMoney(giftCard: string | number | string[], promoCodeResult: ICheckPromoCodeResult) {\r\n AxessViewer.loadPartialView('/GiftCards/ApplyGiftCardEMoney', {\r\n giftCard,\r\n }, (result: any) => {\r\n if (result.success) {\r\n localStorage.setItem('reloadFlag', 'true');\r\n location.reload();\r\n } else if (promoCodeResult.discountFound === false) {\r\n //<label class=\"field-error ax-pt-xs\">Reset</label>\r\n const errorLabel = $('<label></label>').addClass('field-error ax-pt-xs').attr('data-promocode', \"result\").html(promoCodeResult.errorMessage);\r\n $('[name=PromoCodPop] + label').after(errorLabel);\r\n\r\n setTimeout(() => {\r\n $('[data-promocode=\"result\"]').remove();\r\n }, 2500);\r\n }\r\n });\r\n }\r\n\r\n}\r\n\r\ninterface ICheckPromoCodeResult {\r\n success: boolean;\r\n discountFound: false;\r\n promocodes: string[];\r\n isPromocodeApplied: boolean;\r\n errorMessage: string;\r\n}", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpTransportType } from \"./ITransport\";\r\n\r\n/** Error thrown when an HTTP request fails. */\r\nexport class HttpError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The HTTP status code represented by this error. */\r\n public statusCode: number;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n * @param {number} statusCode The HTTP status code represented by this error.\r\n */\r\n constructor(errorMessage: string, statusCode: number) {\r\n const trueProto = new.target.prototype;\r\n super(`${errorMessage}: Status code '${statusCode}'`);\r\n this.statusCode = statusCode;\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when a timeout elapses. */\r\nexport class TimeoutError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage: string = \"A timeout occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when an action is aborted. */\r\nexport class AbortError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** Constructs a new instance of {@link AbortError}.\r\n *\r\n * @param {string} errorMessage A descriptive error message.\r\n */\r\n constructor(errorMessage: string = \"An abort occurred.\") {\r\n const trueProto = new.target.prototype;\r\n super(errorMessage);\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport is unsupported by the browser. */\r\n/** @private */\r\nexport class UnsupportedTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'UnsupportedTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport is disabled by the browser. */\r\n/** @private */\r\nexport class DisabledTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'DisabledTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the selected transport cannot be started. */\r\n/** @private */\r\nexport class FailedToStartTransportError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The {@link @microsoft/signalr.HttpTransportType} this error occurred on. */\r\n public transport: HttpTransportType;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occurred on.\r\n */\r\n constructor(message: string, transport: HttpTransportType) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.transport = transport;\r\n this.errorType = 'FailedToStartTransportError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when the negotiation with the server failed to complete. */\r\n/** @private */\r\nexport class FailedToNegotiateWithServerError extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The type name of this error. */\r\n public errorType: string;\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n */\r\n constructor(message: string) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n this.errorType = 'FailedToNegotiateWithServerError';\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n\r\n/** Error thrown when multiple errors have occurred. */\r\n/** @private */\r\nexport class AggregateErrors extends Error {\r\n // @ts-ignore: Intentionally unused.\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private __proto__: Error;\r\n\r\n /** The collection of errors this error is aggregating. */\r\n public innerErrors: Error[];\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.\r\n *\r\n * @param {string} message A descriptive error message.\r\n * @param {Error[]} innerErrors The collection of errors this error is aggregating.\r\n */\r\n constructor(message: string, innerErrors: Error[]) {\r\n const trueProto = new.target.prototype;\r\n super(message);\r\n\r\n this.innerErrors = innerErrors;\r\n\r\n // Workaround issue in Typescript compiler\r\n // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200\r\n this.__proto__ = trueProto;\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortSignal } from \"./AbortController\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\n\r\n/** Represents an HTTP request. */\r\nexport interface HttpRequest {\r\n /** The HTTP method to use for the request. */\r\n method?: string;\r\n\r\n /** The URL for the request. */\r\n url?: string;\r\n\r\n /** The body content for the request. May be a string or an ArrayBuffer (for binary data). */\r\n content?: string | ArrayBuffer;\r\n\r\n /** An object describing headers to apply to the request. */\r\n headers?: MessageHeaders;\r\n\r\n /** The XMLHttpRequestResponseType to apply to the request. */\r\n responseType?: XMLHttpRequestResponseType;\r\n\r\n /** An AbortSignal that can be monitored for cancellation. */\r\n abortSignal?: AbortSignal;\r\n\r\n /** The time to wait for the request to complete before throwing a TimeoutError. Measured in milliseconds. */\r\n timeout?: number;\r\n\r\n /** This controls whether credentials such as cookies are sent in cross-site requests. */\r\n withCredentials?: boolean;\r\n}\r\n\r\n/** Represents an HTTP response. */\r\nexport class HttpResponse {\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n */\r\n constructor(statusCode: number);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code and message.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n */\r\n constructor(statusCode: number, statusText: string);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and string content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {string} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: string);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and binary content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {ArrayBuffer} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: ArrayBuffer);\r\n\r\n /** Constructs a new instance of {@link @microsoft/signalr.HttpResponse} with the specified status code, message and binary content.\r\n *\r\n * @param {number} statusCode The status code of the response.\r\n * @param {string} statusText The status message of the response.\r\n * @param {string | ArrayBuffer} content The content of the response.\r\n */\r\n constructor(statusCode: number, statusText: string, content: string | ArrayBuffer);\r\n constructor(\r\n public readonly statusCode: number,\r\n public readonly statusText?: string,\r\n public readonly content?: string | ArrayBuffer) {\r\n }\r\n}\r\n\r\n/** Abstraction over an HTTP client.\r\n *\r\n * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.\r\n */\r\nexport abstract class HttpClient {\r\n /** Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public get(url: string): Promise<HttpResponse>;\r\n\r\n /** Issues an HTTP GET request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public get(url: string, options: HttpRequest): Promise<HttpResponse>;\r\n public get(url: string, options?: HttpRequest): Promise<HttpResponse> {\r\n return this.send({\r\n ...options,\r\n method: \"GET\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public post(url: string): Promise<HttpResponse>;\r\n\r\n /** Issues an HTTP POST request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public post(url: string, options: HttpRequest): Promise<HttpResponse>;\r\n public post(url: string, options?: HttpRequest): Promise<HttpResponse> {\r\n return this.send({\r\n ...options,\r\n method: \"POST\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public delete(url: string): Promise<HttpResponse>;\r\n\r\n /** Issues an HTTP DELETE request to the specified URL, returning a Promise that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {string} url The URL for the request.\r\n * @param {HttpRequest} options Additional options to configure the request. The 'url' field in this object will be overridden by the url parameter.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an {@link @microsoft/signalr.HttpResponse} describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public delete(url: string, options: HttpRequest): Promise<HttpResponse>;\r\n public delete(url: string, options?: HttpRequest): Promise<HttpResponse> {\r\n return this.send({\r\n ...options,\r\n method: \"DELETE\",\r\n url,\r\n });\r\n }\r\n\r\n /** Issues an HTTP request to the specified URL, returning a {@link Promise} that resolves with an {@link @microsoft/signalr.HttpResponse} representing the result.\r\n *\r\n * @param {HttpRequest} request An {@link @microsoft/signalr.HttpRequest} describing the request to send.\r\n * @returns {Promise<HttpResponse>} A Promise that resolves with an HttpResponse describing the response, or rejects with an Error indicating a failure.\r\n */\r\n public abstract send(request: HttpRequest): Promise<HttpResponse>;\r\n\r\n /** Gets all cookies that apply to the specified URL.\r\n *\r\n * @param url The URL that the cookies are valid for.\r\n * @returns {string} A string containing all the key-value cookie pairs for the specified URL.\r\n */\r\n // @ts-ignore\r\n public getCookieString(url: string): string {\r\n return \"\";\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.\r\n/** Indicates the severity of a log message.\r\n *\r\n * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.\r\n */\r\nexport enum LogLevel {\r\n /** Log level for very low severity diagnostic messages. */\r\n Trace = 0,\r\n /** Log level for low severity diagnostic messages. */\r\n Debug = 1,\r\n /** Log level for informational diagnostic messages. */\r\n Information = 2,\r\n /** Log level for diagnostic messages that indicate a non-fatal problem. */\r\n Warning = 3,\r\n /** Log level for diagnostic messages that indicate a failure in the current operation. */\r\n Error = 4,\r\n /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */\r\n Critical = 5,\r\n /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */\r\n None = 6,\r\n}\r\n\r\n/** An abstraction that provides a sink for diagnostic messages. */\r\nexport interface ILogger {\r\n /** Called by the framework to emit a diagnostic message.\r\n *\r\n * @param {LogLevel} logLevel The severity level of the message.\r\n * @param {string} message The message.\r\n */\r\n log(logLevel: LogLevel, message: string): void;\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\n\r\n/** A logger that does nothing when log messages are sent to it. */\r\nexport class NullLogger implements ILogger {\r\n /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */\r\n public static instance: ILogger = new NullLogger();\r\n\r\n private constructor() {}\r\n\r\n /** @inheritDoc */\r\n // eslint-disable-next-line\r\n public log(_logLevel: LogLevel, _message: string): void {\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { IStreamSubscriber, ISubscription } from \"./Stream\";\r\nimport { Subject } from \"./Subject\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n// Version token that will be replaced by the prepack command\r\n/** The version of the SignalR client. */\r\n\r\nexport const VERSION: string = \"0.0.0-DEV_BUILD\";\r\n/** @private */\r\nexport class Arg {\r\n public static isRequired(val: any, name: string): void {\r\n if (val === null || val === undefined) {\r\n throw new Error(`The '${name}' argument is required.`);\r\n }\r\n }\r\n public static isNotEmpty(val: string, name: string): void {\r\n if (!val || val.match(/^\\s*$/)) {\r\n throw new Error(`The '${name}' argument should not be empty.`);\r\n }\r\n }\r\n\r\n public static isIn(val: any, values: any, name: string): void {\r\n // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.\r\n if (!(val in values)) {\r\n throw new Error(`Unknown ${name} value: ${val}.`);\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport class Platform {\r\n // react-native has a window but no document so we should check both\r\n public static get isBrowser(): boolean {\r\n return !Platform.isNode && typeof window === \"object\" && typeof window.document === \"object\";\r\n }\r\n\r\n // WebWorkers don't have a window object so the isBrowser check would fail\r\n public static get isWebWorker(): boolean {\r\n return !Platform.isNode && typeof self === \"object\" && \"importScripts\" in self;\r\n }\r\n\r\n // react-native has a window but no document\r\n static get isReactNative(): boolean {\r\n return !Platform.isNode && typeof window === \"object\" && typeof window.document === \"undefined\";\r\n }\r\n\r\n // Node apps shouldn't have a window object, but WebWorkers don't either\r\n // so we need to check for both WebWorker and window\r\n public static get isNode(): boolean {\r\n return typeof process !== \"undefined\" && process.release && process.release.name === \"node\";\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getDataDetail(data: any, includeContent: boolean): string {\r\n let detail = \"\";\r\n if (isArrayBuffer(data)) {\r\n detail = `Binary data of length ${data.byteLength}`;\r\n if (includeContent) {\r\n detail += `. Content: '${formatArrayBuffer(data)}'`;\r\n }\r\n } else if (typeof data === \"string\") {\r\n detail = `String data of length ${data.length}`;\r\n if (includeContent) {\r\n detail += `. Content: '${data}'`;\r\n }\r\n }\r\n return detail;\r\n}\r\n\r\n/** @private */\r\nexport function formatArrayBuffer(data: ArrayBuffer): string {\r\n const view = new Uint8Array(data);\r\n\r\n // Uint8Array.map only supports returning another Uint8Array?\r\n let str = \"\";\r\n view.forEach((num) => {\r\n const pad = num < 16 ? \"0\" : \"\";\r\n str += `0x${pad}${num.toString(16)} `;\r\n });\r\n\r\n // Trim of trailing space.\r\n return str.substr(0, str.length - 1);\r\n}\r\n\r\n// Also in signalr-protocol-msgpack/Utils.ts\r\n/** @private */\r\nexport function isArrayBuffer(val: any): val is ArrayBuffer {\r\n return val && typeof ArrayBuffer !== \"undefined\" &&\r\n (val instanceof ArrayBuffer ||\r\n // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof\r\n (val.constructor && val.constructor.name === \"ArrayBuffer\"));\r\n}\r\n\r\n/** @private */\r\nexport async function sendMessage(logger: ILogger, transportName: string, httpClient: HttpClient, url: string,\r\n content: string | ArrayBuffer, options: IHttpConnectionOptions): Promise<void> {\r\n const headers: {[k: string]: string} = {};\r\n\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n logger.log(LogLevel.Trace, `(${transportName} transport) sending data. ${getDataDetail(content, options.logMessageContent!)}.`);\r\n\r\n const responseType = isArrayBuffer(content) ? \"arraybuffer\" : \"text\";\r\n const response = await httpClient.post(url, {\r\n content,\r\n headers: { ...headers, ...options.headers},\r\n responseType,\r\n timeout: options.timeout,\r\n withCredentials: options.withCredentials,\r\n });\r\n\r\n logger.log(LogLevel.Trace, `(${transportName} transport) request complete. Response status: ${response.statusCode}.`);\r\n}\r\n\r\n/** @private */\r\nexport function createLogger(logger?: ILogger | LogLevel): ILogger {\r\n if (logger === undefined) {\r\n return new ConsoleLogger(LogLevel.Information);\r\n }\r\n\r\n if (logger === null) {\r\n return NullLogger.instance;\r\n }\r\n\r\n if ((logger as ILogger).log !== undefined) {\r\n return logger as ILogger;\r\n }\r\n\r\n return new ConsoleLogger(logger as LogLevel);\r\n}\r\n\r\n/** @private */\r\nexport class SubjectSubscription<T> implements ISubscription<T> {\r\n private _subject: Subject<T>;\r\n private _observer: IStreamSubscriber<T>;\r\n\r\n constructor(subject: Subject<T>, observer: IStreamSubscriber<T>) {\r\n this._subject = subject;\r\n this._observer = observer;\r\n }\r\n\r\n public dispose(): void {\r\n const index: number = this._subject.observers.indexOf(this._observer);\r\n if (index > -1) {\r\n this._subject.observers.splice(index, 1);\r\n }\r\n\r\n if (this._subject.observers.length === 0 && this._subject.cancelCallback) {\r\n this._subject.cancelCallback().catch((_) => { });\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport class ConsoleLogger implements ILogger {\r\n private readonly _minLevel: LogLevel;\r\n\r\n // Public for testing purposes.\r\n public out: {\r\n error(message: any): void,\r\n warn(message: any): void,\r\n info(message: any): void,\r\n log(message: any): void,\r\n };\r\n\r\n constructor(minimumLogLevel: LogLevel) {\r\n this._minLevel = minimumLogLevel;\r\n this.out = console;\r\n }\r\n\r\n public log(logLevel: LogLevel, message: string): void {\r\n if (logLevel >= this._minLevel) {\r\n const msg = `[${new Date().toISOString()}] ${LogLevel[logLevel]}: ${message}`;\r\n switch (logLevel) {\r\n case LogLevel.Critical:\r\n case LogLevel.Error:\r\n this.out.error(msg);\r\n break;\r\n case LogLevel.Warning:\r\n this.out.warn(msg);\r\n break;\r\n case LogLevel.Information:\r\n this.out.info(msg);\r\n break;\r\n default:\r\n // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug\r\n this.out.log(msg);\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getUserAgentHeader(): [string, string] {\r\n let userAgentHeaderName = \"X-SignalR-User-Agent\";\r\n if (Platform.isNode) {\r\n userAgentHeaderName = \"User-Agent\";\r\n }\r\n return [ userAgentHeaderName, constructUserAgent(VERSION, getOsName(), getRuntime(), getRuntimeVersion()) ];\r\n}\r\n\r\n/** @private */\r\nexport function constructUserAgent(version: string, os: string, runtime: string, runtimeVersion: string | undefined): string {\r\n // Microsoft SignalR/[Version] ([Detailed Version]; [Operating System]; [Runtime]; [Runtime Version])\r\n let userAgent: string = \"Microsoft SignalR/\";\r\n\r\n const majorAndMinor = version.split(\".\");\r\n userAgent += `${majorAndMinor[0]}.${majorAndMinor[1]}`;\r\n userAgent += ` (${version}; `;\r\n\r\n if (os && os !== \"\") {\r\n userAgent += `${os}; `;\r\n } else {\r\n userAgent += \"Unknown OS; \";\r\n }\r\n\r\n userAgent += `${runtime}`;\r\n\r\n if (runtimeVersion) {\r\n userAgent += `; ${runtimeVersion}`;\r\n } else {\r\n userAgent += \"; Unknown Runtime Version\";\r\n }\r\n\r\n userAgent += \")\";\r\n return userAgent;\r\n}\r\n\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getOsName(): string {\r\n if (Platform.isNode) {\r\n switch (process.platform) {\r\n case \"win32\":\r\n return \"Windows NT\";\r\n case \"darwin\":\r\n return \"macOS\";\r\n case \"linux\":\r\n return \"Linux\";\r\n default:\r\n return process.platform;\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n}\r\n\r\n// eslint-disable-next-line spaced-comment\r\n/*#__PURE__*/ function getRuntimeVersion(): string | undefined {\r\n if (Platform.isNode) {\r\n return process.versions.node;\r\n }\r\n return undefined;\r\n}\r\n\r\nfunction getRuntime(): string {\r\n if (Platform.isNode) {\r\n return \"NodeJS\";\r\n } else {\r\n return \"Browser\";\r\n }\r\n}\r\n\r\n/** @private */\r\nexport function getErrorString(e: any): string {\r\n if (e.stack) {\r\n return e.stack;\r\n } else if (e.message) {\r\n return e.message;\r\n }\r\n return `${e}`;\r\n}\r\n\r\n/** @private */\r\nexport function getGlobalThis(): unknown {\r\n // globalThis is semi-new and not available in Node until v12\r\n if (typeof globalThis !== \"undefined\") {\r\n return globalThis;\r\n }\r\n if (typeof self !== \"undefined\") {\r\n return self;\r\n }\r\n if (typeof window !== \"undefined\") {\r\n return window;\r\n }\r\n if (typeof global !== \"undefined\") {\r\n return global;\r\n }\r\n throw new Error(\"could not find global\");\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// @ts-ignore: This will be removed from built files and is here to make the types available during dev work\r\nimport { CookieJar } from \"@types/tough-cookie\";\r\n\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { Platform, getGlobalThis, isArrayBuffer } from \"./Utils\";\r\n\r\nexport class FetchHttpClient extends HttpClient {\r\n private readonly _abortControllerType: { prototype: AbortController, new(): AbortController };\r\n private readonly _fetchType: (input: RequestInfo, init?: RequestInit) => Promise<Response>;\r\n private readonly _jar?: CookieJar;\r\n\r\n private readonly _logger: ILogger;\r\n\r\n public constructor(logger: ILogger) {\r\n super();\r\n this._logger = logger;\r\n\r\n // Node added a fetch implementation to the global scope starting in v18.\r\n // We need to add a cookie jar in node to be able to share cookies with WebSocket\r\n if (typeof fetch === \"undefined\" || Platform.isNode) {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n\r\n // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests\r\n this._jar = new (requireFunc(\"tough-cookie\")).CookieJar();\r\n\r\n if (typeof fetch === \"undefined\") {\r\n this._fetchType = requireFunc(\"node-fetch\");\r\n } else {\r\n // Use fetch from Node if available\r\n this._fetchType = fetch;\r\n }\r\n\r\n // node-fetch doesn't have a nice API for getting and setting cookies\r\n // fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one\r\n this._fetchType = requireFunc(\"fetch-cookie\")(this._fetchType, this._jar);\r\n } else {\r\n this._fetchType = fetch.bind(getGlobalThis());\r\n }\r\n if (typeof AbortController === \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n\r\n // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide\r\n this._abortControllerType = requireFunc(\"abort-controller\");\r\n } else {\r\n this._abortControllerType = AbortController;\r\n }\r\n }\r\n\r\n /** @inheritDoc */\r\n public async send(request: HttpRequest): Promise<HttpResponse> {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n throw new AbortError();\r\n }\r\n\r\n if (!request.method) {\r\n throw new Error(\"No method defined.\");\r\n }\r\n if (!request.url) {\r\n throw new Error(\"No url defined.\");\r\n }\r\n\r\n const abortController = new this._abortControllerType();\r\n\r\n let error: any;\r\n // Hook our abortSignal into the abort controller\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n abortController.abort();\r\n error = new AbortError();\r\n };\r\n }\r\n\r\n // If a timeout has been passed in, setup a timeout to call abort\r\n // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout\r\n let timeoutId: any = null;\r\n if (request.timeout) {\r\n const msTimeout = request.timeout!;\r\n timeoutId = setTimeout(() => {\r\n abortController.abort();\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n error = new TimeoutError();\r\n }, msTimeout);\r\n }\r\n\r\n if (request.content === \"\") {\r\n request.content = undefined;\r\n }\r\n if (request.content) {\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n request.headers = request.headers || {};\r\n if (isArrayBuffer(request.content)) {\r\n request.headers[\"Content-Type\"] = \"application/octet-stream\";\r\n } else {\r\n request.headers[\"Content-Type\"] = \"text/plain;charset=UTF-8\";\r\n }\r\n }\r\n\r\n let response: Response;\r\n try {\r\n response = await this._fetchType(request.url!, {\r\n body: request.content,\r\n cache: \"no-cache\",\r\n credentials: request.withCredentials === true ? \"include\" : \"same-origin\",\r\n headers: {\r\n \"X-Requested-With\": \"XMLHttpRequest\",\r\n ...request.headers,\r\n },\r\n method: request.method!,\r\n mode: \"cors\",\r\n redirect: \"follow\",\r\n signal: abortController.signal,\r\n });\r\n } catch (e) {\r\n if (error) {\r\n throw error;\r\n }\r\n this._logger.log(\r\n LogLevel.Warning,\r\n `Error from HTTP request. ${e}.`,\r\n );\r\n throw e;\r\n } finally {\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n }\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n }\r\n\r\n if (!response.ok) {\r\n const errorMessage = await deserializeContent(response, \"text\") as string;\r\n throw new HttpError(errorMessage || response.statusText, response.status);\r\n }\r\n\r\n const content = deserializeContent(response, request.responseType);\r\n const payload = await content;\r\n\r\n return new HttpResponse(\r\n response.status,\r\n response.statusText,\r\n payload,\r\n );\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n let cookies: string = \"\";\r\n if (Platform.isNode && this._jar) {\r\n // @ts-ignore: unused variable\r\n this._jar.getCookies(url, (e, c) => cookies = c.join(\"; \"));\r\n }\r\n return cookies;\r\n }\r\n}\r\n\r\nfunction deserializeContent(response: Response, responseType?: XMLHttpRequestResponseType): Promise<string | ArrayBuffer> {\r\n let content;\r\n switch (responseType) {\r\n case \"arraybuffer\":\r\n content = response.arrayBuffer();\r\n break;\r\n case \"text\":\r\n content = response.text();\r\n break;\r\n case \"blob\":\r\n case \"document\":\r\n case \"json\":\r\n throw new Error(`${responseType} is not supported.`);\r\n default:\r\n content = response.text();\r\n break;\r\n }\r\n\r\n return content;\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortError, HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\nexport class XhrHttpClient extends HttpClient {\r\n private readonly _logger: ILogger;\r\n\r\n public constructor(logger: ILogger) {\r\n super();\r\n this._logger = logger;\r\n }\r\n\r\n /** @inheritDoc */\r\n public send(request: HttpRequest): Promise<HttpResponse> {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n\r\n return new Promise<HttpResponse>((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n\r\n xhr.open(request.method!, request.url!, true);\r\n xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;\r\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n if (request.content === \"\") {\r\n request.content = undefined;\r\n }\r\n if (request.content) {\r\n // Explicitly setting the Content-Type header for React Native on Android platform.\r\n if (isArrayBuffer(request.content)) {\r\n xhr.setRequestHeader(\"Content-Type\", \"application/octet-stream\");\r\n } else {\r\n xhr.setRequestHeader(\"Content-Type\", \"text/plain;charset=UTF-8\");\r\n }\r\n }\r\n\r\n const headers = request.headers;\r\n if (headers) {\r\n Object.keys(headers)\r\n .forEach((header) => {\r\n xhr.setRequestHeader(header, headers[header]);\r\n });\r\n }\r\n\r\n if (request.responseType) {\r\n xhr.responseType = request.responseType;\r\n }\r\n\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = () => {\r\n xhr.abort();\r\n reject(new AbortError());\r\n };\r\n }\r\n\r\n if (request.timeout) {\r\n xhr.timeout = request.timeout;\r\n }\r\n\r\n xhr.onload = () => {\r\n if (request.abortSignal) {\r\n request.abortSignal.onabort = null;\r\n }\r\n\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));\r\n } else {\r\n reject(new HttpError(xhr.response || xhr.responseText || xhr.statusText, xhr.status));\r\n }\r\n };\r\n\r\n xhr.onerror = () => {\r\n this._logger.log(LogLevel.Warning, `Error from HTTP request. ${xhr.status}: ${xhr.statusText}.`);\r\n reject(new HttpError(xhr.statusText, xhr.status));\r\n };\r\n\r\n xhr.ontimeout = () => {\r\n this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);\r\n reject(new TimeoutError());\r\n };\r\n\r\n xhr.send(request.content);\r\n });\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortError } from \"./Errors\";\r\nimport { FetchHttpClient } from \"./FetchHttpClient\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\nimport { ILogger } from \"./ILogger\";\r\nimport { Platform } from \"./Utils\";\r\nimport { XhrHttpClient } from \"./XhrHttpClient\";\r\n\r\n/** Default implementation of {@link @microsoft/signalr.HttpClient}. */\r\nexport class DefaultHttpClient extends HttpClient {\r\n private readonly _httpClient: HttpClient;\r\n\r\n /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */\r\n public constructor(logger: ILogger) {\r\n super();\r\n\r\n if (typeof fetch !== \"undefined\" || Platform.isNode) {\r\n this._httpClient = new FetchHttpClient(logger);\r\n } else if (typeof XMLHttpRequest !== \"undefined\") {\r\n this._httpClient = new XhrHttpClient(logger);\r\n } else {\r\n throw new Error(\"No usable HttpClient found.\");\r\n }\r\n }\r\n\r\n /** @inheritDoc */\r\n public send(request: HttpRequest): Promise<HttpResponse> {\r\n // Check that abort was not signaled before calling send\r\n if (request.abortSignal && request.abortSignal.aborted) {\r\n return Promise.reject(new AbortError());\r\n }\r\n\r\n if (!request.method) {\r\n return Promise.reject(new Error(\"No method defined.\"));\r\n }\r\n if (!request.url) {\r\n return Promise.reject(new Error(\"No url defined.\"));\r\n }\r\n\r\n return this._httpClient.send(request);\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n return this._httpClient.getCookieString(url);\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Not exported from index\r\n/** @private */\r\nexport class TextMessageFormat {\r\n public static RecordSeparatorCode = 0x1e;\r\n public static RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);\r\n\r\n public static write(output: string): string {\r\n return `${output}${TextMessageFormat.RecordSeparator}`;\r\n }\r\n\r\n public static parse(input: string): string[] {\r\n if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n const messages = input.split(TextMessageFormat.RecordSeparator);\r\n messages.pop();\r\n return messages;\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\n/** @private */\r\nexport interface HandshakeRequestMessage {\r\n readonly protocol: string;\r\n readonly version: number;\r\n}\r\n\r\n/** @private */\r\nexport interface HandshakeResponseMessage {\r\n readonly error: string;\r\n readonly minorVersion: number;\r\n}\r\n\r\n/** @private */\r\nexport class HandshakeProtocol {\r\n // Handshake request is always JSON\r\n public writeHandshakeRequest(handshakeRequest: HandshakeRequestMessage): string {\r\n return TextMessageFormat.write(JSON.stringify(handshakeRequest));\r\n }\r\n\r\n public parseHandshakeResponse(data: any): [any, HandshakeResponseMessage] {\r\n let messageData: string;\r\n let remainingData: any;\r\n\r\n if (isArrayBuffer(data)) {\r\n // Format is binary but still need to read JSON text from handshake response\r\n const binaryData = new Uint8Array(data);\r\n const separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));\r\n remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;\r\n } else {\r\n const textData: string = data;\r\n const separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);\r\n if (separatorIndex === -1) {\r\n throw new Error(\"Message is incomplete.\");\r\n }\r\n\r\n // content before separator is handshake response\r\n // optional content after is additional messages\r\n const responseLength = separatorIndex + 1;\r\n messageData = textData.substring(0, responseLength);\r\n remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;\r\n }\r\n\r\n // At this point we should have just the single handshake message\r\n const messages = TextMessageFormat.parse(messageData);\r\n const response = JSON.parse(messages[0]);\r\n if (response.type) {\r\n throw new Error(\"Expected a handshake response from the server.\");\r\n }\r\n const responseMessage: HandshakeResponseMessage = response;\r\n\r\n // multiple messages could have arrived with handshake\r\n // return additional data to be parsed as usual, or null if all parsed\r\n return [remainingData, responseMessage];\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { ILogger } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\n\r\n/** Defines the type of a Hub Message. */\r\nexport enum MessageType {\r\n /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */\r\n Invocation = 1,\r\n /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */\r\n StreamItem = 2,\r\n /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */\r\n Completion = 3,\r\n /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */\r\n StreamInvocation = 4,\r\n /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */\r\n CancelInvocation = 5,\r\n /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */\r\n Ping = 6,\r\n /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */\r\n Close = 7,\r\n Ack = 8,\r\n Sequence = 9\r\n}\r\n\r\n/** Defines a dictionary of string keys and string values representing headers attached to a Hub message. */\r\nexport interface MessageHeaders {\r\n /** Gets or sets the header with the specified key. */\r\n [key: string]: string;\r\n}\r\n\r\n/** Union type of all known Hub messages. */\r\nexport type HubMessage =\r\n InvocationMessage |\r\n StreamInvocationMessage |\r\n StreamItemMessage |\r\n CompletionMessage |\r\n CancelInvocationMessage |\r\n PingMessage |\r\n CloseMessage |\r\n AckMessage |\r\n SequenceMessage;\r\n\r\n/** Defines properties common to all Hub messages. */\r\nexport interface HubMessageBase {\r\n /** A {@link @microsoft/signalr.MessageType} value indicating the type of this message. */\r\n readonly type: MessageType;\r\n}\r\n\r\n/** Defines properties common to all Hub messages relating to a specific invocation. */\r\nexport interface HubInvocationMessage extends HubMessageBase {\r\n /** A {@link @microsoft/signalr.MessageHeaders} dictionary containing headers attached to the message. */\r\n readonly headers?: MessageHeaders;\r\n /** The ID of the invocation relating to this message.\r\n *\r\n * This is expected to be present for {@link @microsoft/signalr.StreamInvocationMessage} and {@link @microsoft/signalr.CompletionMessage}. It may\r\n * be 'undefined' for an {@link @microsoft/signalr.InvocationMessage} if the sender does not expect a response.\r\n */\r\n readonly invocationId?: string;\r\n}\r\n\r\n/** A hub message representing a non-streaming invocation. */\r\nexport interface InvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Invocation;\r\n /** The target method name. */\r\n readonly target: string;\r\n /** The target method arguments. */\r\n readonly arguments: any[];\r\n /** The target methods stream IDs. */\r\n readonly streamIds?: string[];\r\n}\r\n\r\n/** A hub message representing a streaming invocation. */\r\nexport interface StreamInvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.StreamInvocation;\r\n\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n /** The target method name. */\r\n readonly target: string;\r\n /** The target method arguments. */\r\n readonly arguments: any[];\r\n /** The target methods stream IDs. */\r\n readonly streamIds?: string[];\r\n}\r\n\r\n/** A hub message representing a single item produced as part of a result stream. */\r\nexport interface StreamItemMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.StreamItem;\r\n\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n\r\n /** The item produced by the server. */\r\n readonly item?: any;\r\n}\r\n\r\n/** A hub message representing the result of an invocation. */\r\nexport interface CompletionMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Completion;\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n /** The error produced by the invocation, if any.\r\n *\r\n * Either {@link @microsoft/signalr.CompletionMessage.error} or {@link @microsoft/signalr.CompletionMessage.result} must be defined, but not both.\r\n */\r\n readonly error?: string;\r\n /** The result produced by the invocation, if any.\r\n *\r\n * Either {@link @microsoft/signalr.CompletionMessage.error} or {@link @microsoft/signalr.CompletionMessage.result} must be defined, but not both.\r\n */\r\n readonly result?: any;\r\n}\r\n\r\n/** A hub message indicating that the sender is still active. */\r\nexport interface PingMessage extends HubMessageBase {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Ping;\r\n}\r\n\r\n/** A hub message indicating that the sender is closing the connection.\r\n *\r\n * If {@link @microsoft/signalr.CloseMessage.error} is defined, the sender is closing the connection due to an error.\r\n */\r\nexport interface CloseMessage extends HubMessageBase {\r\n /** @inheritDoc */\r\n readonly type: MessageType.Close;\r\n /** The error that triggered the close, if any.\r\n *\r\n * If this property is undefined, the connection was closed normally and without error.\r\n */\r\n readonly error?: string;\r\n\r\n /** If true, clients with automatic reconnects enabled should attempt to reconnect after receiving the CloseMessage. Otherwise, they should not. */\r\n readonly allowReconnect?: boolean;\r\n}\r\n\r\n/** A hub message sent to request that a streaming invocation be canceled. */\r\nexport interface CancelInvocationMessage extends HubInvocationMessage {\r\n /** @inheritDoc */\r\n readonly type: MessageType.CancelInvocation;\r\n /** The invocation ID. */\r\n readonly invocationId: string;\r\n}\r\n\r\nexport interface AckMessage extends HubMessageBase\r\n{\r\n readonly type: MessageType.Ack;\r\n\r\n readonly sequenceId: number;\r\n}\r\n\r\nexport interface SequenceMessage extends HubMessageBase\r\n{\r\n readonly type: MessageType.Sequence;\r\n\r\n readonly sequenceId: number;\r\n}\r\n\r\n/** A protocol abstraction for communicating with SignalR Hubs. */\r\nexport interface IHubProtocol {\r\n /** The name of the protocol. This is used by SignalR to resolve the protocol between the client and server. */\r\n readonly name: string;\r\n /** The version of the protocol. */\r\n readonly version: number;\r\n /** The {@link @microsoft/signalr.TransferFormat} of the protocol. */\r\n readonly transferFormat: TransferFormat;\r\n\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * If {@link @microsoft/signalr.IHubProtocol.transferFormat} is 'Text', the `input` parameter must be a string, otherwise it must be an ArrayBuffer.\r\n *\r\n * @param {string | ArrayBuffer} input A string or ArrayBuffer containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n parseMessages(input: string | ArrayBuffer, logger: ILogger): HubMessage[];\r\n\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string or ArrayBuffer and returns it.\r\n *\r\n * If {@link @microsoft/signalr.IHubProtocol.transferFormat} is 'Text', the result of this method will be a string, otherwise it will be an ArrayBuffer.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string | ArrayBuffer} A string or ArrayBuffer containing the serialized representation of the message.\r\n */\r\n writeMessage(message: HubMessage): string | ArrayBuffer;\r\n}", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IStreamResult, IStreamSubscriber, ISubscription } from \"./Stream\";\r\nimport { SubjectSubscription } from \"./Utils\";\r\n\r\n/** Stream implementation to stream items to the server. */\r\nexport class Subject<T> implements IStreamResult<T> {\r\n /** @internal */\r\n public observers: IStreamSubscriber<T>[];\r\n\r\n /** @internal */\r\n public cancelCallback?: () => Promise<void>;\r\n\r\n constructor() {\r\n this.observers = [];\r\n }\r\n\r\n public next(item: T): void {\r\n for (const observer of this.observers) {\r\n observer.next(item);\r\n }\r\n }\r\n\r\n public error(err: any): void {\r\n for (const observer of this.observers) {\r\n if (observer.error) {\r\n observer.error(err);\r\n }\r\n }\r\n }\r\n\r\n public complete(): void {\r\n for (const observer of this.observers) {\r\n if (observer.complete) {\r\n observer.complete();\r\n }\r\n }\r\n }\r\n\r\n public subscribe(observer: IStreamSubscriber<T>): ISubscription<T> {\r\n this.observers.push(observer);\r\n return new SubjectSubscription(this, observer);\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IConnection } from \"./IConnection\";\r\nimport { AckMessage, HubMessage, IHubProtocol, MessageType, SequenceMessage } from \"./IHubProtocol\";\r\nimport { isArrayBuffer } from \"./Utils\";\r\n\r\n/** @private */\r\nexport class MessageBuffer {\r\n private readonly _protocol: IHubProtocol;\r\n private readonly _connection: IConnection;\r\n\r\n private readonly _bufferSize: number = 100_000;\r\n\r\n private _messages: BufferedItem[] = [];\r\n private _totalMessageCount: number = 0;\r\n private _waitForSequenceMessage: boolean = false;\r\n\r\n // Message IDs start at 1 and always increment by 1\r\n private _nextReceivingSequenceId = 1;\r\n private _latestReceivedSequenceId = 0;\r\n private _bufferedByteCount: number = 0;\r\n private _reconnectInProgress: boolean = false;\r\n\r\n private _ackTimerHandle?: any;\r\n\r\n constructor(protocol: IHubProtocol, connection: IConnection, bufferSize: number) {\r\n this._protocol = protocol;\r\n this._connection = connection;\r\n this._bufferSize = bufferSize;\r\n }\r\n\r\n public async _send(message: HubMessage): Promise<void> {\r\n const serializedMessage = this._protocol.writeMessage(message);\r\n\r\n let backpressurePromise: Promise<void> = Promise.resolve();\r\n\r\n // Only count invocation messages. Acks, pings, etc. don't need to be resent on reconnect\r\n if (this._isInvocationMessage(message)) {\r\n this._totalMessageCount++;\r\n let backpressurePromiseResolver: (value: void) => void = () => {};\r\n let backpressurePromiseRejector: (value?: void) => void = () => {};\r\n\r\n if (isArrayBuffer(serializedMessage)) {\r\n this._bufferedByteCount += serializedMessage.byteLength;\r\n } else {\r\n this._bufferedByteCount += serializedMessage.length;\r\n }\r\n\r\n if (this._bufferedByteCount >= this._bufferSize) {\r\n backpressurePromise = new Promise((resolve, reject) => {\r\n backpressurePromiseResolver = resolve;\r\n backpressurePromiseRejector = reject;\r\n });\r\n }\r\n\r\n this._messages.push(new BufferedItem(serializedMessage, this._totalMessageCount,\r\n backpressurePromiseResolver, backpressurePromiseRejector));\r\n }\r\n\r\n try {\r\n // If this is set it means we are reconnecting or resending\r\n // We don't want to send on a disconnected connection\r\n // And we don't want to send if resend is running since that would mean sending\r\n // this message twice\r\n if (!this._reconnectInProgress) {\r\n await this._connection.send(serializedMessage);\r\n }\r\n } catch {\r\n this._disconnected();\r\n }\r\n await backpressurePromise;\r\n }\r\n\r\n public _ack(ackMessage: AckMessage): void {\r\n let newestAckedMessage = -1;\r\n\r\n // Find index of newest message being acked\r\n for (let index = 0; index < this._messages.length; index++) {\r\n const element = this._messages[index];\r\n if (element._id <= ackMessage.sequenceId) {\r\n newestAckedMessage = index;\r\n if (isArrayBuffer(element._message)) {\r\n this._bufferedByteCount -= element._message.byteLength;\r\n } else {\r\n this._bufferedByteCount -= element._message.length;\r\n }\r\n // resolve items that have already been sent and acked\r\n element._resolver();\r\n } else if (this._bufferedByteCount < this._bufferSize) {\r\n // resolve items that now fall under the buffer limit but haven't been acked\r\n element._resolver();\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n if (newestAckedMessage !== -1) {\r\n // We're removing everything including the message pointed to, so add 1\r\n this._messages = this._messages.slice(newestAckedMessage + 1);\r\n }\r\n }\r\n\r\n public _shouldProcessMessage(message: HubMessage): boolean {\r\n if (this._waitForSequenceMessage) {\r\n if (message.type !== MessageType.Sequence) {\r\n return false;\r\n } else {\r\n this._waitForSequenceMessage = false;\r\n return true;\r\n }\r\n }\r\n\r\n // No special processing for acks, pings, etc.\r\n if (!this._isInvocationMessage(message)) {\r\n return true;\r\n }\r\n\r\n const currentId = this._nextReceivingSequenceId;\r\n this._nextReceivingSequenceId++;\r\n if (currentId <= this._latestReceivedSequenceId) {\r\n if (currentId === this._latestReceivedSequenceId) {\r\n // Should only hit this if we just reconnected and the server is sending\r\n // Messages it has buffered, which would mean it hasn't seen an Ack for these messages\r\n this._ackTimer();\r\n }\r\n // Ignore, this is a duplicate message\r\n return false;\r\n }\r\n\r\n this._latestReceivedSequenceId = currentId;\r\n\r\n // Only start the timer for sending an Ack message when we have a message to ack. This also conveniently solves\r\n // timer throttling by not having a recursive timer, and by starting the timer via a network call (recv)\r\n this._ackTimer();\r\n return true;\r\n }\r\n\r\n public _resetSequence(message: SequenceMessage): void {\r\n if (message.sequenceId > this._nextReceivingSequenceId) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._connection.stop(new Error(\"Sequence ID greater than amount of messages we've received.\"));\r\n return;\r\n }\r\n\r\n this._nextReceivingSequenceId = message.sequenceId;\r\n }\r\n\r\n public _disconnected(): void {\r\n this._reconnectInProgress = true;\r\n this._waitForSequenceMessage = true;\r\n }\r\n\r\n public async _resend(): Promise<void> {\r\n const sequenceId = this._messages.length !== 0\r\n ? this._messages[0]._id\r\n : this._totalMessageCount + 1;\r\n await this._connection.send(this._protocol.writeMessage({ type: MessageType.Sequence, sequenceId }));\r\n\r\n // Get a local variable to the _messages, just in case messages are acked while resending\r\n // Which would slice the _messages array (which creates a new copy)\r\n const messages = this._messages;\r\n for (const element of messages) {\r\n await this._connection.send(element._message);\r\n }\r\n\r\n this._reconnectInProgress = false;\r\n }\r\n\r\n public _dispose(error?: Error): void {\r\n error ??= new Error(\"Unable to reconnect to server.\")\r\n\r\n // Unblock backpressure if any\r\n for (const element of this._messages) {\r\n element._rejector(error);\r\n }\r\n }\r\n\r\n private _isInvocationMessage(message: HubMessage): boolean {\r\n // There is no way to check if something implements an interface.\r\n // So we individually check the messages in a switch statement.\r\n // To make sure we don't miss any message types we rely on the compiler\r\n // seeing the function returns a value and it will do the\r\n // exhaustive check for us on the switch statement, since we don't use 'case default'\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n case MessageType.StreamItem:\r\n case MessageType.Completion:\r\n case MessageType.StreamInvocation:\r\n case MessageType.CancelInvocation:\r\n return true;\r\n case MessageType.Close:\r\n case MessageType.Sequence:\r\n case MessageType.Ping:\r\n case MessageType.Ack:\r\n return false;\r\n }\r\n }\r\n\r\n private _ackTimer(): void {\r\n if (this._ackTimerHandle === undefined) {\r\n this._ackTimerHandle = setTimeout(async () => {\r\n try {\r\n if (!this._reconnectInProgress) {\r\n await this._connection.send(this._protocol.writeMessage({ type: MessageType.Ack, sequenceId: this._latestReceivedSequenceId }))\r\n }\r\n // Ignore errors, that means the connection is closed and we don't care about the Ack message anymore.\r\n } catch { }\r\n\r\n clearTimeout(this._ackTimerHandle);\r\n this._ackTimerHandle = undefined;\r\n // 1 second delay so we don't spam Ack messages if there are many messages being received at once.\r\n }, 1000);\r\n }\r\n }\r\n}\r\n\r\nclass BufferedItem {\r\n constructor(message: string | ArrayBuffer, id: number, resolver: (value: void) => void, rejector: (value?: any) => void) {\r\n this._message = message;\r\n this._id = id;\r\n this._resolver = resolver;\r\n this._rejector = rejector;\r\n }\r\n\r\n _message: string | ArrayBuffer;\r\n _id: number;\r\n _resolver: (value: void) => void;\r\n _rejector: (value?: any) => void;\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HandshakeProtocol, HandshakeRequestMessage, HandshakeResponseMessage } from \"./HandshakeProtocol\";\r\nimport { IConnection } from \"./IConnection\";\r\nimport { AbortError } from \"./Errors\";\r\nimport { CancelInvocationMessage, CloseMessage, CompletionMessage, IHubProtocol, InvocationMessage, MessageType, StreamInvocationMessage, StreamItemMessage } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { IRetryPolicy } from \"./IRetryPolicy\";\r\nimport { IStreamResult } from \"./Stream\";\r\nimport { Subject } from \"./Subject\";\r\nimport { Arg, getErrorString, Platform } from \"./Utils\";\r\nimport { MessageBuffer } from \"./MessageBuffer\";\r\n\r\nconst DEFAULT_TIMEOUT_IN_MS: number = 30 * 1000;\r\nconst DEFAULT_PING_INTERVAL_IN_MS: number = 15 * 1000;\r\nconst DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE = 100_000;\r\n\r\n/** Describes the current state of the {@link HubConnection} to the server. */\r\nexport enum HubConnectionState {\r\n /** The hub connection is disconnected. */\r\n Disconnected = \"Disconnected\",\r\n /** The hub connection is connecting. */\r\n Connecting = \"Connecting\",\r\n /** The hub connection is connected. */\r\n Connected = \"Connected\",\r\n /** The hub connection is disconnecting. */\r\n Disconnecting = \"Disconnecting\",\r\n /** The hub connection is reconnecting. */\r\n Reconnecting = \"Reconnecting\",\r\n}\r\n\r\n/** Represents a connection to a SignalR Hub. */\r\nexport class HubConnection {\r\n private readonly _cachedPingMessage: string | ArrayBuffer;\r\n // Needs to not start with _ for tests\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private readonly connection: IConnection;\r\n private readonly _logger: ILogger;\r\n private readonly _reconnectPolicy?: IRetryPolicy;\r\n private readonly _statefulReconnectBufferSize: number;\r\n private _protocol: IHubProtocol;\r\n private _handshakeProtocol: HandshakeProtocol;\r\n private _callbacks: { [invocationId: string]: (invocationEvent: StreamItemMessage | CompletionMessage | null, error?: Error) => void };\r\n private _methods: { [name: string]: (((...args: any[]) => void) | ((...args: any[]) => any))[] };\r\n private _invocationId: number;\r\n private _messageBuffer?: MessageBuffer;\r\n\r\n private _closedCallbacks: ((error?: Error) => void)[];\r\n private _reconnectingCallbacks: ((error?: Error) => void)[];\r\n private _reconnectedCallbacks: ((connectionId?: string) => void)[];\r\n\r\n private _receivedHandshakeResponse: boolean;\r\n private _handshakeResolver!: (value?: PromiseLike<{}>) => void;\r\n private _handshakeRejecter!: (reason?: any) => void;\r\n private _stopDuringStartError?: Error;\r\n\r\n private _connectionState: HubConnectionState;\r\n // connectionStarted is tracked independently from connectionState, so we can check if the\r\n // connection ever did successfully transition from connecting to connected before disconnecting.\r\n private _connectionStarted: boolean;\r\n private _startPromise?: Promise<void>;\r\n private _stopPromise?: Promise<void>;\r\n private _nextKeepAlive: number = 0;\r\n\r\n // The type of these a) doesn't matter and b) varies when building in browser and node contexts\r\n // Since we're building the WebPack bundle directly from the TypeScript, this matters (previously\r\n // we built the bundle from the compiled JavaScript).\r\n private _reconnectDelayHandle?: any;\r\n private _timeoutHandle?: any;\r\n private _pingServerHandle?: any;\r\n\r\n private _freezeEventListener = () =>\r\n {\r\n this._logger.log(LogLevel.Warning, \"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep\");\r\n };\r\n\r\n /** The server timeout in milliseconds.\r\n *\r\n * If this timeout elapses without receiving any messages from the server, the connection will be terminated with an error.\r\n * The default timeout value is 30,000 milliseconds (30 seconds).\r\n */\r\n public serverTimeoutInMilliseconds: number;\r\n\r\n /** Default interval at which to ping the server.\r\n *\r\n * The default value is 15,000 milliseconds (15 seconds).\r\n * Allows the server to detect hard disconnects (like when a client unplugs their computer).\r\n * The ping will happen at most as often as the server pings.\r\n * If the server pings every 5 seconds, a value lower than 5 will ping every 5 seconds.\r\n */\r\n public keepAliveIntervalInMilliseconds: number;\r\n\r\n /** @internal */\r\n // Using a public static factory method means we can have a private constructor and an _internal_\r\n // create method that can be used by HubConnectionBuilder. An \"internal\" constructor would just\r\n // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a\r\n // public parameter-less constructor.\r\n public static create(\r\n connection: IConnection,\r\n logger: ILogger,\r\n protocol: IHubProtocol,\r\n reconnectPolicy?: IRetryPolicy,\r\n serverTimeoutInMilliseconds?: number,\r\n keepAliveIntervalInMilliseconds?: number,\r\n statefulReconnectBufferSize?: number): HubConnection {\r\n return new HubConnection(connection, logger, protocol, reconnectPolicy,\r\n serverTimeoutInMilliseconds, keepAliveIntervalInMilliseconds, statefulReconnectBufferSize);\r\n }\r\n\r\n private constructor(\r\n connection: IConnection,\r\n logger: ILogger,\r\n protocol: IHubProtocol,\r\n reconnectPolicy?: IRetryPolicy,\r\n serverTimeoutInMilliseconds?: number,\r\n keepAliveIntervalInMilliseconds?: number,\r\n statefulReconnectBufferSize?: number) {\r\n Arg.isRequired(connection, \"connection\");\r\n Arg.isRequired(logger, \"logger\");\r\n Arg.isRequired(protocol, \"protocol\");\r\n\r\n this.serverTimeoutInMilliseconds = serverTimeoutInMilliseconds ?? DEFAULT_TIMEOUT_IN_MS;\r\n this.keepAliveIntervalInMilliseconds = keepAliveIntervalInMilliseconds ?? DEFAULT_PING_INTERVAL_IN_MS;\r\n\r\n this._statefulReconnectBufferSize = statefulReconnectBufferSize ?? DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE;\r\n\r\n this._logger = logger;\r\n this._protocol = protocol;\r\n this.connection = connection;\r\n this._reconnectPolicy = reconnectPolicy;\r\n this._handshakeProtocol = new HandshakeProtocol();\r\n\r\n this.connection.onreceive = (data: any) => this._processIncomingData(data);\r\n this.connection.onclose = (error?: Error) => this._connectionClosed(error);\r\n\r\n this._callbacks = {};\r\n this._methods = {};\r\n this._closedCallbacks = [];\r\n this._reconnectingCallbacks = [];\r\n this._reconnectedCallbacks = [];\r\n this._invocationId = 0;\r\n this._receivedHandshakeResponse = false;\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n\r\n this._cachedPingMessage = this._protocol.writeMessage({ type: MessageType.Ping });\r\n }\r\n\r\n /** Indicates the state of the {@link HubConnection} to the server. */\r\n get state(): HubConnectionState {\r\n return this._connectionState;\r\n }\r\n\r\n /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either\r\n * in the disconnected state or if the negotiation step was skipped.\r\n */\r\n get connectionId(): string | null {\r\n return this.connection ? (this.connection.connectionId || null) : null;\r\n }\r\n\r\n /** Indicates the url of the {@link HubConnection} to the server. */\r\n get baseUrl(): string {\r\n return this.connection.baseUrl || \"\";\r\n }\r\n\r\n /**\r\n * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or\r\n * Reconnecting states.\r\n * @param {string} url The url to connect to.\r\n */\r\n set baseUrl(url: string) {\r\n if (this._connectionState !== HubConnectionState.Disconnected && this._connectionState !== HubConnectionState.Reconnecting) {\r\n throw new Error(\"The HubConnection must be in the Disconnected or Reconnecting state to change the url.\");\r\n }\r\n\r\n if (!url) {\r\n throw new Error(\"The HubConnection url must be a valid url.\");\r\n }\r\n\r\n this.connection.baseUrl = url;\r\n }\r\n\r\n /** Starts the connection.\r\n *\r\n * @returns {Promise<void>} A Promise that resolves when the connection has been successfully established, or rejects with an error.\r\n */\r\n public start(): Promise<void> {\r\n this._startPromise = this._startWithStateTransitions();\r\n return this._startPromise;\r\n }\r\n\r\n private async _startWithStateTransitions(): Promise<void> {\r\n if (this._connectionState !== HubConnectionState.Disconnected) {\r\n return Promise.reject(new Error(\"Cannot start a HubConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n\r\n this._connectionState = HubConnectionState.Connecting;\r\n this._logger.log(LogLevel.Debug, \"Starting HubConnection.\");\r\n\r\n try {\r\n await this._startInternal();\r\n\r\n if (Platform.isBrowser) {\r\n // Log when the browser freezes the tab so users know why their connection unexpectedly stopped working\r\n window.document.addEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n\r\n this._connectionState = HubConnectionState.Connected;\r\n this._connectionStarted = true;\r\n this._logger.log(LogLevel.Debug, \"HubConnection connected successfully.\");\r\n } catch (e) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._logger.log(LogLevel.Debug, `HubConnection failed to start successfully because of error '${e}'.`);\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n private async _startInternal() {\r\n this._stopDuringStartError = undefined;\r\n this._receivedHandshakeResponse = false;\r\n // Set up the promise before any connection is (re)started otherwise it could race with received messages\r\n const handshakePromise = new Promise((resolve, reject) => {\r\n this._handshakeResolver = resolve;\r\n this._handshakeRejecter = reject;\r\n });\r\n\r\n await this.connection.start(this._protocol.transferFormat);\r\n\r\n try {\r\n let version = this._protocol.version;\r\n if (!this.connection.features.reconnect) {\r\n // Stateful Reconnect starts with HubProtocol version 2, newer clients connecting to older servers will fail to connect due to\r\n // the handshake only supporting version 1, so we will try to send version 1 during the handshake to keep old servers working.\r\n version = 1;\r\n }\r\n\r\n const handshakeRequest: HandshakeRequestMessage = {\r\n protocol: this._protocol.name,\r\n version,\r\n };\r\n\r\n this._logger.log(LogLevel.Debug, \"Sending handshake request.\");\r\n\r\n await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(handshakeRequest));\r\n\r\n this._logger.log(LogLevel.Information, `Using HubProtocol '${this._protocol.name}'.`);\r\n\r\n // defensively cleanup timeout in case we receive a message from the server before we finish start\r\n this._cleanupTimeout();\r\n this._resetTimeoutPeriod();\r\n this._resetKeepAliveInterval();\r\n\r\n await handshakePromise;\r\n\r\n // It's important to check the stopDuringStartError instead of just relying on the handshakePromise\r\n // being rejected on close, because this continuation can run after both the handshake completed successfully\r\n // and the connection was closed.\r\n if (this._stopDuringStartError) {\r\n // It's important to throw instead of returning a rejected promise, because we don't want to allow any state\r\n // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise\r\n // will cause the calling continuation to get scheduled to run later.\r\n // eslint-disable-next-line @typescript-eslint/no-throw-literal\r\n throw this._stopDuringStartError;\r\n }\r\n\r\n const useStatefulReconnect = this.connection.features.reconnect || false;\r\n if (useStatefulReconnect) {\r\n this._messageBuffer = new MessageBuffer(this._protocol, this.connection, this._statefulReconnectBufferSize);\r\n this.connection.features.disconnected = this._messageBuffer._disconnected.bind(this._messageBuffer);\r\n this.connection.features.resend = () => {\r\n if (this._messageBuffer) {\r\n return this._messageBuffer._resend();\r\n }\r\n }\r\n }\r\n\r\n if (!this.connection.features.inherentKeepAlive) {\r\n await this._sendMessage(this._cachedPingMessage);\r\n }\r\n } catch (e) {\r\n this._logger.log(LogLevel.Debug, `Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`);\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n\r\n // HttpConnection.stop() should not complete until after the onclose callback is invoked.\r\n // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.\r\n await this.connection.stop(e);\r\n throw e;\r\n }\r\n }\r\n\r\n /** Stops the connection.\r\n *\r\n * @returns {Promise<void>} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.\r\n */\r\n public async stop(): Promise<void> {\r\n // Capture the start promise before the connection might be restarted in an onclose callback.\r\n const startPromise = this._startPromise;\r\n this.connection.features.reconnect = false;\r\n\r\n this._stopPromise = this._stopInternal();\r\n await this._stopPromise;\r\n\r\n try {\r\n // Awaiting undefined continues immediately\r\n await startPromise;\r\n } catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n }\r\n\r\n private _stopInternal(error?: Error): Promise<void> {\r\n if (this._connectionState === HubConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HubConnection.stop(${error}) ignored because it is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise!;\r\n }\r\n\r\n const state = this._connectionState;\r\n this._connectionState = HubConnectionState.Disconnecting;\r\n\r\n this._logger.log(LogLevel.Debug, \"Stopping HubConnection.\");\r\n\r\n if (this._reconnectDelayHandle) {\r\n // We're in a reconnect delay which means the underlying connection is currently already stopped.\r\n // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and\r\n // fire the onclose callbacks.\r\n this._logger.log(LogLevel.Debug, \"Connection stopped during reconnect delay. Done reconnecting.\");\r\n\r\n clearTimeout(this._reconnectDelayHandle);\r\n this._reconnectDelayHandle = undefined;\r\n\r\n this._completeClose();\r\n return Promise.resolve();\r\n }\r\n\r\n if (state === HubConnectionState.Connected) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._sendCloseMessage();\r\n }\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n this._stopDuringStartError = error || new AbortError(\"The connection was stopped before the hub handshake could complete.\");\r\n\r\n // HttpConnection.stop() should not complete until after either HttpConnection.start() fails\r\n // or the onclose callback is invoked. The onclose callback will transition the HubConnection\r\n // to the disconnected state if need be before HttpConnection.stop() completes.\r\n return this.connection.stop(error);\r\n }\r\n\r\n private async _sendCloseMessage() {\r\n try {\r\n await this._sendWithProtocol(this._createCloseMessage());\r\n } catch {\r\n // Ignore, this is a best effort attempt to let the server know the client closed gracefully.\r\n }\r\n }\r\n\r\n /** Invokes a streaming hub method on the server using the specified name and arguments.\r\n *\r\n * @typeparam T The type of the items returned by the server.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {IStreamResult<T>} An object that yields results from the server as they are received.\r\n */\r\n public stream<T = any>(methodName: string, ...args: any[]): IStreamResult<T> {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);\r\n\r\n // eslint-disable-next-line prefer-const\r\n let promiseQueue: Promise<void>;\r\n\r\n const subject = new Subject<T>();\r\n subject.cancelCallback = () => {\r\n const cancelInvocation: CancelInvocationMessage = this._createCancelInvocation(invocationDescriptor.invocationId);\r\n\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n\r\n return promiseQueue.then(() => {\r\n return this._sendWithProtocol(cancelInvocation);\r\n });\r\n };\r\n\r\n this._callbacks[invocationDescriptor.invocationId] = (invocationEvent: CompletionMessage | StreamItemMessage | null, error?: Error) => {\r\n if (error) {\r\n subject.error(error);\r\n return;\r\n } else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n subject.error(new Error(invocationEvent.error));\r\n } else {\r\n subject.complete();\r\n }\r\n } else {\r\n subject.next((invocationEvent.item) as T);\r\n }\r\n }\r\n };\r\n\r\n promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n subject.error(e);\r\n delete this._callbacks[invocationDescriptor.invocationId];\r\n });\r\n\r\n this._launchStreams(streams, promiseQueue);\r\n\r\n return subject;\r\n }\r\n\r\n private _sendMessage(message: any) {\r\n this._resetKeepAliveInterval();\r\n return this.connection.send(message);\r\n }\r\n\r\n /**\r\n * Sends a js object to the server.\r\n * @param message The js object to serialize and send.\r\n */\r\n private _sendWithProtocol(message: any) {\r\n if (this._messageBuffer) {\r\n return this._messageBuffer._send(message);\r\n } else {\r\n return this._sendMessage(this._protocol.writeMessage(message));\r\n }\r\n }\r\n\r\n /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.\r\n *\r\n * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still\r\n * be processing the invocation.\r\n *\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise<void>} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.\r\n */\r\n public send(methodName: string, ...args: any[]): Promise<void> {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const sendPromise = this._sendWithProtocol(this._createInvocation(methodName, args, true, streamIds));\r\n\r\n this._launchStreams(streams, sendPromise);\r\n\r\n return sendPromise;\r\n }\r\n\r\n /** Invokes a hub method on the server using the specified name and arguments.\r\n *\r\n * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise\r\n * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of\r\n * resolving the Promise.\r\n *\r\n * @typeparam T The expected return type.\r\n * @param {string} methodName The name of the server method to invoke.\r\n * @param {any[]} args The arguments used to invoke the server method.\r\n * @returns {Promise<T>} A Promise that resolves with the result of the server method (if any), or rejects with an error.\r\n */\r\n public invoke<T = any>(methodName: string, ...args: any[]): Promise<T> {\r\n const [streams, streamIds] = this._replaceStreamingParams(args);\r\n const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);\r\n\r\n const p = new Promise<any>((resolve, reject) => {\r\n // invocationId will always have a value for a non-blocking invocation\r\n this._callbacks[invocationDescriptor.invocationId!] = (invocationEvent: StreamItemMessage | CompletionMessage | null, error?: Error) => {\r\n if (error) {\r\n reject(error);\r\n return;\r\n } else if (invocationEvent) {\r\n // invocationEvent will not be null when an error is not passed to the callback\r\n if (invocationEvent.type === MessageType.Completion) {\r\n if (invocationEvent.error) {\r\n reject(new Error(invocationEvent.error));\r\n } else {\r\n resolve(invocationEvent.result);\r\n }\r\n } else {\r\n reject(new Error(`Unexpected message type: ${invocationEvent.type}`));\r\n }\r\n }\r\n };\r\n\r\n const promiseQueue = this._sendWithProtocol(invocationDescriptor)\r\n .catch((e) => {\r\n reject(e);\r\n // invocationId will always have a value for a non-blocking invocation\r\n delete this._callbacks[invocationDescriptor.invocationId!];\r\n });\r\n\r\n this._launchStreams(streams, promiseQueue);\r\n });\r\n\r\n return p;\r\n }\r\n\r\n /** Registers a handler that will be invoked when the hub method with the specified method name is invoked.\r\n *\r\n * @param {string} methodName The name of the hub method to define.\r\n * @param {Function} newMethod The handler that will be raised when the hub method is invoked.\r\n */\r\n public on(methodName: string, newMethod: (...args: any[]) => any): void\r\n public on(methodName: string, newMethod: (...args: any[]) => void): void {\r\n if (!methodName || !newMethod) {\r\n return;\r\n }\r\n\r\n methodName = methodName.toLowerCase();\r\n if (!this._methods[methodName]) {\r\n this._methods[methodName] = [];\r\n }\r\n\r\n // Preventing adding the same handler multiple times.\r\n if (this._methods[methodName].indexOf(newMethod) !== -1) {\r\n return;\r\n }\r\n\r\n this._methods[methodName].push(newMethod);\r\n }\r\n\r\n /** Removes all handlers for the specified hub method.\r\n *\r\n * @param {string} methodName The name of the method to remove handlers for.\r\n */\r\n public off(methodName: string): void;\r\n\r\n /** Removes the specified handler for the specified hub method.\r\n *\r\n * You must pass the exact same Function instance as was previously passed to {@link @microsoft/signalr.HubConnection.on}. Passing a different instance (even if the function\r\n * body is the same) will not remove the handler.\r\n *\r\n * @param {string} methodName The name of the method to remove handlers for.\r\n * @param {Function} method The handler to remove. This must be the same Function instance as the one passed to {@link @microsoft/signalr.HubConnection.on}.\r\n */\r\n public off(methodName: string, method: (...args: any[]) => void): void;\r\n public off(methodName: string, method?: (...args: any[]) => void): void {\r\n if (!methodName) {\r\n return;\r\n }\r\n\r\n methodName = methodName.toLowerCase();\r\n const handlers = this._methods[methodName];\r\n if (!handlers) {\r\n return;\r\n }\r\n if (method) {\r\n const removeIdx = handlers.indexOf(method);\r\n if (removeIdx !== -1) {\r\n handlers.splice(removeIdx, 1);\r\n if (handlers.length === 0) {\r\n delete this._methods[methodName];\r\n }\r\n }\r\n } else {\r\n delete this._methods[methodName];\r\n }\r\n\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection is closed.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).\r\n */\r\n public onclose(callback: (error?: Error) => void): void {\r\n if (callback) {\r\n this._closedCallbacks.push(callback);\r\n }\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection starts reconnecting.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).\r\n */\r\n public onreconnecting(callback: (error?: Error) => void): void {\r\n if (callback) {\r\n this._reconnectingCallbacks.push(callback);\r\n }\r\n }\r\n\r\n /** Registers a handler that will be invoked when the connection successfully reconnects.\r\n *\r\n * @param {Function} callback The handler that will be invoked when the connection successfully reconnects.\r\n */\r\n public onreconnected(callback: (connectionId?: string) => void): void {\r\n if (callback) {\r\n this._reconnectedCallbacks.push(callback);\r\n }\r\n }\r\n\r\n private _processIncomingData(data: any) {\r\n this._cleanupTimeout();\r\n\r\n if (!this._receivedHandshakeResponse) {\r\n data = this._processHandshakeResponse(data);\r\n this._receivedHandshakeResponse = true;\r\n }\r\n\r\n // Data may have all been read when processing handshake response\r\n if (data) {\r\n // Parse the messages\r\n const messages = this._protocol.parseMessages(data, this._logger);\r\n\r\n for (const message of messages) {\r\n if (this._messageBuffer && !this._messageBuffer._shouldProcessMessage(message)) {\r\n // Don't process the message, we are either waiting for a SequenceMessage or received a duplicate message\r\n continue;\r\n }\r\n\r\n switch (message.type) {\r\n case MessageType.Invocation:\r\n this._invokeClientMethod(message)\r\n .catch((e) => {\r\n this._logger.log(LogLevel.Error, `Invoke client method threw error: ${getErrorString(e)}`)\r\n });\r\n break;\r\n case MessageType.StreamItem:\r\n case MessageType.Completion: {\r\n const callback = this._callbacks[message.invocationId];\r\n if (callback) {\r\n if (message.type === MessageType.Completion) {\r\n delete this._callbacks[message.invocationId];\r\n }\r\n try {\r\n callback(message);\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream callback threw error: ${getErrorString(e)}`);\r\n }\r\n }\r\n break;\r\n }\r\n case MessageType.Ping:\r\n // Don't care about pings\r\n break;\r\n case MessageType.Close: {\r\n this._logger.log(LogLevel.Information, \"Close message received from server.\");\r\n\r\n const error = message.error ? new Error(\"Server returned an error on close: \" + message.error) : undefined;\r\n\r\n if (message.allowReconnect === true) {\r\n // It feels wrong not to await connection.stop() here, but processIncomingData is called as part of an onreceive callback which is not async,\r\n // this is already the behavior for serverTimeout(), and HttpConnection.Stop() should catch and log all possible exceptions.\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(error);\r\n } else {\r\n // We cannot await stopInternal() here, but subsequent calls to stop() will await this if stopInternal() is still ongoing.\r\n this._stopPromise = this._stopInternal(error);\r\n }\r\n\r\n break;\r\n }\r\n case MessageType.Ack:\r\n if (this._messageBuffer) {\r\n this._messageBuffer._ack(message);\r\n }\r\n break;\r\n case MessageType.Sequence:\r\n if (this._messageBuffer) {\r\n this._messageBuffer._resetSequence(message);\r\n }\r\n break;\r\n default:\r\n this._logger.log(LogLevel.Warning, `Invalid message type: ${message.type}.`);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n this._resetTimeoutPeriod();\r\n }\r\n\r\n private _processHandshakeResponse(data: any): any {\r\n let responseMessage: HandshakeResponseMessage;\r\n let remainingData: any;\r\n\r\n try {\r\n [remainingData, responseMessage] = this._handshakeProtocol.parseHandshakeResponse(data);\r\n } catch (e) {\r\n const message = \"Error parsing handshake response: \" + e;\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n }\r\n if (responseMessage.error) {\r\n const message = \"Server returned handshake error: \" + responseMessage.error;\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n const error = new Error(message);\r\n this._handshakeRejecter(error);\r\n throw error;\r\n } else {\r\n this._logger.log(LogLevel.Debug, \"Server handshake complete.\");\r\n }\r\n\r\n this._handshakeResolver();\r\n return remainingData;\r\n }\r\n\r\n private _resetKeepAliveInterval() {\r\n if (this.connection.features.inherentKeepAlive) {\r\n return;\r\n }\r\n\r\n // Set the time we want the next keep alive to be sent\r\n // Timer will be setup on next message receive\r\n this._nextKeepAlive = new Date().getTime() + this.keepAliveIntervalInMilliseconds;\r\n\r\n this._cleanupPingTimer();\r\n }\r\n\r\n private _resetTimeoutPeriod() {\r\n if (!this.connection.features || !this.connection.features.inherentKeepAlive) {\r\n // Set the timeout timer\r\n this._timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds);\r\n\r\n // Set keepAlive timer if there isn't one\r\n if (this._pingServerHandle === undefined)\r\n {\r\n let nextPing = this._nextKeepAlive - new Date().getTime();\r\n if (nextPing < 0) {\r\n nextPing = 0;\r\n }\r\n\r\n // The timer needs to be set from a networking callback to avoid Chrome timer throttling from causing timers to run once a minute\r\n this._pingServerHandle = setTimeout(async () => {\r\n if (this._connectionState === HubConnectionState.Connected) {\r\n try {\r\n await this._sendMessage(this._cachedPingMessage);\r\n } catch {\r\n // We don't care about the error. It should be seen elsewhere in the client.\r\n // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering\r\n this._cleanupPingTimer();\r\n }\r\n }\r\n }, nextPing);\r\n }\r\n }\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private serverTimeout() {\r\n // The server hasn't talked to us in a while. It doesn't like us anymore ... :(\r\n // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.connection.stop(new Error(\"Server timeout elapsed without receiving a message from the server.\"));\r\n }\r\n\r\n private async _invokeClientMethod(invocationMessage: InvocationMessage) {\r\n const methodName = invocationMessage.target.toLowerCase();\r\n const methods = this._methods[methodName];\r\n if (!methods) {\r\n this._logger.log(LogLevel.Warning, `No client method with the name '${methodName}' found.`);\r\n\r\n // No handlers provided by client but the server is expecting a response still, so we send an error\r\n if (invocationMessage.invocationId) {\r\n this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r\n await this._sendWithProtocol(this._createCompletionMessage(invocationMessage.invocationId, \"Client didn't provide a result.\", null));\r\n }\r\n return;\r\n }\r\n\r\n // Avoid issues with handlers removing themselves thus modifying the list while iterating through it\r\n const methodsCopy = methods.slice();\r\n\r\n // Server expects a response\r\n const expectsResponse = invocationMessage.invocationId ? true : false;\r\n // We preserve the last result or exception but still call all handlers\r\n let res;\r\n let exception;\r\n let completionMessage;\r\n for (const m of methodsCopy) {\r\n try {\r\n const prevRes = res;\r\n res = await m.apply(this, invocationMessage.arguments);\r\n if (expectsResponse && res && prevRes) {\r\n this._logger.log(LogLevel.Error, `Multiple results provided for '${methodName}'. Sending error to server.`);\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, `Client provided multiple results.`, null);\r\n }\r\n // Ignore exception if we got a result after, the exception will be logged\r\n exception = undefined;\r\n } catch (e) {\r\n exception = e;\r\n this._logger.log(LogLevel.Error, `A callback for the method '${methodName}' threw error '${e}'.`);\r\n }\r\n }\r\n if (completionMessage) {\r\n await this._sendWithProtocol(completionMessage);\r\n } else if (expectsResponse) {\r\n // If there is an exception that means either no result was given or a handler after a result threw\r\n if (exception) {\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, `${exception}`, null);\r\n } else if (res !== undefined) {\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, null, res);\r\n } else {\r\n this._logger.log(LogLevel.Warning, `No result given for '${methodName}' method and invocation ID '${invocationMessage.invocationId}'.`);\r\n // Client didn't provide a result or throw from a handler, server expects a response so we send an error\r\n completionMessage = this._createCompletionMessage(invocationMessage.invocationId!, \"Client didn't provide a result.\", null);\r\n }\r\n await this._sendWithProtocol(completionMessage);\r\n } else {\r\n if (res) {\r\n this._logger.log(LogLevel.Error, `Result given for '${methodName}' method but server is not expecting a result.`);\r\n }\r\n }\r\n }\r\n\r\n private _connectionClosed(error?: Error) {\r\n this._logger.log(LogLevel.Debug, `HubConnection.connectionClosed(${error}) called while in state ${this._connectionState}.`);\r\n\r\n // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet.\r\n this._stopDuringStartError = this._stopDuringStartError || error || new AbortError(\"The underlying connection was closed before the hub handshake could complete.\");\r\n\r\n // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it.\r\n // If it has already completed, this should just noop.\r\n if (this._handshakeResolver) {\r\n this._handshakeResolver();\r\n }\r\n\r\n this._cancelCallbacksWithError(error || new Error(\"Invocation canceled due to the underlying connection being closed.\"));\r\n\r\n this._cleanupTimeout();\r\n this._cleanupPingTimer();\r\n\r\n if (this._connectionState === HubConnectionState.Disconnecting) {\r\n this._completeClose(error);\r\n } else if (this._connectionState === HubConnectionState.Connected && this._reconnectPolicy) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this._reconnect(error);\r\n } else if (this._connectionState === HubConnectionState.Connected) {\r\n this._completeClose(error);\r\n }\r\n\r\n // If none of the above if conditions were true were called the HubConnection must be in either:\r\n // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it.\r\n // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt\r\n // and potentially continue the reconnect() loop.\r\n // 3. The Disconnected state in which case we're already done.\r\n }\r\n\r\n private _completeClose(error?: Error) {\r\n if (this._connectionStarted) {\r\n this._connectionState = HubConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n if (this._messageBuffer) {\r\n this._messageBuffer._dispose(error ?? new Error(\"Connection closed.\"));\r\n this._messageBuffer = undefined;\r\n }\r\n\r\n if (Platform.isBrowser) {\r\n window.document.removeEventListener(\"freeze\", this._freezeEventListener);\r\n }\r\n\r\n try {\r\n this._closedCallbacks.forEach((c) => c.apply(this, [error]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onclose callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n\r\n private async _reconnect(error?: Error) {\r\n const reconnectStartTime = Date.now();\r\n let previousReconnectAttempts = 0;\r\n let retryError = error !== undefined ? error : new Error(\"Attempting to reconnect due to a unknown error.\");\r\n\r\n let nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, 0, retryError);\r\n\r\n if (nextRetryDelay === null) {\r\n this._logger.log(LogLevel.Debug, \"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.\");\r\n this._completeClose(error);\r\n return;\r\n }\r\n\r\n this._connectionState = HubConnectionState.Reconnecting;\r\n\r\n if (error) {\r\n this._logger.log(LogLevel.Information, `Connection reconnecting because of error '${error}'.`);\r\n } else {\r\n this._logger.log(LogLevel.Information, \"Connection reconnecting.\");\r\n }\r\n\r\n if (this._reconnectingCallbacks.length !== 0) {\r\n try {\r\n this._reconnectingCallbacks.forEach((c) => c.apply(this, [error]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnecting callback called with error '${error}' threw error '${e}'.`);\r\n }\r\n\r\n // Exit early if an onreconnecting callback called connection.stop().\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.\");\r\n return;\r\n }\r\n }\r\n\r\n while (nextRetryDelay !== null) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt number ${previousReconnectAttempts} will start in ${nextRetryDelay} ms.`);\r\n\r\n await new Promise((resolve) => {\r\n this._reconnectDelayHandle = setTimeout(resolve, nextRetryDelay!);\r\n });\r\n this._reconnectDelayHandle = undefined;\r\n\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, \"Connection left the reconnecting state during reconnect delay. Done reconnecting.\");\r\n return;\r\n }\r\n\r\n try {\r\n await this._startInternal();\r\n\r\n this._connectionState = HubConnectionState.Connected;\r\n this._logger.log(LogLevel.Information, \"HubConnection reconnected successfully.\");\r\n\r\n if (this._reconnectedCallbacks.length !== 0) {\r\n try {\r\n this._reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`);\r\n }\r\n }\r\n\r\n return;\r\n } catch (e) {\r\n this._logger.log(LogLevel.Information, `Reconnect attempt failed because of error '${e}'.`);\r\n\r\n if (this._connectionState !== HubConnectionState.Reconnecting) {\r\n this._logger.log(LogLevel.Debug, `Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`);\r\n // The TypeScript compiler thinks that connectionState must be Connected here. The TypeScript compiler is wrong.\r\n if (this._connectionState as any === HubConnectionState.Disconnecting) {\r\n this._completeClose();\r\n }\r\n return;\r\n }\r\n\r\n retryError = e instanceof Error ? e : new Error((e as any).toString());\r\n nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError);\r\n }\r\n }\r\n\r\n this._logger.log(LogLevel.Information, `Reconnect retries have been exhausted after ${Date.now() - reconnectStartTime} ms and ${previousReconnectAttempts} failed attempts. Connection disconnecting.`);\r\n\r\n this._completeClose();\r\n }\r\n\r\n private _getNextRetryDelay(previousRetryCount: number, elapsedMilliseconds: number, retryReason: Error) {\r\n try {\r\n return this._reconnectPolicy!.nextRetryDelayInMilliseconds({\r\n elapsedMilliseconds,\r\n previousRetryCount,\r\n retryReason,\r\n });\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `IRetryPolicy.nextRetryDelayInMilliseconds(${previousRetryCount}, ${elapsedMilliseconds}) threw error '${e}'.`);\r\n return null;\r\n }\r\n }\r\n\r\n private _cancelCallbacksWithError(error: Error) {\r\n const callbacks = this._callbacks;\r\n this._callbacks = {};\r\n\r\n Object.keys(callbacks)\r\n .forEach((key) => {\r\n const callback = callbacks[key];\r\n try {\r\n callback(null, error);\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `Stream 'error' callback called with '${error}' threw error: ${getErrorString(e)}`);\r\n }\r\n });\r\n }\r\n\r\n private _cleanupPingTimer(): void {\r\n if (this._pingServerHandle) {\r\n clearTimeout(this._pingServerHandle);\r\n this._pingServerHandle = undefined;\r\n }\r\n }\r\n\r\n private _cleanupTimeout(): void {\r\n if (this._timeoutHandle) {\r\n clearTimeout(this._timeoutHandle);\r\n }\r\n }\r\n\r\n private _createInvocation(methodName: string, args: any[], nonblocking: boolean, streamIds: string[]): InvocationMessage {\r\n if (nonblocking) {\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n } else {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.Invocation,\r\n };\r\n }\r\n }\r\n }\r\n\r\n private _launchStreams(streams: IStreamResult<any>[], promiseQueue: Promise<void>): void {\r\n if (streams.length === 0) {\r\n return;\r\n }\r\n\r\n // Synchronize stream data so they arrive in-order on the server\r\n if (!promiseQueue) {\r\n promiseQueue = Promise.resolve();\r\n }\r\n\r\n // We want to iterate over the keys, since the keys are the stream ids\r\n // eslint-disable-next-line guard-for-in\r\n for (const streamId in streams) {\r\n streams[streamId].subscribe({\r\n complete: () => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId)));\r\n },\r\n error: (err) => {\r\n let message: string;\r\n if (err instanceof Error) {\r\n message = err.message;\r\n } else if (err && err.toString) {\r\n message = err.toString();\r\n } else {\r\n message = \"Unknown error\";\r\n }\r\n\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId, message)));\r\n },\r\n next: (item) => {\r\n promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createStreamItemMessage(streamId, item)));\r\n },\r\n });\r\n }\r\n }\r\n\r\n private _replaceStreamingParams(args: any[]): [IStreamResult<any>[], string[]] {\r\n const streams: IStreamResult<any>[] = [];\r\n const streamIds: string[] = [];\r\n for (let i = 0; i < args.length; i++) {\r\n const argument = args[i];\r\n if (this._isObservable(argument)) {\r\n const streamId = this._invocationId;\r\n this._invocationId++;\r\n // Store the stream for later use\r\n streams[streamId] = argument;\r\n streamIds.push(streamId.toString());\r\n\r\n // remove stream from args\r\n args.splice(i, 1);\r\n }\r\n }\r\n\r\n return [streams, streamIds];\r\n }\r\n\r\n private _isObservable(arg: any): arg is IStreamResult<any> {\r\n // This allows other stream implementations to just work (like rxjs)\r\n return arg && arg.subscribe && typeof arg.subscribe === \"function\";\r\n }\r\n\r\n private _createStreamInvocation(methodName: string, args: any[], streamIds: string[]): StreamInvocationMessage {\r\n const invocationId = this._invocationId;\r\n this._invocationId++;\r\n\r\n if (streamIds.length !== 0) {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n streamIds,\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n } else {\r\n return {\r\n arguments: args,\r\n invocationId: invocationId.toString(),\r\n target: methodName,\r\n type: MessageType.StreamInvocation,\r\n };\r\n }\r\n }\r\n\r\n private _createCancelInvocation(id: string): CancelInvocationMessage {\r\n return {\r\n invocationId: id,\r\n type: MessageType.CancelInvocation,\r\n };\r\n }\r\n\r\n private _createStreamItemMessage(id: string, item: any): StreamItemMessage {\r\n return {\r\n invocationId: id,\r\n item,\r\n type: MessageType.StreamItem,\r\n };\r\n }\r\n\r\n private _createCompletionMessage(id: string, error?: any, result?: any): CompletionMessage {\r\n if (error) {\r\n return {\r\n error,\r\n invocationId: id,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n\r\n return {\r\n invocationId: id,\r\n result,\r\n type: MessageType.Completion,\r\n };\r\n }\r\n\r\n private _createCloseMessage(): CloseMessage {\r\n return { type: MessageType.Close };\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { IRetryPolicy, RetryContext } from \"./IRetryPolicy\";\r\n\r\n// 0, 2, 10, 30 second delays before reconnect attempts.\r\nconst DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];\r\n\r\n/** @private */\r\nexport class DefaultReconnectPolicy implements IRetryPolicy {\r\n private readonly _retryDelays: (number | null)[];\r\n\r\n constructor(retryDelays?: number[]) {\r\n this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;\r\n }\r\n\r\n public nextRetryDelayInMilliseconds(retryContext: RetryContext): number | null {\r\n return this._retryDelays[retryContext.previousRetryCount];\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nexport abstract class HeaderNames {\r\n static readonly Authorization = \"Authorization\";\r\n static readonly Cookie = \"Cookie\";\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { HttpClient, HttpRequest, HttpResponse } from \"./HttpClient\";\r\n\r\n/** @private */\r\nexport class AccessTokenHttpClient extends HttpClient {\r\n private _innerClient: HttpClient;\r\n _accessToken: string | undefined;\r\n _accessTokenFactory: (() => string | Promise<string>) | undefined;\r\n\r\n constructor(innerClient: HttpClient, accessTokenFactory: (() => string | Promise<string>) | undefined) {\r\n super();\r\n\r\n this._innerClient = innerClient;\r\n this._accessTokenFactory = accessTokenFactory;\r\n }\r\n\r\n public async send(request: HttpRequest): Promise<HttpResponse> {\r\n let allowRetry = true;\r\n if (this._accessTokenFactory && (!this._accessToken || (request.url && request.url.indexOf(\"/negotiate?\") > 0))) {\r\n // don't retry if the request is a negotiate or if we just got a potentially new token from the access token factory\r\n allowRetry = false;\r\n this._accessToken = await this._accessTokenFactory();\r\n }\r\n this._setAuthorizationHeader(request);\r\n const response = await this._innerClient.send(request);\r\n\r\n if (allowRetry && response.statusCode === 401 && this._accessTokenFactory) {\r\n this._accessToken = await this._accessTokenFactory();\r\n this._setAuthorizationHeader(request);\r\n return await this._innerClient.send(request);\r\n }\r\n return response;\r\n }\r\n\r\n private _setAuthorizationHeader(request: HttpRequest) {\r\n if (!request.headers) {\r\n request.headers = {};\r\n }\r\n if (this._accessToken) {\r\n request.headers[HeaderNames.Authorization] = `Bearer ${this._accessToken}`\r\n }\r\n // don't remove the header if there isn't an access token factory, the user manually added the header in this case\r\n else if (this._accessTokenFactory) {\r\n if (request.headers[HeaderNames.Authorization]) {\r\n delete request.headers[HeaderNames.Authorization];\r\n }\r\n }\r\n }\r\n\r\n public getCookieString(url: string): string {\r\n return this._innerClient.getCookieString(url);\r\n }\r\n}", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// This will be treated as a bit flag in the future, so we keep it using power-of-two values.\r\n/** Specifies a specific HTTP transport type. */\r\nexport enum HttpTransportType {\r\n /** Specifies no transport preference. */\r\n None = 0,\r\n /** Specifies the WebSockets transport. */\r\n WebSockets = 1,\r\n /** Specifies the Server-Sent Events transport. */\r\n ServerSentEvents = 2,\r\n /** Specifies the Long Polling transport. */\r\n LongPolling = 4,\r\n}\r\n\r\n/** Specifies the transfer format for a connection. */\r\nexport enum TransferFormat {\r\n /** Specifies that only text data will be transmitted over the connection. */\r\n Text = 1,\r\n /** Specifies that binary data will be transmitted over the connection. */\r\n Binary = 2,\r\n}\r\n\r\n/** An abstraction over the behavior of transports. This is designed to support the framework and not intended for use by applications. */\r\nexport interface ITransport {\r\n connect(url: string, transferFormat: TransferFormat): Promise<void>;\r\n send(data: any): Promise<void>;\r\n stop(): Promise<void>;\r\n onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n onclose: ((error?: Error) => void) | null;\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\n// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController\r\n// We don't actually ever use the API being polyfilled, we always use the polyfill because\r\n// it's a very new API right now.\r\n\r\n// Not exported from index.\r\n/** @private */\r\nexport class AbortController implements AbortSignal {\r\n private _isAborted: boolean = false;\r\n public onabort: (() => void) | null = null;\r\n\r\n public abort(): void {\r\n if (!this._isAborted) {\r\n this._isAborted = true;\r\n if (this.onabort) {\r\n this.onabort();\r\n }\r\n }\r\n }\r\n\r\n get signal(): AbortSignal {\r\n return this;\r\n }\r\n\r\n get aborted(): boolean {\r\n return this._isAborted;\r\n }\r\n}\r\n\r\n/** Represents a signal that can be monitored to determine if a request has been aborted. */\r\nexport interface AbortSignal {\r\n /** Indicates if the request has been aborted. */\r\n aborted: boolean;\r\n /** Set this to a handler that will be invoked when the request is aborted. */\r\n onabort: (() => void) | null;\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AbortController } from \"./AbortController\";\r\nimport { HttpError, TimeoutError } from \"./Errors\";\r\nimport { HttpClient, HttpRequest } from \"./HttpClient\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, sendMessage } from \"./Utils\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n// Not exported from 'index', this type is internal.\r\n/** @private */\r\nexport class LongPollingTransport implements ITransport {\r\n private readonly _httpClient: HttpClient;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n private readonly _pollAbort: AbortController;\r\n\r\n private _url?: string;\r\n private _running: boolean;\r\n private _receiving?: Promise<void>;\r\n private _closeError?: Error | unknown;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error | unknown) => void) | null;\r\n\r\n // This is an internal type, not exported from 'index' so this is really just internal.\r\n public get pollAborted(): boolean {\r\n return this._pollAbort.aborted;\r\n }\r\n\r\n constructor(httpClient: HttpClient, logger: ILogger, options: IHttpConnectionOptions) {\r\n this._httpClient = httpClient;\r\n this._logger = logger;\r\n this._pollAbort = new AbortController();\r\n this._options = options;\r\n\r\n this._running = false;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise<void> {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._url = url;\r\n\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Connecting.\");\r\n\r\n // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property)\r\n if (transferFormat === TransferFormat.Binary &&\r\n (typeof XMLHttpRequest !== \"undefined\" && typeof new XMLHttpRequest().responseType !== \"string\")) {\r\n throw new Error(\"Binary protocols over XmlHttpRequest not implementing advanced features are not supported.\");\r\n }\r\n\r\n const [name, value] = getUserAgentHeader();\r\n const headers = { [name]: value, ...this._options.headers };\r\n\r\n const pollOptions: HttpRequest = {\r\n abortSignal: this._pollAbort.signal,\r\n headers,\r\n timeout: 100000,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n\r\n if (transferFormat === TransferFormat.Binary) {\r\n pollOptions.responseType = \"arraybuffer\";\r\n }\r\n\r\n // Make initial long polling request\r\n // Server uses first long polling request to finish initializing connection and it returns without data\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n\r\n // Mark running as false so that the poll immediately ends and runs the close logic\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n } else {\r\n this._running = true;\r\n }\r\n\r\n this._receiving = this._poll(this._url, pollOptions);\r\n }\r\n\r\n private async _poll(url: string, pollOptions: HttpRequest): Promise<void> {\r\n try {\r\n while (this._running) {\r\n try {\r\n const pollUrl = `${url}&_=${Date.now()}`;\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);\r\n const response = await this._httpClient.get(pollUrl, pollOptions);\r\n\r\n if (response.statusCode === 204) {\r\n this._logger.log(LogLevel.Information, \"(LongPolling transport) Poll terminated by server.\");\r\n\r\n this._running = false;\r\n } else if (response.statusCode !== 200) {\r\n this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);\r\n\r\n // Unexpected status code\r\n this._closeError = new HttpError(response.statusText || \"\", response.statusCode);\r\n this._running = false;\r\n } else {\r\n // Process the response\r\n if (response.content) {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) data received. ${getDataDetail(response.content, this._options.logMessageContent!)}.`);\r\n if (this.onreceive) {\r\n this.onreceive(response.content);\r\n }\r\n } else {\r\n // This is another way timeout manifest.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n }\r\n }\r\n } catch (e) {\r\n if (!this._running) {\r\n // Log but disregard errors that occur after stopping\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Poll errored after shutdown: ${(e as any).message}`);\r\n } else {\r\n if (e instanceof TimeoutError) {\r\n // Ignore timeouts and reissue the poll.\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Poll timed out, reissuing.\");\r\n } else {\r\n // Close the connection with the error as the result.\r\n this._closeError = e;\r\n this._running = false;\r\n }\r\n }\r\n }\r\n }\r\n } finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Polling complete.\");\r\n\r\n // We will reach here with pollAborted==false when the server returned a response causing the transport to stop.\r\n // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent.\r\n if (!this.pollAborted) {\r\n this._raiseOnClose();\r\n }\r\n }\r\n }\r\n\r\n public async send(data: any): Promise<void> {\r\n if (!this._running) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"LongPolling\", this._httpClient, this._url!, data, this._options);\r\n }\r\n\r\n public async stop(): Promise<void> {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stopping polling.\");\r\n\r\n // Tell receiving loop to stop, abort any current request, and then wait for it to finish\r\n this._running = false;\r\n this._pollAbort.abort();\r\n\r\n try {\r\n await this._receiving;\r\n\r\n // Send DELETE to clean up long polling on the server\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);\r\n\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n const deleteOptions: HttpRequest = {\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n };\r\n\r\n let error;\r\n try {\r\n await this._httpClient.delete(this._url!, deleteOptions);\r\n } catch (err) {\r\n error = err;\r\n }\r\n\r\n if (error) {\r\n if (error instanceof HttpError) {\r\n if (error.statusCode === 404) {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) A 404 response was returned from sending a DELETE request.\");\r\n } else {\r\n this._logger.log(LogLevel.Trace, `(LongPolling transport) Error sending a DELETE request: ${error}`);\r\n }\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) DELETE request accepted.\");\r\n }\r\n\r\n } finally {\r\n this._logger.log(LogLevel.Trace, \"(LongPolling transport) Stop finished.\");\r\n\r\n // Raise close event here instead of in polling\r\n // It needs to happen after the DELETE request is sent\r\n this._raiseOnClose();\r\n }\r\n }\r\n\r\n private _raiseOnClose() {\r\n if (this.onclose) {\r\n let logMessage = \"(LongPolling transport) Firing onclose event.\";\r\n if (this._closeError) {\r\n logMessage += \" Error: \" + this._closeError;\r\n }\r\n this._logger.log(LogLevel.Trace, logMessage);\r\n this.onclose(this._closeError);\r\n }\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform, sendMessage } from \"./Utils\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\n\r\n/** @private */\r\nexport class ServerSentEventsTransport implements ITransport {\r\n private readonly _httpClient: HttpClient;\r\n private readonly _accessToken: string | undefined;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n private _eventSource?: EventSource;\r\n private _url?: string;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error | unknown) => void) | null;\r\n\r\n constructor(httpClient: HttpClient, accessToken: string | undefined, logger: ILogger,\r\n options: IHttpConnectionOptions) {\r\n this._httpClient = httpClient;\r\n this._accessToken = accessToken;\r\n this._logger = logger;\r\n this._options = options;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise<void> {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._logger.log(LogLevel.Trace, \"(SSE transport) Connecting.\");\r\n\r\n // set url before accessTokenFactory because this._url is only for send and we set the auth header instead of the query string for send\r\n this._url = url;\r\n\r\n if (this._accessToken) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(this._accessToken)}`;\r\n }\r\n\r\n return new Promise<void>((resolve, reject) => {\r\n let opened = false;\r\n if (transferFormat !== TransferFormat.Text) {\r\n reject(new Error(\"The Server-Sent Events transport only supports the 'Text' transfer format\"));\r\n return;\r\n }\r\n\r\n let eventSource: EventSource;\r\n if (Platform.isBrowser || Platform.isWebWorker) {\r\n eventSource = new this._options.EventSource!(url, { withCredentials: this._options.withCredentials });\r\n } else {\r\n // Non-browser passes cookies via the dictionary\r\n const cookies = this._httpClient.getCookieString(url);\r\n const headers: MessageHeaders = {};\r\n headers.Cookie = cookies;\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n eventSource = new this._options.EventSource!(url, { withCredentials: this._options.withCredentials, headers: { ...headers, ...this._options.headers} } as EventSourceInit);\r\n }\r\n\r\n try {\r\n eventSource.onmessage = (e: MessageEvent) => {\r\n if (this.onreceive) {\r\n try {\r\n this._logger.log(LogLevel.Trace, `(SSE transport) data received. ${getDataDetail(e.data, this._options.logMessageContent!)}.`);\r\n this.onreceive(e.data);\r\n } catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n\r\n // @ts-ignore: not using event on purpose\r\n eventSource.onerror = (e: Event) => {\r\n // EventSource doesn't give any useful information about server side closes.\r\n if (opened) {\r\n this._close();\r\n } else {\r\n reject(new Error(\"EventSource failed to connect. The connection could not be found on the server,\"\r\n + \" either the connection ID is not present on the server, or a proxy is refusing/buffering the connection.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\"));\r\n }\r\n };\r\n\r\n eventSource.onopen = () => {\r\n this._logger.log(LogLevel.Information, `SSE connected to ${this._url}`);\r\n this._eventSource = eventSource;\r\n opened = true;\r\n resolve();\r\n };\r\n } catch (e) {\r\n reject(e);\r\n return;\r\n }\r\n });\r\n }\r\n\r\n public async send(data: any): Promise<void> {\r\n if (!this._eventSource) {\r\n return Promise.reject(new Error(\"Cannot send until the transport is connected\"));\r\n }\r\n return sendMessage(this._logger, \"SSE\", this._httpClient, this._url!, data, this._options);\r\n }\r\n\r\n public stop(): Promise<void> {\r\n this._close();\r\n return Promise.resolve();\r\n }\r\n\r\n private _close(e?: Error | unknown) {\r\n if (this._eventSource) {\r\n this._eventSource.close();\r\n this._eventSource = undefined;\r\n\r\n if (this.onclose) {\r\n this.onclose(e);\r\n }\r\n }\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { HeaderNames } from \"./HeaderNames\";\r\nimport { HttpClient } from \"./HttpClient\";\r\nimport { MessageHeaders } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { ITransport, TransferFormat } from \"./ITransport\";\r\nimport { WebSocketConstructor } from \"./Polyfills\";\r\nimport { Arg, getDataDetail, getUserAgentHeader, Platform } from \"./Utils\";\r\n\r\n/** @private */\r\nexport class WebSocketTransport implements ITransport {\r\n private readonly _logger: ILogger;\r\n private readonly _accessTokenFactory: (() => string | Promise<string>) | undefined;\r\n private readonly _logMessageContent: boolean;\r\n private readonly _webSocketConstructor: WebSocketConstructor;\r\n private readonly _httpClient: HttpClient;\r\n private _webSocket?: WebSocket;\r\n private _headers: MessageHeaders;\r\n\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((error?: Error) => void) | null;\r\n\r\n constructor(httpClient: HttpClient, accessTokenFactory: (() => string | Promise<string>) | undefined, logger: ILogger,\r\n logMessageContent: boolean, webSocketConstructor: WebSocketConstructor, headers: MessageHeaders) {\r\n this._logger = logger;\r\n this._accessTokenFactory = accessTokenFactory;\r\n this._logMessageContent = logMessageContent;\r\n this._webSocketConstructor = webSocketConstructor;\r\n this._httpClient = httpClient;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n this._headers = headers;\r\n }\r\n\r\n public async connect(url: string, transferFormat: TransferFormat): Promise<void> {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isRequired(transferFormat, \"transferFormat\");\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) Connecting.\");\r\n\r\n let token: string;\r\n if (this._accessTokenFactory) {\r\n token = await this._accessTokenFactory();\r\n }\r\n\r\n return new Promise<void>((resolve, reject) => {\r\n url = url.replace(/^http/, \"ws\");\r\n let webSocket: WebSocket | undefined;\r\n const cookies = this._httpClient.getCookieString(url);\r\n let opened = false;\r\n\r\n if (Platform.isNode || Platform.isReactNative) {\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n if (token) {\r\n headers[HeaderNames.Authorization] = `Bearer ${token}`;\r\n }\r\n\r\n if (cookies) {\r\n headers[HeaderNames.Cookie] = cookies;\r\n }\r\n\r\n // Only pass headers when in non-browser environments\r\n webSocket = new this._webSocketConstructor(url, undefined, {\r\n headers: { ...headers, ...this._headers },\r\n });\r\n }\r\n else\r\n {\r\n if (token) {\r\n url += (url.indexOf(\"?\") < 0 ? \"?\" : \"&\") + `access_token=${encodeURIComponent(token)}`;\r\n }\r\n }\r\n\r\n if (!webSocket) {\r\n // Chrome is not happy with passing 'undefined' as protocol\r\n webSocket = new this._webSocketConstructor(url);\r\n }\r\n\r\n if (transferFormat === TransferFormat.Binary) {\r\n webSocket.binaryType = \"arraybuffer\";\r\n }\r\n\r\n webSocket.onopen = (_event: Event) => {\r\n this._logger.log(LogLevel.Information, `WebSocket connected to ${url}.`);\r\n this._webSocket = webSocket;\r\n opened = true;\r\n resolve();\r\n };\r\n\r\n webSocket.onerror = (event: Event) => {\r\n let error: any = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n } else {\r\n error = \"There was an error with the transport\";\r\n }\r\n\r\n this._logger.log(LogLevel.Information, `(WebSockets transport) ${error}.`);\r\n };\r\n\r\n webSocket.onmessage = (message: MessageEvent) => {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) data received. ${getDataDetail(message.data, this._logMessageContent)}.`);\r\n if (this.onreceive) {\r\n try {\r\n this.onreceive(message.data);\r\n } catch (error) {\r\n this._close(error);\r\n return;\r\n }\r\n }\r\n };\r\n\r\n webSocket.onclose = (event: CloseEvent) => {\r\n // Don't call close handler if connection was never established\r\n // We'll reject the connect call instead\r\n if (opened) {\r\n this._close(event);\r\n } else {\r\n let error: any = null;\r\n // ErrorEvent is a browser only type we need to check if the type exists before using it\r\n if (typeof ErrorEvent !== \"undefined\" && event instanceof ErrorEvent) {\r\n error = event.error;\r\n } else {\r\n error = \"WebSocket failed to connect. The connection could not be found on the server,\"\r\n + \" either the endpoint may not be a SignalR endpoint,\"\r\n + \" the connection ID is not present on the server, or there is a proxy blocking WebSockets.\"\r\n + \" If you have multiple servers check that sticky sessions are enabled.\";\r\n }\r\n\r\n reject(new Error(error));\r\n }\r\n };\r\n });\r\n }\r\n\r\n public send(data: any): Promise<void> {\r\n if (this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN) {\r\n this._logger.log(LogLevel.Trace, `(WebSockets transport) sending data. ${getDataDetail(data, this._logMessageContent)}.`);\r\n this._webSocket.send(data);\r\n return Promise.resolve();\r\n }\r\n\r\n return Promise.reject(\"WebSocket is not in the OPEN state\");\r\n }\r\n\r\n public stop(): Promise<void> {\r\n if (this._webSocket) {\r\n // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning\r\n // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects\r\n this._close(undefined);\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n\r\n private _close(event: CloseEvent | Error | unknown): void {\r\n // webSocket will be null if the transport did not start successfully\r\n if (this._webSocket) {\r\n // Clear websocket handlers because we are considering the socket closed now\r\n this._webSocket.onclose = () => {};\r\n this._webSocket.onmessage = () => {};\r\n this._webSocket.onerror = () => {};\r\n this._webSocket.close();\r\n this._webSocket = undefined;\r\n }\r\n\r\n this._logger.log(LogLevel.Trace, \"(WebSockets transport) socket closed.\");\r\n\r\n if (this.onclose) {\r\n if (this._isCloseEvent(event) && (event.wasClean === false || event.code !== 1000)) {\r\n this.onclose(new Error(`WebSocket closed with status code: ${event.code} (${event.reason || \"no reason given\"}).`));\r\n } else if (event instanceof Error) {\r\n this.onclose(event);\r\n } else {\r\n this.onclose();\r\n }\r\n }\r\n }\r\n\r\n private _isCloseEvent(event?: any): event is CloseEvent {\r\n return event && typeof event.wasClean === \"boolean\" && typeof event.code === \"number\";\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AccessTokenHttpClient } from \"./AccessTokenHttpClient\";\r\nimport { DefaultHttpClient } from \"./DefaultHttpClient\";\r\nimport { AggregateErrors, DisabledTransportError, FailedToNegotiateWithServerError, FailedToStartTransportError, HttpError, UnsupportedTransportError, AbortError } from \"./Errors\";\r\nimport { IConnection } from \"./IConnection\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { HttpTransportType, ITransport, TransferFormat } from \"./ITransport\";\r\nimport { LongPollingTransport } from \"./LongPollingTransport\";\r\nimport { ServerSentEventsTransport } from \"./ServerSentEventsTransport\";\r\nimport { Arg, createLogger, getUserAgentHeader, Platform } from \"./Utils\";\r\nimport { WebSocketTransport } from \"./WebSocketTransport\";\r\n\r\n/** @private */\r\nconst enum ConnectionState {\r\n Connecting = \"Connecting\",\r\n Connected = \"Connected\",\r\n Disconnected = \"Disconnected\",\r\n Disconnecting = \"Disconnecting\",\r\n}\r\n\r\n/** @private */\r\nexport interface INegotiateResponse {\r\n connectionId?: string;\r\n connectionToken?: string;\r\n negotiateVersion?: number;\r\n availableTransports?: IAvailableTransport[];\r\n url?: string;\r\n accessToken?: string;\r\n error?: string;\r\n useStatefulReconnect?: boolean;\r\n}\r\n\r\n/** @private */\r\nexport interface IAvailableTransport {\r\n transport: keyof typeof HttpTransportType;\r\n transferFormats: (keyof typeof TransferFormat)[];\r\n}\r\n\r\nconst MAX_REDIRECTS = 100;\r\n\r\n/** @private */\r\nexport class HttpConnection implements IConnection {\r\n private _connectionState: ConnectionState;\r\n // connectionStarted is tracked independently from connectionState, so we can check if the\r\n // connection ever did successfully transition from connecting to connected before disconnecting.\r\n private _connectionStarted: boolean;\r\n private readonly _httpClient: AccessTokenHttpClient;\r\n private readonly _logger: ILogger;\r\n private readonly _options: IHttpConnectionOptions;\r\n // Needs to not start with _ to be available for tests\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private transport?: ITransport;\r\n private _startInternalPromise?: Promise<void>;\r\n private _stopPromise?: Promise<void>;\r\n private _stopPromiseResolver: (value?: PromiseLike<void>) => void = () => {};\r\n private _stopError?: Error;\r\n private _accessTokenFactory?: () => string | Promise<string>;\r\n private _sendQueue?: TransportSendQueue;\r\n\r\n public readonly features: any = {};\r\n public baseUrl: string;\r\n public connectionId?: string;\r\n public onreceive: ((data: string | ArrayBuffer) => void) | null;\r\n public onclose: ((e?: Error) => void) | null;\r\n\r\n private readonly _negotiateVersion: number = 1;\r\n\r\n constructor(url: string, options: IHttpConnectionOptions = {}) {\r\n Arg.isRequired(url, \"url\");\r\n\r\n this._logger = createLogger(options.logger);\r\n this.baseUrl = this._resolveUrl(url);\r\n\r\n options = options || {};\r\n options.logMessageContent = options.logMessageContent === undefined ? false : options.logMessageContent;\r\n if (typeof options.withCredentials === \"boolean\" || options.withCredentials === undefined) {\r\n options.withCredentials = options.withCredentials === undefined ? true : options.withCredentials;\r\n } else {\r\n throw new Error(\"withCredentials option was not a 'boolean' or 'undefined' value\");\r\n }\r\n options.timeout = options.timeout === undefined ? 100 * 1000 : options.timeout;\r\n\r\n let webSocketModule: any = null;\r\n let eventSourceModule: any = null;\r\n\r\n if (Platform.isNode && typeof require !== \"undefined\") {\r\n // In order to ignore the dynamic require in webpack builds we need to do this magic\r\n // @ts-ignore: TS doesn't know about these names\r\n const requireFunc = typeof __webpack_require__ === \"function\" ? __non_webpack_require__ : require;\r\n webSocketModule = requireFunc(\"ws\");\r\n eventSourceModule = requireFunc(\"eventsource\");\r\n }\r\n\r\n if (!Platform.isNode && typeof WebSocket !== \"undefined\" && !options.WebSocket) {\r\n options.WebSocket = WebSocket;\r\n } else if (Platform.isNode && !options.WebSocket) {\r\n if (webSocketModule) {\r\n options.WebSocket = webSocketModule;\r\n }\r\n }\r\n\r\n if (!Platform.isNode && typeof EventSource !== \"undefined\" && !options.EventSource) {\r\n options.EventSource = EventSource;\r\n } else if (Platform.isNode && !options.EventSource) {\r\n if (typeof eventSourceModule !== \"undefined\") {\r\n options.EventSource = eventSourceModule;\r\n }\r\n }\r\n\r\n this._httpClient = new AccessTokenHttpClient(options.httpClient || new DefaultHttpClient(this._logger), options.accessTokenFactory);\r\n this._connectionState = ConnectionState.Disconnected;\r\n this._connectionStarted = false;\r\n this._options = options;\r\n\r\n this.onreceive = null;\r\n this.onclose = null;\r\n }\r\n\r\n public start(): Promise<void>;\r\n public start(transferFormat: TransferFormat): Promise<void>;\r\n public async start(transferFormat?: TransferFormat): Promise<void> {\r\n transferFormat = transferFormat || TransferFormat.Binary;\r\n\r\n Arg.isIn(transferFormat, TransferFormat, \"transferFormat\");\r\n\r\n this._logger.log(LogLevel.Debug, `Starting connection with transfer format '${TransferFormat[transferFormat]}'.`);\r\n\r\n if (this._connectionState !== ConnectionState.Disconnected) {\r\n return Promise.reject(new Error(\"Cannot start an HttpConnection that is not in the 'Disconnected' state.\"));\r\n }\r\n\r\n this._connectionState = ConnectionState.Connecting;\r\n\r\n this._startInternalPromise = this._startInternal(transferFormat);\r\n await this._startInternalPromise;\r\n\r\n // The TypeScript compiler thinks that connectionState must be Connecting here. The TypeScript compiler is wrong.\r\n if (this._connectionState as any === ConnectionState.Disconnecting) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"Failed to start the HttpConnection before stop() was called.\";\r\n this._logger.log(LogLevel.Error, message);\r\n\r\n // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.\r\n await this._stopPromise;\r\n\r\n return Promise.reject(new AbortError(message));\r\n } else if (this._connectionState as any !== ConnectionState.Connected) {\r\n // stop() was called and transitioned the client into the Disconnecting state.\r\n const message = \"HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!\";\r\n this._logger.log(LogLevel.Error, message);\r\n return Promise.reject(new AbortError(message));\r\n }\r\n\r\n this._connectionStarted = true;\r\n }\r\n\r\n public send(data: string | ArrayBuffer): Promise<void> {\r\n if (this._connectionState !== ConnectionState.Connected) {\r\n return Promise.reject(new Error(\"Cannot send data if the connection is not in the 'Connected' State.\"));\r\n }\r\n\r\n if (!this._sendQueue) {\r\n this._sendQueue = new TransportSendQueue(this.transport!);\r\n }\r\n\r\n // Transport will not be null if state is connected\r\n return this._sendQueue.send(data);\r\n }\r\n\r\n public async stop(error?: Error): Promise<void> {\r\n if (this._connectionState === ConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnected state.`);\r\n return Promise.resolve();\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Disconnecting) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);\r\n return this._stopPromise;\r\n }\r\n\r\n this._connectionState = ConnectionState.Disconnecting;\r\n\r\n this._stopPromise = new Promise((resolve) => {\r\n // Don't complete stop() until stopConnection() completes.\r\n this._stopPromiseResolver = resolve;\r\n });\r\n\r\n // stopInternal should never throw so just observe it.\r\n await this._stopInternal(error);\r\n await this._stopPromise;\r\n }\r\n\r\n private async _stopInternal(error?: Error): Promise<void> {\r\n // Set error as soon as possible otherwise there is a race between\r\n // the transport closing and providing an error and the error from a close message\r\n // We would prefer the close message error.\r\n this._stopError = error;\r\n\r\n try {\r\n await this._startInternalPromise;\r\n } catch (e) {\r\n // This exception is returned to the user as a rejected Promise from the start method.\r\n }\r\n\r\n // The transport's onclose will trigger stopConnection which will run our onclose event.\r\n // The transport should always be set if currently connected. If it wasn't set, it's likely because\r\n // stop was called during start() and start() failed.\r\n if (this.transport) {\r\n try {\r\n await this.transport.stop();\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.transport.stop() threw error '${e}'.`);\r\n this._stopConnection();\r\n }\r\n\r\n this.transport = undefined;\r\n } else {\r\n this._logger.log(LogLevel.Debug, \"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.\");\r\n }\r\n }\r\n\r\n private async _startInternal(transferFormat: TransferFormat): Promise<void> {\r\n // Store the original base url and the access token factory since they may change\r\n // as part of negotiating\r\n let url = this.baseUrl;\r\n this._accessTokenFactory = this._options.accessTokenFactory;\r\n this._httpClient._accessTokenFactory = this._accessTokenFactory;\r\n\r\n try {\r\n if (this._options.skipNegotiation) {\r\n if (this._options.transport === HttpTransportType.WebSockets) {\r\n // No need to add a connection ID in this case\r\n this.transport = this._constructTransport(HttpTransportType.WebSockets);\r\n // We should just call connect directly in this case.\r\n // No fallback or negotiate in this case.\r\n await this._startTransport(url, transferFormat);\r\n } else {\r\n throw new Error(\"Negotiation can only be skipped when using the WebSocket transport directly.\");\r\n }\r\n } else {\r\n let negotiateResponse: INegotiateResponse | null = null;\r\n let redirects = 0;\r\n\r\n do {\r\n negotiateResponse = await this._getNegotiationResponse(url);\r\n // the user tries to stop the connection when it is being started\r\n if (this._connectionState === ConnectionState.Disconnecting || this._connectionState === ConnectionState.Disconnected) {\r\n throw new AbortError(\"The connection was stopped during negotiation.\");\r\n }\r\n\r\n if (negotiateResponse.error) {\r\n throw new Error(negotiateResponse.error);\r\n }\r\n\r\n if ((negotiateResponse as any).ProtocolVersion) {\r\n throw new Error(\"Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.\");\r\n }\r\n\r\n if (negotiateResponse.url) {\r\n url = negotiateResponse.url;\r\n }\r\n\r\n if (negotiateResponse.accessToken) {\r\n // Replace the current access token factory with one that uses\r\n // the returned access token\r\n const accessToken = negotiateResponse.accessToken;\r\n this._accessTokenFactory = () => accessToken;\r\n // set the factory to undefined so the AccessTokenHttpClient won't retry with the same token, since we know it won't change until a connection restart\r\n this._httpClient._accessToken = accessToken;\r\n this._httpClient._accessTokenFactory = undefined;\r\n }\r\n\r\n redirects++;\r\n }\r\n while (negotiateResponse.url && redirects < MAX_REDIRECTS);\r\n\r\n if (redirects === MAX_REDIRECTS && negotiateResponse.url) {\r\n throw new Error(\"Negotiate redirection limit exceeded.\");\r\n }\r\n\r\n await this._createTransport(url, this._options.transport, negotiateResponse, transferFormat);\r\n }\r\n\r\n if (this.transport instanceof LongPollingTransport) {\r\n this.features.inherentKeepAlive = true;\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Connecting) {\r\n // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise.\r\n // start() will handle the case when stop was called and startInternal exits still in the disconnecting state.\r\n this._logger.log(LogLevel.Debug, \"The HttpConnection connected successfully.\");\r\n this._connectionState = ConnectionState.Connected;\r\n }\r\n\r\n // stop() is waiting on us via this.startInternalPromise so keep this.transport around so it can clean up.\r\n // This is the only case startInternal can exit in neither the connected nor disconnected state because stopConnection()\r\n // will transition to the disconnected state. start() will wait for the transition using the stopPromise.\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, \"Failed to start the connection: \" + e);\r\n this._connectionState = ConnectionState.Disconnected;\r\n this.transport = undefined;\r\n\r\n // if start fails, any active calls to stop assume that start will complete the stop promise\r\n this._stopPromiseResolver();\r\n return Promise.reject(e);\r\n }\r\n }\r\n\r\n private async _getNegotiationResponse(url: string): Promise<INegotiateResponse> {\r\n const headers: {[k: string]: string} = {};\r\n const [name, value] = getUserAgentHeader();\r\n headers[name] = value;\r\n\r\n const negotiateUrl = this._resolveNegotiateUrl(url);\r\n this._logger.log(LogLevel.Debug, `Sending negotiation request: ${negotiateUrl}.`);\r\n try {\r\n const response = await this._httpClient.post(negotiateUrl, {\r\n content: \"\",\r\n headers: { ...headers, ...this._options.headers },\r\n timeout: this._options.timeout,\r\n withCredentials: this._options.withCredentials,\r\n });\r\n\r\n if (response.statusCode !== 200) {\r\n return Promise.reject(new Error(`Unexpected status code returned from negotiate '${response.statusCode}'`));\r\n }\r\n\r\n const negotiateResponse = JSON.parse(response.content as string) as INegotiateResponse;\r\n if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) {\r\n // Negotiate version 0 doesn't use connectionToken\r\n // So we set it equal to connectionId so all our logic can use connectionToken without being aware of the negotiate version\r\n negotiateResponse.connectionToken = negotiateResponse.connectionId;\r\n }\r\n\r\n if (negotiateResponse.useStatefulReconnect && this._options._useStatefulReconnect !== true) {\r\n return Promise.reject(new FailedToNegotiateWithServerError(\"Client didn't negotiate Stateful Reconnect but the server did.\"));\r\n }\r\n\r\n return negotiateResponse;\r\n } catch (e) {\r\n let errorMessage = \"Failed to complete negotiation with the server: \" + e;\r\n if (e instanceof HttpError) {\r\n if (e.statusCode === 404) {\r\n errorMessage = errorMessage + \" Either this is not a SignalR endpoint or there is a proxy blocking the connection.\";\r\n }\r\n }\r\n this._logger.log(LogLevel.Error, errorMessage);\r\n\r\n return Promise.reject(new FailedToNegotiateWithServerError(errorMessage));\r\n }\r\n }\r\n\r\n private _createConnectUrl(url: string, connectionToken: string | null | undefined) {\r\n if (!connectionToken) {\r\n return url;\r\n }\r\n\r\n return url + (url.indexOf(\"?\") === -1 ? \"?\" : \"&\") + `id=${connectionToken}`;\r\n }\r\n\r\n private async _createTransport(url: string, requestedTransport: HttpTransportType | ITransport | undefined, negotiateResponse: INegotiateResponse, requestedTransferFormat: TransferFormat): Promise<void> {\r\n let connectUrl = this._createConnectUrl(url, negotiateResponse.connectionToken);\r\n if (this._isITransport(requestedTransport)) {\r\n this._logger.log(LogLevel.Debug, \"Connection was provided an instance of ITransport, using that directly.\");\r\n this.transport = requestedTransport;\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n\r\n this.connectionId = negotiateResponse.connectionId;\r\n return;\r\n }\r\n\r\n const transportExceptions: any[] = [];\r\n const transports = negotiateResponse.availableTransports || [];\r\n let negotiate: INegotiateResponse | undefined = negotiateResponse;\r\n for (const endpoint of transports) {\r\n const transportOrError = this._resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat,\r\n negotiate?.useStatefulReconnect === true);\r\n if (transportOrError instanceof Error) {\r\n // Store the error and continue, we don't want to cause a re-negotiate in these cases\r\n transportExceptions.push(`${endpoint.transport} failed:`);\r\n transportExceptions.push(transportOrError);\r\n } else if (this._isITransport(transportOrError)) {\r\n this.transport = transportOrError;\r\n if (!negotiate) {\r\n try {\r\n negotiate = await this._getNegotiationResponse(url);\r\n } catch (ex) {\r\n return Promise.reject(ex);\r\n }\r\n connectUrl = this._createConnectUrl(url, negotiate.connectionToken);\r\n }\r\n try {\r\n await this._startTransport(connectUrl, requestedTransferFormat);\r\n this.connectionId = negotiate.connectionId;\r\n return;\r\n } catch (ex) {\r\n this._logger.log(LogLevel.Error, `Failed to start the transport '${endpoint.transport}': ${ex}`);\r\n negotiate = undefined;\r\n transportExceptions.push(new FailedToStartTransportError(`${endpoint.transport} failed: ${ex}`, HttpTransportType[endpoint.transport]));\r\n\r\n if (this._connectionState !== ConnectionState.Connecting) {\r\n const message = \"Failed to select transport before stop() was called.\";\r\n this._logger.log(LogLevel.Debug, message);\r\n return Promise.reject(new AbortError(message));\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (transportExceptions.length > 0) {\r\n return Promise.reject(new AggregateErrors(`Unable to connect to the server with any of the available transports. ${transportExceptions.join(\" \")}`, transportExceptions));\r\n }\r\n return Promise.reject(new Error(\"None of the transports supported by the client are supported by the server.\"));\r\n }\r\n\r\n private _constructTransport(transport: HttpTransportType): ITransport {\r\n switch (transport) {\r\n case HttpTransportType.WebSockets:\r\n if (!this._options.WebSocket) {\r\n throw new Error(\"'WebSocket' is not supported in your environment.\");\r\n }\r\n return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent!,\r\n this._options.WebSocket, this._options.headers || {});\r\n case HttpTransportType.ServerSentEvents:\r\n if (!this._options.EventSource) {\r\n throw new Error(\"'EventSource' is not supported in your environment.\");\r\n }\r\n return new ServerSentEventsTransport(this._httpClient, this._httpClient._accessToken, this._logger, this._options);\r\n case HttpTransportType.LongPolling:\r\n return new LongPollingTransport(this._httpClient, this._logger, this._options);\r\n default:\r\n throw new Error(`Unknown transport: ${transport}.`);\r\n }\r\n }\r\n\r\n private _startTransport(url: string, transferFormat: TransferFormat): Promise<void> {\r\n this.transport!.onreceive = this.onreceive;\r\n if (this.features.reconnect) {\r\n this.transport!.onclose = async (e) => {\r\n let callStop = false;\r\n if (this.features.reconnect) {\r\n try {\r\n this.features.disconnected();\r\n await this.transport!.connect(url, transferFormat);\r\n await this.features.resend();\r\n } catch {\r\n callStop = true;\r\n }\r\n } else {\r\n this._stopConnection(e);\r\n return;\r\n }\r\n\r\n if (callStop) {\r\n this._stopConnection(e);\r\n }\r\n };\r\n } else {\r\n this.transport!.onclose = (e) => this._stopConnection(e);\r\n }\r\n return this.transport!.connect(url, transferFormat);\r\n }\r\n\r\n private _resolveTransportOrError(endpoint: IAvailableTransport, requestedTransport: HttpTransportType | undefined,\r\n requestedTransferFormat: TransferFormat, useStatefulReconnect: boolean): ITransport | Error | unknown {\r\n const transport = HttpTransportType[endpoint.transport];\r\n if (transport === null || transport === undefined) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n return new Error(`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);\r\n } else {\r\n if (transportMatches(requestedTransport, transport)) {\r\n const transferFormats = endpoint.transferFormats.map((s) => TransferFormat[s]);\r\n if (transferFormats.indexOf(requestedTransferFormat) >= 0) {\r\n if ((transport === HttpTransportType.WebSockets && !this._options.WebSocket) ||\r\n (transport === HttpTransportType.ServerSentEvents && !this._options.EventSource)) {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it is not supported in your environment.'`);\r\n return new UnsupportedTransportError(`'${HttpTransportType[transport]}' is not supported in your environment.`, transport);\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Selecting transport '${HttpTransportType[transport]}'.`);\r\n try {\r\n this.features.reconnect = transport === HttpTransportType.WebSockets ? useStatefulReconnect : undefined;\r\n return this._constructTransport(transport);\r\n } catch (ex) {\r\n return ex;\r\n }\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it does not support the requested transfer format '${TransferFormat[requestedTransferFormat]}'.`);\r\n return new Error(`'${HttpTransportType[transport]}' does not support ${TransferFormat[requestedTransferFormat]}.`);\r\n }\r\n } else {\r\n this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it was disabled by the client.`);\r\n return new DisabledTransportError(`'${HttpTransportType[transport]}' is disabled by the client.`, transport);\r\n }\r\n }\r\n }\r\n\r\n private _isITransport(transport: any): transport is ITransport {\r\n return transport && typeof (transport) === \"object\" && \"connect\" in transport;\r\n }\r\n\r\n private _stopConnection(error?: Error): void {\r\n this._logger.log(LogLevel.Debug, `HttpConnection.stopConnection(${error}) called while in state ${this._connectionState}.`);\r\n\r\n this.transport = undefined;\r\n\r\n // If we have a stopError, it takes precedence over the error from the transport\r\n error = this._stopError || error;\r\n this._stopError = undefined;\r\n\r\n if (this._connectionState === ConnectionState.Disconnected) {\r\n this._logger.log(LogLevel.Debug, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is already in the disconnected state.`);\r\n return;\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Connecting) {\r\n this._logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);\r\n throw new Error(`HttpConnection.stopConnection(${error}) was called while the connection is still in the connecting state.`);\r\n }\r\n\r\n if (this._connectionState === ConnectionState.Disconnecting) {\r\n // A call to stop() induced this call to stopConnection and needs to be completed.\r\n // Any stop() awaiters will be scheduled to continue after the onclose callback fires.\r\n this._stopPromiseResolver();\r\n }\r\n\r\n if (error) {\r\n this._logger.log(LogLevel.Error, `Connection disconnected with error '${error}'.`);\r\n } else {\r\n this._logger.log(LogLevel.Information, \"Connection disconnected.\");\r\n }\r\n\r\n if (this._sendQueue) {\r\n this._sendQueue.stop().catch((e) => {\r\n this._logger.log(LogLevel.Error, `TransportSendQueue.stop() threw error '${e}'.`);\r\n });\r\n this._sendQueue = undefined;\r\n }\r\n\r\n this.connectionId = undefined;\r\n this._connectionState = ConnectionState.Disconnected;\r\n\r\n if (this._connectionStarted) {\r\n this._connectionStarted = false;\r\n try {\r\n if (this.onclose) {\r\n this.onclose(error);\r\n }\r\n } catch (e) {\r\n this._logger.log(LogLevel.Error, `HttpConnection.onclose(${error}) threw error '${e}'.`);\r\n }\r\n }\r\n }\r\n\r\n private _resolveUrl(url: string): string {\r\n // startsWith is not supported in IE\r\n if (url.lastIndexOf(\"https://\", 0) === 0 || url.lastIndexOf(\"http://\", 0) === 0) {\r\n return url;\r\n }\r\n\r\n if (!Platform.isBrowser) {\r\n throw new Error(`Cannot resolve '${url}'.`);\r\n }\r\n\r\n // Setting the url to the href propery of an anchor tag handles normalization\r\n // for us. There are 3 main cases.\r\n // 1. Relative path normalization e.g \"b\" -> \"http://localhost:5000/a/b\"\r\n // 2. Absolute path normalization e.g \"/a/b\" -> \"http://localhost:5000/a/b\"\r\n // 3. Networkpath reference normalization e.g \"//localhost:5000/a/b\" -> \"http://localhost:5000/a/b\"\r\n const aTag = window.document.createElement(\"a\");\r\n aTag.href = url;\r\n\r\n this._logger.log(LogLevel.Information, `Normalizing '${url}' to '${aTag.href}'.`);\r\n return aTag.href;\r\n }\r\n\r\n private _resolveNegotiateUrl(url: string): string {\r\n const negotiateUrl = new URL(url);\r\n\r\n if (negotiateUrl.pathname.endsWith('/')) {\r\n negotiateUrl.pathname += \"negotiate\";\r\n } else {\r\n negotiateUrl.pathname += \"/negotiate\";\r\n }\r\n const searchParams = new URLSearchParams(negotiateUrl.searchParams);\r\n\r\n if (!searchParams.has(\"negotiateVersion\")) {\r\n searchParams.append(\"negotiateVersion\", this._negotiateVersion.toString());\r\n }\r\n\r\n if (searchParams.has(\"useStatefulReconnect\")) {\r\n if (searchParams.get(\"useStatefulReconnect\") === \"true\") {\r\n this._options._useStatefulReconnect = true;\r\n }\r\n } else if (this._options._useStatefulReconnect === true) {\r\n searchParams.append(\"useStatefulReconnect\", \"true\");\r\n }\r\n\r\n negotiateUrl.search = searchParams.toString();\r\n\r\n return negotiateUrl.toString();\r\n }\r\n}\r\n\r\nfunction transportMatches(requestedTransport: HttpTransportType | undefined, actualTransport: HttpTransportType) {\r\n return !requestedTransport || ((actualTransport & requestedTransport) !== 0);\r\n}\r\n\r\n/** @private */\r\nexport class TransportSendQueue {\r\n private _buffer: any[] = [];\r\n private _sendBufferedData: PromiseSource;\r\n private _executing: boolean = true;\r\n private _transportResult?: PromiseSource;\r\n private _sendLoopPromise: Promise<void>;\r\n\r\n constructor(private readonly _transport: ITransport) {\r\n this._sendBufferedData = new PromiseSource();\r\n this._transportResult = new PromiseSource();\r\n\r\n this._sendLoopPromise = this._sendLoop();\r\n }\r\n\r\n public send(data: string | ArrayBuffer): Promise<void> {\r\n this._bufferData(data);\r\n if (!this._transportResult) {\r\n this._transportResult = new PromiseSource();\r\n }\r\n return this._transportResult.promise;\r\n }\r\n\r\n public stop(): Promise<void> {\r\n this._executing = false;\r\n this._sendBufferedData.resolve();\r\n return this._sendLoopPromise;\r\n }\r\n\r\n private _bufferData(data: string | ArrayBuffer): void {\r\n if (this._buffer.length && typeof(this._buffer[0]) !== typeof(data)) {\r\n throw new Error(`Expected data to be of type ${typeof(this._buffer)} but was of type ${typeof(data)}`);\r\n }\r\n\r\n this._buffer.push(data);\r\n this._sendBufferedData.resolve();\r\n }\r\n\r\n private async _sendLoop(): Promise<void> {\r\n while (true) {\r\n await this._sendBufferedData.promise;\r\n\r\n if (!this._executing) {\r\n if (this._transportResult) {\r\n this._transportResult.reject(\"Connection stopped.\");\r\n }\r\n\r\n break;\r\n }\r\n\r\n this._sendBufferedData = new PromiseSource();\r\n\r\n const transportResult = this._transportResult!;\r\n this._transportResult = undefined;\r\n\r\n const data = typeof(this._buffer[0]) === \"string\" ?\r\n this._buffer.join(\"\") :\r\n TransportSendQueue._concatBuffers(this._buffer);\r\n\r\n this._buffer.length = 0;\r\n\r\n try {\r\n await this._transport.send(data);\r\n transportResult.resolve();\r\n } catch (error) {\r\n transportResult.reject(error);\r\n }\r\n }\r\n }\r\n\r\n private static _concatBuffers(arrayBuffers: ArrayBuffer[]): ArrayBuffer {\r\n const totalLength = arrayBuffers.map((b) => b.byteLength).reduce((a, b) => a + b);\r\n const result = new Uint8Array(totalLength);\r\n let offset = 0;\r\n for (const item of arrayBuffers) {\r\n result.set(new Uint8Array(item), offset);\r\n offset += item.byteLength;\r\n }\r\n\r\n return result.buffer;\r\n }\r\n}\r\n\r\nclass PromiseSource {\r\n private _resolver?: () => void;\r\n private _rejecter!: (reason?: any) => void;\r\n public promise: Promise<void>;\r\n\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => [this._resolver, this._rejecter] = [resolve, reject]);\r\n }\r\n\r\n public resolve(): void {\r\n this._resolver!();\r\n }\r\n\r\n public reject(reason?: any): void {\r\n this._rejecter!(reason);\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { AckMessage, CompletionMessage, HubMessage, IHubProtocol, InvocationMessage, MessageType, SequenceMessage, StreamItemMessage } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { TransferFormat } from \"./ITransport\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { TextMessageFormat } from \"./TextMessageFormat\";\r\n\r\nconst JSON_HUB_PROTOCOL_NAME: string = \"json\";\r\n\r\n/** Implements the JSON Hub Protocol. */\r\nexport class JsonHubProtocol implements IHubProtocol {\r\n\r\n /** @inheritDoc */\r\n public readonly name: string = JSON_HUB_PROTOCOL_NAME;\r\n /** @inheritDoc */\r\n public readonly version: number = 2;\r\n\r\n /** @inheritDoc */\r\n public readonly transferFormat: TransferFormat = TransferFormat.Text;\r\n\r\n /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.\r\n *\r\n * @param {string} input A string containing the serialized representation.\r\n * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.\r\n */\r\n public parseMessages(input: string, logger: ILogger): HubMessage[] {\r\n // The interface does allow \"ArrayBuffer\" to be passed in, but this implementation does not. So let's throw a useful error.\r\n if (typeof input !== \"string\") {\r\n throw new Error(\"Invalid input for JSON hub protocol. Expected a string.\");\r\n }\r\n\r\n if (!input) {\r\n return [];\r\n }\r\n\r\n if (logger === null) {\r\n logger = NullLogger.instance;\r\n }\r\n\r\n // Parse the messages\r\n const messages = TextMessageFormat.parse(input);\r\n\r\n const hubMessages = [];\r\n for (const message of messages) {\r\n const parsedMessage = JSON.parse(message) as HubMessage;\r\n if (typeof parsedMessage.type !== \"number\") {\r\n throw new Error(\"Invalid payload.\");\r\n }\r\n switch (parsedMessage.type) {\r\n case MessageType.Invocation:\r\n this._isInvocationMessage(parsedMessage);\r\n break;\r\n case MessageType.StreamItem:\r\n this._isStreamItemMessage(parsedMessage);\r\n break;\r\n case MessageType.Completion:\r\n this._isCompletionMessage(parsedMessage);\r\n break;\r\n case MessageType.Ping:\r\n // Single value, no need to validate\r\n break;\r\n case MessageType.Close:\r\n // All optional values, no need to validate\r\n break;\r\n case MessageType.Ack:\r\n this._isAckMessage(parsedMessage);\r\n break;\r\n case MessageType.Sequence:\r\n this._isSequenceMessage(parsedMessage);\r\n break;\r\n default:\r\n // Future protocol changes can add message types, old clients can ignore them\r\n logger.log(LogLevel.Information, \"Unknown message type '\" + parsedMessage.type + \"' ignored.\");\r\n continue;\r\n }\r\n hubMessages.push(parsedMessage);\r\n }\r\n\r\n return hubMessages;\r\n }\r\n\r\n /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.\r\n *\r\n * @param {HubMessage} message The message to write.\r\n * @returns {string} A string containing the serialized representation of the message.\r\n */\r\n public writeMessage(message: HubMessage): string {\r\n return TextMessageFormat.write(JSON.stringify(message));\r\n }\r\n\r\n private _isInvocationMessage(message: InvocationMessage): void {\r\n this._assertNotEmptyString(message.target, \"Invalid payload for Invocation message.\");\r\n\r\n if (message.invocationId !== undefined) {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Invocation message.\");\r\n }\r\n }\r\n\r\n private _isStreamItemMessage(message: StreamItemMessage): void {\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for StreamItem message.\");\r\n\r\n if (message.item === undefined) {\r\n throw new Error(\"Invalid payload for StreamItem message.\");\r\n }\r\n }\r\n\r\n private _isCompletionMessage(message: CompletionMessage): void {\r\n if (message.result && message.error) {\r\n throw new Error(\"Invalid payload for Completion message.\");\r\n }\r\n\r\n if (!message.result && message.error) {\r\n this._assertNotEmptyString(message.error, \"Invalid payload for Completion message.\");\r\n }\r\n\r\n this._assertNotEmptyString(message.invocationId, \"Invalid payload for Completion message.\");\r\n }\r\n\r\n private _isAckMessage(message: AckMessage): void {\r\n if (typeof message.sequenceId !== 'number') {\r\n throw new Error(\"Invalid SequenceId for Ack message.\");\r\n }\r\n }\r\n\r\n private _isSequenceMessage(message: SequenceMessage): void {\r\n if (typeof message.sequenceId !== 'number') {\r\n throw new Error(\"Invalid SequenceId for Sequence message.\");\r\n }\r\n }\r\n\r\n private _assertNotEmptyString(value: any, errorMessage: string): void {\r\n if (typeof value !== \"string\" || value === \"\") {\r\n throw new Error(errorMessage);\r\n }\r\n }\r\n}\r\n", "// Licensed to the .NET Foundation under one or more agreements.\r\n// The .NET Foundation licenses this file to you under the MIT license.\r\n\r\nimport { DefaultReconnectPolicy } from \"./DefaultReconnectPolicy\";\r\nimport { HttpConnection } from \"./HttpConnection\";\r\nimport { HubConnection } from \"./HubConnection\";\r\nimport { IHttpConnectionOptions } from \"./IHttpConnectionOptions\";\r\nimport { IHubProtocol } from \"./IHubProtocol\";\r\nimport { ILogger, LogLevel } from \"./ILogger\";\r\nimport { IRetryPolicy } from \"./IRetryPolicy\";\r\nimport { IStatefulReconnectOptions } from \"./IStatefulReconnectOptions\";\r\nimport { HttpTransportType } from \"./ITransport\";\r\nimport { JsonHubProtocol } from \"./JsonHubProtocol\";\r\nimport { NullLogger } from \"./Loggers\";\r\nimport { Arg, ConsoleLogger } from \"./Utils\";\r\n\r\nconst LogLevelNameMapping: {[k: string]: LogLevel} = {\r\n trace: LogLevel.Trace,\r\n debug: LogLevel.Debug,\r\n info: LogLevel.Information,\r\n information: LogLevel.Information,\r\n warn: LogLevel.Warning,\r\n warning: LogLevel.Warning,\r\n error: LogLevel.Error,\r\n critical: LogLevel.Critical,\r\n none: LogLevel.None,\r\n};\r\n\r\nfunction parseLogLevel(name: string): LogLevel {\r\n // Case-insensitive matching via lower-casing\r\n // Yes, I know case-folding is a complicated problem in Unicode, but we only support\r\n // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.\r\n const mapping = LogLevelNameMapping[name.toLowerCase()];\r\n if (typeof mapping !== \"undefined\") {\r\n return mapping;\r\n } else {\r\n throw new Error(`Unknown log level: ${name}`);\r\n }\r\n}\r\n\r\n/** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */\r\nexport class HubConnectionBuilder {\r\n private _serverTimeoutInMilliseconds?: number;\r\n private _keepAliveIntervalInMilliseconds ?: number;\r\n\r\n /** @internal */\r\n public protocol?: IHubProtocol;\r\n /** @internal */\r\n public httpConnectionOptions?: IHttpConnectionOptions;\r\n /** @internal */\r\n public url?: string;\r\n /** @internal */\r\n public logger?: ILogger;\r\n\r\n /** If defined, this indicates the client should automatically attempt to reconnect if the connection is lost. */\r\n /** @internal */\r\n public reconnectPolicy?: IRetryPolicy;\r\n\r\n private _statefulReconnectBufferSize?: number;\r\n\r\n /** Configures console logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {LogLevel} logLevel The minimum level of messages to log. Anything at this level, or a more severe level, will be logged.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logLevel: LogLevel): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {ILogger} logger An object implementing the {@link @microsoft/signalr.ILogger} interface, which will be used to write all log messages.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logger: ILogger): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {string} logLevel A string representing a LogLevel setting a minimum level of messages to log.\r\n * See {@link https://learn.microsoft.com/aspnet/core/signalr/configuration#configure-logging|the documentation for client logging configuration} for more details.\r\n */\r\n public configureLogging(logLevel: string): HubConnectionBuilder;\r\n\r\n /** Configures custom logging for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @param {LogLevel | string | ILogger} logging A {@link @microsoft/signalr.LogLevel}, a string representing a LogLevel, or an object implementing the {@link @microsoft/signalr.ILogger} interface.\r\n * See {@link https://learn.microsoft.com/aspnet/core/signalr/configuration#configure-logging|the documentation for client logging configuration} for more details.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public configureLogging(logging: LogLevel | string | ILogger): HubConnectionBuilder;\r\n public configureLogging(logging: LogLevel | string | ILogger): HubConnectionBuilder {\r\n Arg.isRequired(logging, \"logging\");\r\n\r\n if (isLogger(logging)) {\r\n this.logger = logging;\r\n } else if (typeof logging === \"string\") {\r\n const logLevel = parseLogLevel(logging);\r\n this.logger = new ConsoleLogger(logLevel);\r\n } else {\r\n this.logger = new ConsoleLogger(logging);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use HTTP-based transports to connect to the specified URL.\r\n *\r\n * The transport will be selected automatically based on what the server and client support.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified HTTP-based transport to connect to the specified URL.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @param {HttpTransportType} transportType The specific transport to use.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string, transportType: HttpTransportType): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use HTTP-based transports to connect to the specified URL.\r\n *\r\n * @param {string} url The URL the connection will use.\r\n * @param {IHttpConnectionOptions} options An options object used to configure the connection.\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withUrl(url: string, options: IHttpConnectionOptions): HubConnectionBuilder;\r\n public withUrl(url: string, transportTypeOrOptions?: IHttpConnectionOptions | HttpTransportType): HubConnectionBuilder {\r\n Arg.isRequired(url, \"url\");\r\n Arg.isNotEmpty(url, \"url\");\r\n\r\n this.url = url;\r\n\r\n // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed\r\n // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.\r\n if (typeof transportTypeOrOptions === \"object\") {\r\n this.httpConnectionOptions = { ...this.httpConnectionOptions, ...transportTypeOrOptions };\r\n } else {\r\n this.httpConnectionOptions = {\r\n ...this.httpConnectionOptions,\r\n transport: transportTypeOrOptions,\r\n };\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.\r\n *\r\n * @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.\r\n */\r\n public withHubProtocol(protocol: IHubProtocol): HubConnectionBuilder {\r\n Arg.isRequired(protocol, \"protocol\");\r\n\r\n this.protocol = protocol;\r\n return this;\r\n }\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n * By default, the client will wait 0, 2, 10 and 30 seconds respectively before trying up to 4 reconnect attempts.\r\n */\r\n public withAutomaticReconnect(): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n *\r\n * @param {number[]} retryDelays An array containing the delays in milliseconds before trying each reconnect attempt.\r\n * The length of the array represents how many failed reconnect attempts it takes before the client will stop attempting to reconnect.\r\n */\r\n public withAutomaticReconnect(retryDelays: number[]): HubConnectionBuilder;\r\n\r\n /** Configures the {@link @microsoft/signalr.HubConnection} to automatically attempt to reconnect if the connection is lost.\r\n *\r\n * @param {IRetryPolicy} reconnectPolicy An {@link @microsoft/signalR.IRetryPolicy} that controls the timing and number of reconnect attempts.\r\n */\r\n public withAutomaticReconnect(reconnectPolicy: IRetryPolicy): HubConnectionBuilder;\r\n public withAutomaticReconnect(retryDelaysOrReconnectPolicy?: number[] | IRetryPolicy): HubConnectionBuilder {\r\n if (this.reconnectPolicy) {\r\n throw new Error(\"A reconnectPolicy has already been set.\");\r\n }\r\n\r\n if (!retryDelaysOrReconnectPolicy) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy();\r\n } else if (Array.isArray(retryDelaysOrReconnectPolicy)) {\r\n this.reconnectPolicy = new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);\r\n } else {\r\n this.reconnectPolicy = retryDelaysOrReconnectPolicy;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n /** Configures {@link @microsoft/signalr.HubConnection.serverTimeoutInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withServerTimeout(milliseconds: number): HubConnectionBuilder {\r\n Arg.isRequired(milliseconds, \"milliseconds\");\r\n\r\n this._serverTimeoutInMilliseconds = milliseconds;\r\n\r\n return this;\r\n }\r\n\r\n /** Configures {@link @microsoft/signalr.HubConnection.keepAliveIntervalInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withKeepAliveInterval(milliseconds: number): HubConnectionBuilder {\r\n Arg.isRequired(milliseconds, \"milliseconds\");\r\n\r\n this._keepAliveIntervalInMilliseconds = milliseconds;\r\n\r\n return this;\r\n }\r\n\r\n /** Enables and configures options for the Stateful Reconnect feature.\r\n *\r\n * @returns The {@link @microsoft/signalr.HubConnectionBuilder} instance, for chaining.\r\n */\r\n public withStatefulReconnect(options?: IStatefulReconnectOptions): HubConnectionBuilder {\r\n if (this.httpConnectionOptions === undefined) {\r\n this.httpConnectionOptions = {};\r\n }\r\n this.httpConnectionOptions._useStatefulReconnect = true;\r\n\r\n this._statefulReconnectBufferSize = options?.bufferSize;\r\n\r\n return this;\r\n }\r\n\r\n /** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.\r\n *\r\n * @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.\r\n */\r\n public build(): HubConnection {\r\n // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one\r\n // provided to configureLogger\r\n const httpConnectionOptions = this.httpConnectionOptions || {};\r\n\r\n // If it's 'null', the user **explicitly** asked for null, don't mess with it.\r\n if (httpConnectionOptions.logger === undefined) {\r\n // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.\r\n httpConnectionOptions.logger = this.logger;\r\n }\r\n\r\n // Now create the connection\r\n if (!this.url) {\r\n throw new Error(\"The 'HubConnectionBuilder.withUrl' method must be called before building the connection.\");\r\n }\r\n const connection = new HttpConnection(this.url, httpConnectionOptions);\r\n\r\n return HubConnection.create(\r\n connection,\r\n this.logger || NullLogger.instance,\r\n this.protocol || new JsonHubProtocol(),\r\n this.reconnectPolicy,\r\n this._serverTimeoutInMilliseconds,\r\n this._keepAliveIntervalInMilliseconds,\r\n this._statefulReconnectBufferSize);\r\n }\r\n}\r\n\r\nfunction isLogger(logger: any): logger is ILogger {\r\n return logger.log !== undefined;\r\n}\r\n", "import * as $ from 'jquery';\r\nimport * as signalR from '@microsoft/signalr';\r\n\r\ninterface JsonData {\r\n axMessage: string;\r\n deviceName: string;\r\n posGuestId: string;\r\n posWaiverId: string;\r\n result: any;\r\n serial: number;\r\n timestamp: any;\r\n unicode: number;\r\n}\r\n\r\ninterface ResponseData {\r\n ShouldSendNotification: boolean;\r\n}\r\n\r\nexport class OneRiskNotification {\r\n private notificationHub: signalR.HubConnection;\r\n\r\n constructor() {\r\n this.notificationHub = new signalR.HubConnectionBuilder()\r\n .withUrl(\"/notificationHub\")\r\n .build();\r\n }\r\n\r\n public initialize() {\r\n this.notificationHub.on(\"notifyClients\", this.onNotifyClients);\r\n\r\n this.notificationHub.start().then(() => {\r\n console.log(\"SignalR connection established.\");\r\n }).catch(err => console.error(\"SignalR connection error: \", err.toString()));\r\n }\r\n\r\n private onNotifyClients(message: string) {\r\n console.log(\"Received notification:\", message);\r\n }\r\n\r\n public sendNotification(message: string) {\r\n this.notificationHub.invoke(\"notify\", message)\r\n .catch(err => console.error(\"Notification send error: \", err.toString()));\r\n }\r\n\r\n public triggerNotification() {\r\n const jsonData: JsonData = {\r\n axMessage: \"acceptLiability\",\r\n deviceName: \"945-1\",\r\n posGuestId: \"04100080000000514\",\r\n posWaiverId: \"04100053000008841\",\r\n result: null,\r\n serial: 11372,\r\n timestamp: null,\r\n unicode: 1\r\n };\r\n\r\n this.sendNotification(\"Initial check for notifications.\");\r\n }\r\n}\r\n\r\n", "import Swal from \"sweetalert2\";\r\nimport tippy from 'tippy.js';\r\nimport { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { AxLoading } from \"../../Limestone/AxLoading/AxLoading\";\r\nimport { ProgressBar } from \"../Global/Progressbar\";\r\n\r\n@ModuleName(\"OneRisk\")\r\nexport class OneRisk implements AxInit {\r\n constructor(\r\n protected _Progressbar = new ProgressBar(),\r\n private _I18nHelper = new I18nHelper(),\r\n private _AxLoading = new AxLoading(),\r\n ) { }\r\n\r\n private init: OneRiskInit;\r\n private tippyInstanceInfo: any = [];\r\n private spinner: HTMLElement = $('<div>').get(0);\r\n private submitButtonOnclick: string = $('.input-consent-doc-submit-button').attr('onclick');\r\n\r\n AxInit(init: OneRiskInit): void {\r\n this.init = init;\r\n const haveOneRiskWaiver = $('[data-one-risk-completed]').length > 0;\r\n if (this.init.waiverIsEnabled && haveOneRiskWaiver && (this.init.oneRISKProcessRequired || this.init.waiverCompeling)) {\r\n $('.input-consent-doc-submit-button').attr('onclick', 'false');\r\n }\r\n this.checkIfWaiverIsEnabled();\r\n\r\n $('[data-waiver-email-sent]').on('click', (e) => {\r\n e.preventDefault();\r\n const $forwardEmail: JQuery<HTMLElement> = $(e.currentTarget);\r\n $forwardEmail.addClass('d-none');\r\n $forwardEmail.next().removeClass('d-none').find('input').trigger('focus').get(0).setSelectionRange(-1, -1);\r\n });\r\n\r\n $('[data-send-waiver]').on('click', (e) => {\r\n const $email: JQuery<HTMLElement> = $(e.target).siblings('input');\r\n const waiverEmail: string = $email.val().toString().trim() || '';\r\n const regex = RegExp(/^\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b$/, 'i');\r\n $email.attr('placeholder', '');\r\n if (waiverEmail.length && regex.test(waiverEmail)) {\r\n const cartEntryID: number = $(e.target).data('send-waiver');\r\n const waiverURL: string = $(e.target).closest('.cartentry-tickets-waiver-buttons ').find('[data-one-risk-completed]').attr('href');\r\n this._AxLoading.ShowLoadingIndicator(this.spinner);\r\n $email.parent().append(this.spinner);\r\n const transNr: number = this.init.transactionNumber;\r\n AxessViewer.loadPartialView(\"/AxessWaiver/SendWaiverEmail\", {\r\n cartEntryID,\r\n waiverURL,\r\n waiverEmail,\r\n transNr,\r\n }, ({ isWaiverSent }) => {\r\n if (isWaiverSent) {\r\n this._AxLoading.HideLoadingIndicator(this.spinner);\r\n $email\r\n .parent()\r\n .addClass('d-none')\r\n .prev('a')\r\n .removeClass('d-none ax-btn-secondary--danger')\r\n .addClass('ax-btn-secondary--success')\r\n .attr('data-waiver-email-sent', 'true')\r\n .data('waiver-email-sent', 'true');\r\n this.handleWaiverRequired();\r\n }\r\n });\r\n } else {\r\n $email.attr('placeholder', this._I18nHelper.GetTranslation(Translations.ValidationMail)).val('');\r\n }\r\n });\r\n\r\n $('[name=waiverEmail]').on('keyup', (e) => {\r\n if (e.key === 'Escape') {\r\n const $button: JQuery<HTMLElement> = $(e.target).parent().prev('a');\r\n $(e.target)\r\n .parent()\r\n .addClass('d-none');\r\n $button\r\n .removeClass(`d-none ${$button.data('data-waiver-email-sent') === 'sent' ? 'ax-btn-secondary--danger' : ''}`)\r\n .addClass($button.data('data-waiver-email-sent') === 'sent' ? 'ax-btn-secondary--success' : '');\r\n }\r\n if (e.key === 'Enter') {\r\n $('[data-send-waiver]').trigger('click');\r\n }\r\n }).on('blur', (e: any) => {\r\n const sendWaiver$: JQuery<HTMLElement> = $(e.relatedTarget);\r\n if (typeof sendWaiver$.attr('data-send-waiver') !== 'undefined') {\r\n $(e.relatedTarget).trigger('click');\r\n } else {\r\n const $this: JQuery<HTMLElement> = $(e.target);\r\n $this.parent().addClass('d-none');\r\n $this.parent().prev().removeClass('d-none');\r\n }\r\n });\r\n\r\n $('.btn_payment__overview').on('click', () => {\r\n this.checkIfWaiverIsEnabled();\r\n });\r\n\r\n $('[data-one-risk-entryid]').each((_, e) => {\r\n const tripple: string = $(e).data('waiver-for-entry');\r\n const serienNr: string = $(e).data('serial-for-entry');\r\n const cartEntryId: string = $(e).data('one-risk-entryid');\r\n const verifyWaiverStatus = setInterval(() => {\r\n const queryString = `personTriple=${tripple}&SerieNr=${serienNr}`;\r\n AxessViewer.loadPartialView('/OneRisk/CheckIfOneRiskProcessCompleted', queryString, ({ signingOffIsDone }: { signingOffIsDone: boolean }) => {\r\n if (signingOffIsDone) {\r\n const $message = $('<span>', {\r\n class: 'waiver__tripple d-flex ax-btn ax-btn-primary ax-btn-primary--success ax-btn-icon ax-btn-icon--after ax-btn-sm',\r\n 'data-waiver-for-entry': tripple,\r\n 'data-serial-for-entry': serienNr,\r\n 'data-one-risk-completed': true,\r\n }).append(\r\n this._I18nHelper.GetTranslation(Translations.WaiverIsCompleted),\r\n $('<i>', { class: 'la la-check-circle' }),\r\n );\r\n $(`#waiver__area_${cartEntryId}`).html($message.prop('outerHTML')).next().remove();\r\n clearInterval(verifyWaiverStatus);\r\n this.enablePaymentOverviewButton();\r\n }\r\n });\r\n }, 2000);\r\n });\r\n }\r\n\r\n checkIfWaiverIsEnabled() {\r\n if (this.init.waiverIsEnabled) {\r\n this.handleWaiverRequired();\r\n } else {\r\n this.enablePaymentOverviewButton();\r\n }\r\n }\r\n\r\n handleWaiverRequired() {\r\n if (this.init.oneRISKProcessRequired || this.init.waiverCompeling) {\r\n this.checkAllOneRiskProcessesCompleted();\r\n } else {\r\n this.enablePaymentOverviewButton();\r\n this.handleOneRiskNotRequired();\r\n }\r\n }\r\n\r\n handleOneRiskNotRequired() {\r\n $('.input-consent-doc-submit-button').one('click', (e) => {\r\n e.preventDefault();\r\n Swal.fire({\r\n title: this._I18nHelper.GetTranslation(Translations.Warning),\r\n html: this._I18nHelper.GetTranslation(Translations.WaiverModal),\r\n icon: 'warning',\r\n showCancelButton: true,\r\n customClass: {\r\n cancelButton: 'btn btn-secondary',\r\n confirmButton: 'btn btn-primary',\r\n },\r\n confirmButtonText: this._I18nHelper.GetTranslation(Translations.Ok),\r\n cancelButtonText: this._I18nHelper.GetTranslation(Translations.Cancel),\r\n }).then((result) => {\r\n if (result.isConfirmed) {\r\n this.enablePaymentOverviewButton();\r\n }\r\n });\r\n });\r\n }\r\n\r\n checkAllOneRiskProcessesCompleted() {\r\n const $oneRiskCompleted = this.init.waiverCompeling ? $('[data-waiver-email-sent]') : $('[data-one-risk-completed]');\r\n const allWaiverCompleted = $oneRiskCompleted.toArray().every((e) => $(e).data('one-risk-completed'));\r\n const allWaiverForwarded = $oneRiskCompleted.toArray().every((e) => $(e).data('waiver-email-sent'));\r\n const allTrue = allWaiverCompleted || allWaiverForwarded;\r\n\r\n if (allTrue) {\r\n this.enablePaymentOverviewButton();\r\n } else {\r\n this.disablePaymentOverviewButtonWithTooltip();\r\n }\r\n }\r\n\r\n disablePaymentOverviewButtonWithTooltip() {\r\n const self = this;\r\n const isOneRiskReq = this.init.oneRISKProcessRequired;\r\n const isCompeling = this.init.waiverCompeling;\r\n const $consentDocButton = $('[data-consent-doc-submit-button]');\r\n\r\n if ((isOneRiskReq || isCompeling) && $consentDocButton.length > 0 && this.tippyInstanceInfo.length === 0) {\r\n const tooltipText = isCompeling\r\n ? this._I18nHelper.GetTranslation(Translations.OneRISKProcessIsRequiredBeforeProceed)\r\n : this._I18nHelper.GetTranslation(Translations.OneRISKProcessIsRequiredBeforeProceed);\r\n const selector = isCompeling\r\n ? document.querySelectorAll('[data-waiver-email-sent]')\r\n : document.querySelectorAll('.waiver__inactive');\r\n this.tippyInstanceInfo = tippy(selector, {\r\n content: tooltipText,\r\n placement: 'right',\r\n theme: 'light-border',\r\n interactive: true,\r\n trigger: 'manual',\r\n });\r\n }\r\n if ((isOneRiskReq || isCompeling) && $consentDocButton.length > 0) {\r\n $consentDocButton.prop('disabled', true);\r\n $consentDocButton\r\n .on('mouseenter', () => {\r\n this.checkAllOneRiskProcessesCompleted();\r\n this.tippyInstanceInfo.forEach((e, i) => {\r\n const serialForEntry = $(e.reference).data('serial-for-entry');\r\n if (\r\n $(`a[data-serial-for-entry=${serialForEntry}]`).data('one-risk-completed') === false\r\n || $(`a[data-serial-for-entry=${serialForEntry}]`).data('waiver-email-sent') === false\r\n ) {\r\n e.show();\r\n } else {\r\n e.destroy();\r\n self.tippyInstanceInfo.splice(i, 1);\r\n }\r\n });\r\n })\r\n .on('mouseleave', () => {\r\n this.tippyInstanceInfo.forEach((e) => {\r\n e.hide();\r\n });\r\n });\r\n }\r\n }\r\n\r\n enablePaymentOverviewButton() {\r\n if (this.tippyInstanceInfo.length > 0) {\r\n this.tippyInstanceInfo = [];\r\n }\r\n $('[data-consent-doc-submit-button]').prop('disabled', false).off();\r\n $('.input-consent-doc-submit-button').attr('onclick', this.submitButtonOnclick);\r\n }\r\n}\r\nclass OneRiskInit {\r\n oneRISKProcessRequired?: boolean;\r\n waiverIsEnabled?: boolean;\r\n waiverCompeling: boolean;\r\n transactionNumber?: number;\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { CustomerLessonProperties, CustomerLessonPropertiesInit } from \"../Account/CustomerLessonProperties\";\r\n\r\nexport interface LessonBuyerInfoInit {\r\n lessonPropsHolderIs: string[];\r\n lessonParticipantsAmount: number;\r\n}\r\n\r\nclass initCustomerProps implements CustomerLessonPropertiesInit {\r\n parentId: string;\r\n formElementPrefix: string;\r\n\r\n constructor(parentId: string, formElementPrefix: string) {\r\n this.parentId = parentId;\r\n this.formElementPrefix = formElementPrefix;\r\n }\r\n}\r\n\r\n@ModuleName(\"LessonBuyerInfoModule\")\r\nexport class LessonBuyerInfoModule implements AxInit {\r\n\r\n private _lessonPropsHolderIs: string[];\r\n private _customerLessonProps: CustomerLessonProperties[] = [];\r\n\r\n AxInit(lessonBuyerInfoInit: LessonBuyerInfoInit): void {\r\n this._lessonPropsHolderIs = lessonBuyerInfoInit.lessonPropsHolderIs;\r\n\r\n console.log(lessonBuyerInfoInit.lessonPropsHolderIs);\r\n\r\n for (let i = 0; i < this._lessonPropsHolderIs.length; i++) {\r\n\r\n let id = this._lessonPropsHolderIs[i];\r\n this.initCustomerPropsDropDowns(id);\r\n\r\n //this._customerLessonProps.push(customerLessonProps);\r\n }\r\n }\r\n\r\n initCustomerPropsDropDowns(id: string) {\r\n let customerLessonProps = new CustomerLessonProperties();\r\n customerLessonProps.AxInit(new initCustomerProps(\"#lessonProps_\" + id, `ParticipantInfos[${id}].`));\r\n }\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\n\r\n@ModuleName(\"ConsentDocuments\")\r\nexport class ConsentDocuments implements AxInit {\r\n checkBoxInfos: ICheckboxInfo[] = [];\r\n consentNeeded: boolean = false;\r\n\r\n AxInit(init): void {\r\n $('.input-consent-doc-checkbox').change(() => {\r\n this.evaluateConentDocCheckBoxes();\r\n });\r\n }\r\n\r\n evaluateConentDocCheckBoxes() {\r\n this.checkBoxInfos = [];\r\n\r\n $(\".input-consent-doc-submit-button\").prop('disabled', false);\r\n $('.input-consent-doc-checkbox').each((index, element) => {\r\n this.consentNeeded = true;\r\n let consentDoc = {\r\n documentId: $(element).attr('id'),\r\n isChecked: false\r\n }\r\n if ($(element).hasClass('input-consent-doc-checkbox-mandatory') && !$(element).is(':checked')) {\r\n $(\".input-consent-doc-submit-button\").prop('disabled', true);\r\n }\r\n\r\n if ($(element).is(':checked')) {\r\n consentDoc.isChecked = true;\r\n } else {\r\n consentDoc.isChecked = false;\r\n }\r\n\r\n this.checkBoxInfos.push(consentDoc);\r\n });\r\n }\r\n\r\n getActiveCheckboxes(): ICheckboxInfo[] {\r\n return this.checkBoxInfos;\r\n }\r\n\r\n getConsentNeeded(): boolean {\r\n return this.consentNeeded;\r\n }\r\n}\r\n\r\nexport interface ICheckboxInfo {\r\n documentId: string;\r\n isChecked: boolean;\r\n}", "import { AxCounter } from \"../../../Limestone/AxCounter/AxCounter\";\r\nimport { Instance, Props } from \"tippy.js\";\r\nimport * as Popper from '@popperjs/core';\r\nimport tippy from 'tippy.js';\r\nimport { LandingQuickSelection, QuickSelectionQuantityCounter } from '../LandingQuickSelection';\r\nimport { AxLoading } from \"../../../Limestone/AxLoading/AxLoading\";\r\nimport { PriceHelper } from \"../../../Lib/Helper/PriceHelper\";\r\nimport { I18nHelper, Translations } from \"../../../Lib/Helper/I18nHelper\";\r\n\r\nexport class QuantitySelection {\r\n public quantitySelectionTippy: Instance<Props>;\r\n private _mainModule: LandingQuickSelection;\r\n\r\n constructor(private _i18nHelper = new I18nHelper(),\r\n private _axLoading = new AxLoading(),\r\n private _priceHelper = new PriceHelper(null, false)) {\r\n\r\n }\r\n\r\n init(mainModule: LandingQuickSelection) {\r\n this._mainModule = mainModule;\r\n this.quantitySelectionTippy = tippy(document.querySelector('.ax-store-hero_title_and_searchBarHolder .searchbar-wrapper'), {\r\n allowHTML: true,\r\n interactive: true,\r\n content: document.querySelector('[data-tv4-quickselection--dropdown-quantity=\"popup\"]'),\r\n placement: 'bottom-end',\r\n arrow: false,\r\n trigger: 'manual',\r\n maxWidth: 'none',\r\n appendTo: () => document.body,\r\n onShow({ popper, reference }) {\r\n const width =\r\n ($('.ax-store-hero_title_and_searchBarHolder .searchbar-wrapper')[0].getBoundingClientRect().width /\r\n 100 *\r\n 60) +\r\n \"px\";\r\n popper.style.width = width;\r\n }\r\n });\r\n\r\n $('[data-tv4-quickselection--dropdown=\"quantity\"]').on('click',\r\n (x) => {\r\n if (typeof $(x.delegateTarget).attr('disabled') == 'undefined') {\r\n this.quantitySelectionTippy.show();\r\n }\r\n });\r\n }\r\n\r\n getQuantitySelection(date: moment.Moment) {\r\n this._mainModule.prodDropdown.getElements().attr('disabled', null);\r\n this._mainModule.dateDropdown.getElements().attr('disabled', null);\r\n this._mainModule.quantityDropdown.getElements().attr('disabled', null);\r\n\r\n $('[data-tv4-quickselection--dropdown=\"quantity\"] .ax-dropdown__icon').removeClass('la-user')\r\n .addClass('la-circle-notch la-spin ax-p-0 ax-mt-1-n ax-ml-1');\r\n\r\n const $popperProdPopper = this._mainModule.getPopper(this._mainModule.prodDropdown);\r\n const $selectedOption = $($popperProdPopper.find('.ax-dropdown__item.selected'));\r\n\r\n this._axLoading.ShowLoadingIndicator($('[data-tv4-quickselection=\"overlay\"]')[0]);\r\n $('[data-tv4-quickselection--overlay=\"quantity\"]').html('');\r\n\r\n let openOnLoad = this._mainModule.initComplete;\r\n\r\n AxessViewer.loadPartialView(\r\n `${$selectedOption.attr('data-link')}?date=${date.format('YYYY-MM-DD')}`, {},\r\n resp => {\r\n\r\n this._mainModule.counter = [];\r\n\r\n const div = document.createElement('div');\r\n div.innerHTML = resp.trim();\r\n const $resp = $(div);\r\n const isSingleSelection = $resp.find('[data-display=\"single\"]').length > 0;\r\n const desktopContent = $resp.find('[data-target=\"desktop\"]')[0].cloneNode(true);\r\n const $desktopCounter = $(desktopContent).find('[data-tv4-quickselection--dropdown-quantity=\"counter\"]');\r\n\r\n if (isSingleSelection) {\r\n //@ts-ignore\r\n $('[data-tv4-quickselection--dropdown=\"quantity-single\"]').html(desktopContent);\r\n $(`[data-tv4-quickselection--dropdown=\"quantity\"]`).addClass('d-none');\r\n } else {\r\n $('[data-tv4-quickselection--dropdown=\"quantity-single\"]').html('');\r\n $(`[data-tv4-quickselection--dropdown=\"quantity\"]`).removeClass('d-none');\r\n //@ts-ignore\r\n $(this.quantitySelectionTippy.popper).find('[data-tv4-quickselection--dropdown-quantity=\"popup\"]').html(desktopContent);\r\n }\r\n\r\n //@ts-ignore\r\n $('[data-tv4-quickselection--overlay=\"quantity\"]').html($resp.find('[data-target=\"mobile\"]')[0].cloneNode(true));\r\n\r\n\r\n $('[data-tv4-quickselection--dropdown=\"quantity\"] .ax-dropdown__icon').removeClass('la-circle-notch la-spin ax-p-0 ax-mt-1-n ax-ml-1')\r\n .addClass('la-user');\r\n\r\n for (let elem of $desktopCounter) {\r\n this.initCounter(elem, 'desktop');\r\n }\r\n for (let elem of $('[data-tv4-quickselection--overlay=\"quantity\"]').find('[data-tv4-quickselection--dropdown-quantity=\"counter\"]')) {\r\n this.initCounter(elem, 'mobile');\r\n }\r\n\r\n const desktopFilter = this._mainModule.counter.filter(x => x.mode === 'desktop');\r\n if (desktopFilter.length === 1 && !openOnLoad && desktopFilter[0].counter.GetValue() == 0) {\r\n desktopFilter[0].counter.IncreaseQuantity();\r\n }\r\n\r\n this._mainModule.mobileInterface.renderSubmitButtonText();\r\n\r\n if (openOnLoad && !isSingleSelection) {\r\n this.quantitySelectionTippy.show();\r\n }\r\n this._axLoading.HideLoadingIndicator($('[data-tv4-quickselection=\"overlay\"]')[0]);\r\n },\r\n {\r\n responseIsHTML: true,\r\n addCulturInfo: false\r\n });\r\n }\r\n\r\n adjustPrice(subTypeIdentifier: number, quantity: number) {\r\n let $priceElements = $(`[data-subtypeidentifier--copy=\"${subTypeIdentifier}\"] [data-price]:checked`);\r\n\r\n let total = parseInt($(`[data-subtypeidentifier=\"${subTypeIdentifier}\"] [data-base-price]`).attr('data-base-price')) * quantity;\r\n\r\n for (let priceElem of $priceElements) {\r\n total += parseInt($(priceElem).attr('data-price'));\r\n }\r\n let $sumElem = $(`[data-subtypeidentifier=\"${subTypeIdentifier}\"] [data-calculated-price]`);\r\n $sumElem.html(this._priceHelper.GetPriceString(total / 100));\r\n }\r\n\r\n renderQuantityLines(subTypeIdentifier: number, quantity: number) {\r\n this.desktopQuantityLines(subTypeIdentifier, quantity);\r\n this.mobileQuantityLines(subTypeIdentifier, quantity);\r\n\r\n let totalSum = 0;\r\n for (let c of this._mainModule.counter.filter(x => x.mode === 'desktop')) totalSum += c.counter.GetValue();\r\n if (totalSum > 0) {\r\n this._mainModule.quantityDropdown.setValue(this._i18nHelper.GetTranslation(Translations.TicketsX,\r\n totalSum));\r\n } else {\r\n this._mainModule.quantityDropdown.setValue(this._i18nHelper.GetTranslation(Translations.QuantityTicket));\r\n\r\n }\r\n }\r\n\r\n mobileQuantityLines(subTypeIdentifier: number, quantity: number) {\r\n let elementsToCopy: HTMLElement[] = [];\r\n let $popper = $('[data-tv4-quickselection--overlay=\"quantity\"]');\r\n\r\n $popper.find(`[data-subtypeidentifier--copy=${subTypeIdentifier}]`)\r\n .remove();\r\n\r\n for (let elem of $popper.find(`[data-tv4-quickselection--dropdown-quantity=\"article\"][data-subtypeidentifier=${subTypeIdentifier}]`)) {\r\n elementsToCopy.push(elem);\r\n }\r\n\r\n let lastSelectionElement = $popper.find(`[data-tv4-quickselection--dropdown-quantity=\"article\"][data-subtypeidentifier=${subTypeIdentifier}]`).not('[data-subtypeidentifier--copy]').last();\r\n elementsToCopy.reverse();\r\n\r\n for (let i = 0; i < quantity; i++) {\r\n let separator = document.createElement('div');\r\n separator.style.borderBottom = \"1px solid #C7C7C7\";\r\n separator.style.gridColumn = \"1/5\";\r\n separator.classList.add('ax-mx-2-n');\r\n separator.setAttribute('data-subtypeidentifier--copy', subTypeIdentifier.toString());\r\n\r\n for (let elem of elementsToCopy) {\r\n let $elemC = $(elem.cloneNode(true));\r\n $elemC.find('[data-tv4-quickselection--dropdown-quantity=\"article-index\"]').html(`${quantity - i}.`);\r\n $elemC.removeClass('d-none');\r\n $elemC.attr('data-subtypeidentifier--copy', subTypeIdentifier);\r\n $elemC.attr('data-subtypeidentifier', null);\r\n\r\n $elemC.find('input[type=checkbox]').on('change',\r\n () => {\r\n this.adjustPrice(subTypeIdentifier, quantity);\r\n });\r\n\r\n //@ts-ignore\r\n $(lastSelectionElement).after($elemC);\r\n }\r\n $(lastSelectionElement).after(separator);\r\n }\r\n }\r\n\r\n desktopQuantityLines(subTypeIdentifier: number, quantity: number) {\r\n let elementsToCopy: HTMLElement[] = [];\r\n let $popper = $(this.quantitySelectionTippy.popper);\r\n\r\n $popper.find(`[data-tv4-quickselection--dropdown-quantity=\"popup\"] [data-subtypeidentifier--copy=${subTypeIdentifier}]`)\r\n .remove();\r\n\r\n if (quantity - 1 < 1) return;\r\n\r\n if ($(`[data-tv4-quickselection--dropdown-quantity=\"popup\"] [data-subtypeidentifier=${subTypeIdentifier}][data-tv4-quickselection--dropdown-quantity=\"article\"]`).length === 0) return;\r\n\r\n for (let elem of $popper.find(`[data-tv4-quickselection--dropdown-quantity=\"popup\"] [data-subtypeidentifier=${subTypeIdentifier}]`)) {\r\n elementsToCopy.push(elem);\r\n }\r\n elementsToCopy[elementsToCopy.length - 1] = document.createElement('div');\r\n\r\n let lastSelectionElement = $popper.find(`[data-tv4-quickselection--dropdown-quantity=\"popup\"] [data-subtypeidentifier=${subTypeIdentifier}]`).last();\r\n elementsToCopy.reverse();\r\n\r\n for (let i = 0; i < quantity - 1; i++) {\r\n let separator = document.createElement('div');\r\n separator.style.borderBottom = \"1px dashed #C7C7C7\";\r\n separator.style.gridColumn = \"1/5\";\r\n separator.classList.add('ax-mx-2-n');\r\n separator.setAttribute('data-subtypeidentifier--copy', subTypeIdentifier.toString());\r\n\r\n for (let elem of elementsToCopy) {\r\n let $elemC = $(elem.cloneNode(true));\r\n $elemC.attr('data-subtypeidentifier--copy', subTypeIdentifier);\r\n $elemC.attr('data-subtypeidentifier', null);\r\n //@ts-ignore\r\n $(lastSelectionElement).parent().after($elemC);\r\n }\r\n $(lastSelectionElement).parent().after(separator);\r\n }\r\n }\r\n\r\n initCounter(elem: HTMLElement, mode: \"desktop\" | \"mobile\") {\r\n let $elem = $(elem);\r\n const quantity = parseInt($elem.find('[data-quantity-selection]').html());\r\n\r\n let axCounter = new AxCounter();\r\n axCounter.Init({\r\n Value: quantity,\r\n Selector: elem,\r\n Max: parseInt($elem.attr('data-max') ?? \"10\"),\r\n Min: parseInt($elem.attr('data-min') ?? \"0\"),\r\n });\r\n axCounter.Subscribe(x => {\r\n const subTypeIdentifier = parseInt($(elem).attr('data-subtypeidentifier'));\r\n this.renderQuantityLines(subTypeIdentifier, x);\r\n this.adjustPrice(subTypeIdentifier, x);\r\n this._mainModule.mobileInterface.renderSubmitButtonText();\r\n });\r\n\r\n this.renderQuantityLines(parseInt($(elem).attr('data-subtypeidentifier')), quantity);\r\n let tmp: QuickSelectionQuantityCounter = {\r\n counter: axCounter,\r\n mode: mode\r\n };\r\n\r\n this._mainModule.counter.push(tmp);\r\n }\r\n\r\n}", "import { AxInit, ModuleName } from \"../../Lib/AxSystem/AxInit\";\r\nimport { AxDropdown, IAxDropdownOptions, AxInput } from \"@axess/limestone\";\r\nimport { Instance, Props } from \"tippy.js\";\r\nimport * as Popper from '@popperjs/core';\r\nimport tippy from 'tippy.js';\r\nimport { AxDatePicker, Mode, Cell } from \"../../Components/AxDatepicker/AxDatepicker\";\r\nimport { AxCounter } from \"../../Limestone/AxCounter/AxCounter\";\r\nimport { AxLoad } from \"../../Lib/AxSystem/AxLoad\";\r\nimport { I18nHelper, Translations } from \"../../Lib/Helper/I18nHelper\";\r\nimport { QuantitySelection } from \"./QuickSelection/QuantitySelection\";\r\nimport { AxLimeStone } from \"../../Limestone/AxLimeStone\";\r\n\r\nexport class QuickSelectionQuantityCounter {\r\n counter: AxCounter;\r\n mode: \"desktop\" | \"mobile\";\r\n}\r\n\r\n@ModuleName(\"TV4LandingQuickSelection\")\r\nexport class LandingQuickSelection implements AxInit {\r\n init: ILandingQuickSelectionInit;\r\n mobileInterface: LandingQuickSelectionMobilePortlet;\r\n quantitySelectionInterface: QuantitySelection;\r\n\r\n currentGroupId: number = -1;\r\n private currentSelectionPosition: SearchStates = SearchStates.Category;\r\n\r\n public counter: QuickSelectionQuantityCounter[] = [];\r\n\r\n catDropdown: AxDropdown = new AxDropdown();\r\n prodDropdown: AxDropdown = new AxDropdown();\r\n dateDropdown: AxDropdown = new AxDropdown();\r\n quantityDropdown: AxDropdown = new AxDropdown();\r\n currentSearchDate: moment.Moment;\r\n\r\n public datePicker: AxDatePicker;\r\n\r\n public initComplete = false;\r\n\r\n constructor(private _i18nHelper = new I18nHelper(),\r\n private _AxLimestone = new AxLimeStone()) { }\r\n\r\n AxInit(init: ILandingQuickSelectionInit): void {\r\n this.init = init;\r\n\r\n this.mobileInterface = new LandingQuickSelectionMobilePortlet();\r\n this.mobileInterface.init(this, init, this._i18nHelper);\r\n\r\n this.quantitySelectionInterface = new QuantitySelection();\r\n this.quantitySelectionInterface.init(this);\r\n\r\n $('[data-tv4-quickselection=\"submit\"]').click(x => {\r\n let mode = $(x.delegateTarget).attr('data-target') as \"desktop\" | \"mobile\";\r\n this.addToCart(mode);\r\n });\r\n\r\n this.initDropdowns();\r\n this.initComplete = true;\r\n }\r\n\r\n initDropdowns() {\r\n this.catDropdown.init(`[data-tv4-quickselection--dropdown=\"cat\"]`, { searchBar: true });\r\n this.prodDropdown.init(`[data-tv4-quickselection--dropdown=\"prod\"]`, { searchBar: true });\r\n this.dateDropdown.init(`[data-tv4-quickselection--dropdown=\"date\"]`, { searchBar: true });\r\n this.quantityDropdown.init(`[data-tv4-quickselection--dropdown=\"quantity\"]`, { searchBar: true });\r\n\r\n let defaultProd = this.prodDropdown.val();\r\n\r\n let tippyDefaultOptions = {\r\n placement: 'bottom',\r\n trigger: 'mouseenter click',\r\n interactive: false,\r\n offset: [0, 16],\r\n role: 'info',\r\n theme: 'dark',\r\n onShow(tooltipInstance) {\r\n if (!$(tooltipInstance.reference).parent().is('[disabled]')) {\r\n return false;\r\n }\r\n }\r\n };\r\n\r\n //@ts-ignore\r\n tippy('[data-tv4-quickselection--dropdown=\"prod\"] .ax-dropdown__trigger', {\r\n ...tippyDefaultOptions,\r\n content: this._i18nHelper.GetTranslation(Translations.SelectCategoryFirst)\r\n });\r\n //@ts-ignore\r\n tippy('[data-tv4-quickselection--dropdown=\"date\"] .ax-dropdown__trigger', {\r\n ...tippyDefaultOptions,\r\n content: this._i18nHelper.GetTranslation(Translations.SelectTicketFirst)\r\n });\r\n //@ts-ignore\r\n tippy('[data-tv4-quickselection--dropdown=\"quantity\"] .ax-dropdown__trigger', {\r\n ...tippyDefaultOptions,\r\n content: this._i18nHelper.GetTranslation(Translations.SelectDateFirst)\r\n });\r\n\r\n this.catDropdown.getSelectObserver().subscribe((x: string) => {\r\n const groupId = parseInt(x);\r\n\r\n this.prodDropdown.resetSelection();\r\n\r\n this.currentGroupId = groupId;\r\n this.setTicketOptions(groupId);\r\n });\r\n\r\n if (defaultProd != null) {\r\n const $popper = this.getPopper(this.prodDropdown);\r\n const $target = $popper.find(`.ax-dropdown__item[data-groupid=${this.currentGroupId}][data-value=${defaultProd}]`);\r\n this.prodDropdown.select($target);\r\n }\r\n\r\n this.prodDropdown.getSelectObserver().subscribe((x: string) => {\r\n this.initDatePicker();\r\n\r\n if (this.datePicker != null && this.init.setDefaultDate) {\r\n this.datePicker.setDate(moment());\r\n }\r\n });\r\n }\r\n\r\n toggleSelection() {\r\n $('[data-tv4-quickselection--overlay=\"category\"]').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Category);\r\n $('[data-tv4-quickselection--overlay=\"product\"]').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Product);\r\n $('[data-tv4-quickselection--overlay=\"date\"]').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Date);\r\n $('[data-tv4-quickselection--overlay=\"quantity\"]').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Quantity);\r\n\r\n $('.prod_selection__prod-close--cancel')\r\n .toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Category);\r\n $('.prod_selection__prod-close--back')\r\n .toggleClass('d-none', this.currentSelectionPosition === SearchStates.Category);\r\n }\r\n\r\n initDatePicker() {\r\n const $popperDatePopper = this.getPopper(this.dateDropdown);\r\n const $popperProdPopper = this.getPopper(this.prodDropdown);\r\n const $selectedOption = $($popperProdPopper.find('.ax-dropdown__item.selected'));\r\n\r\n if ($selectedOption.length === 0) return;\r\n\r\n const preDateAble = $selectedOption.attr('data-predateable') === 'true';\r\n $('[data-tv4-quickselection--dropdown=\"date\"]').toggleClass('d-none', !preDateAble);\r\n\r\n this.dateDropdown.resetSelection();\r\n this.prodDropdown.getElements().attr('disabled', null);\r\n this.dateDropdown.getElements().attr('disabled', null);\r\n this.quantityDropdown.getElements().attr('disabled', '');\r\n\r\n if (!preDateAble) {\r\n this.quantitySelectionInterface.getQuantitySelection(moment());\r\n }\r\n\r\n const $datePicker = $popperDatePopper.find('[data-tv4-quickselection--dropdown=\"picker\"]');\r\n $datePicker.html('');\r\n\r\n const startDate = moment($selectedOption.attr('data-start'), 'YYYY-MM-DD');\r\n\r\n this.datePicker = new AxDatePicker();\r\n\r\n this.datePicker.Init({\r\n StartOfWeek: this.init.startOfWeek,\r\n Lang: this.init.lang,\r\n StartDate: startDate,\r\n DayRange: 0,\r\n Target: $datePicker[0],\r\n Mode: Mode.Inline,\r\n EndDate: null,\r\n monthsShown: 1\r\n });\r\n\r\n this.datePicker.ActivationSubject.subscribe((x: Cell) => {\r\n this.setDate(x);\r\n });\r\n\r\n this.mobileInterface.initDatePicker(startDate);\r\n }\r\n\r\n setTicketOptions(groupId: number) {\r\n if (isNaN(groupId)) return;\r\n this.counter = [];\r\n const $popper = this.getPopper(this.prodDropdown);\r\n const $overlay = $('[data-tv4-quickselection--overlay=\"product\"]');\r\n\r\n $popper.find('.ax-dropdown__item').removeClass('d-none')\r\n $popper.find('.ax-dropdown__item').not(`[data-groupid=${groupId}]`).addClass('d-none');\r\n\r\n $overlay.find('button[data-groupid]').removeClass('d-none')\r\n $overlay.find('button[data-groupid]').not(`[data-groupid=${groupId}]`).addClass('d-none');\r\n\r\n this.prodDropdown.resetSelection();\r\n this.dateDropdown.resetSelection();\r\n this.prodDropdown.getElements().attr('disabled', null);\r\n this.dateDropdown.getElements().attr('disabled', '');\r\n this.quantityDropdown.getElements().attr('disabled', '');\r\n\r\n $('[data-tv4-quickselection--dropdown=\"quantity-single\"]').html('');\r\n $(`[data-tv4-quickselection--dropdown=\"quantity\"]`).removeClass('d-none');\r\n this.quantitySelectionInterface.renderQuantityLines(0, 0);\r\n }\r\n\r\n setDate(cell: Cell) {\r\n if (cell != null) {\r\n this.dateDropdown.setValue(cell.Date.format(this.init.datePattern));\r\n this.dateDropdown.close();\r\n this.currentSearchDate = cell.Date;\r\n\r\n this.quantitySelectionInterface.getQuantitySelection(cell.Date);\r\n }\r\n }\r\n\r\n getPopper(dropdown: AxDropdown): JQuery<HTMLElement> {\r\n //@ts-ignore\r\n const instance = dropdown.getElements()[0]._tippy as Instance<Props>;\r\n let $popper = $(instance.popper);\r\n\r\n return $popper;\r\n }\r\n\r\n addToCart(mode: \"desktop\" | \"mobile\") {\r\n const tripleArr = (this.prodDropdown.getValue() as string).split('-');\r\n\r\n const $popperProdPopper = this.getPopper(this.prodDropdown);\r\n const $selectedOption = $($popperProdPopper.find('.ax-dropdown__item.selected'));\r\n const requestURL = $selectedOption.attr('data-add');\r\n let request;\r\n\r\n if (requestURL.toLowerCase().includes('/package/')) {\r\n request = {\r\n projNr: tripleArr[0],\r\n packTariffSheetNo: tripleArr[1],\r\n packageNr: tripleArr[2],\r\n date: (this.currentSearchDate ?? moment()).format('YYYY-MM-DD'),\r\n packagePositions: []\r\n }\r\n } else {\r\n request = {\r\n projNr: tripleArr[0],\r\n poolNr: tripleArr[1],\r\n ticketTypeId: tripleArr[2],\r\n date: (this.currentSearchDate ?? moment()).format('YYYY-MM-DD'),\r\n personTypes: []\r\n }\r\n }\r\n\r\n for (let c of this.counter.filter(x => x.mode === mode)) {\r\n if (c.counter.GetValue() < 1) continue;\r\n\r\n const subTypeIdentifier = $(c.counter.getElement()).attr('data-subtypeidentifier');\r\n let toAdd;\r\n\r\n if (requestURL.toLowerCase().includes('/package/')) {\r\n toAdd = {\r\n packPos: subTypeIdentifier,\r\n quantity: c.counter.GetValue(),\r\n linkedArticles: []\r\n }\r\n } else {\r\n toAdd = {\r\n personTypeId: subTypeIdentifier,\r\n quantity: c.counter.GetValue(),\r\n linkedArticles: []\r\n }\r\n }\r\n\r\n let $parent;\r\n\r\n if (mode === \"desktop\") {\r\n $parent = $(this.quantitySelectionInterface.quantitySelectionTippy.popper);\r\n } else {\r\n $parent = $('[data-tv4-quickselection--overlay=\"quantity\"]');\r\n }\r\n\r\n let count = 0;\r\n for (let article of $parent.find(`[data-tv4-quickselection--dropdown-quantity=\"article\"][data-subtypeidentifier=\"${subTypeIdentifier}\"],[data-tv4-quickselection--dropdown-quantity=\"article\"][data-subtypeidentifier--copy=\"${subTypeIdentifier}\"]`).not('.d-none')) {\r\n for (const checkbox of $(article).find('[data-tv4-quickselection-article]')) {\r\n let $checkbox = $(checkbox);\r\n const articleNr = $checkbox.attr('data-tv4-quickselection-article');\r\n const checked = $checkbox.prop('checked');\r\n\r\n toAdd.linkedArticles.push({\r\n articleNr: articleNr,\r\n checked: checked,\r\n index: count\r\n });\r\n }\r\n count++;\r\n }\r\n\r\n request.personTypes?.push(toAdd);\r\n request.packagePositions?.push(toAdd);\r\n }\r\n\r\n if ((request.personTypes?.length ?? 0) === 0 && (request.packagePositions?.length ?? 0) === 0) return;\r\n\r\n this._AxLimestone.LockButton($('[data-tv4-quickselection=\"submit\"]')[0]);\r\n AxessViewer.loadPartialView(requestURL, request, (result) => {\r\n AxLoad.LoadModule('AxFireShoppingCartModal', {\r\n result: result,\r\n continueShoppingPath: '/Tickets',\r\n btn: '.tv4_prod-selection__addToCart-submit',\r\n ResetQuantity: false,\r\n queryAddition: '?ref=pi'\r\n });\r\n this._AxLimestone.UnlockButton($('[data-tv4-quickselection=\"submit\"]')[0]);\r\n }, {\r\n silent: true,\r\n skipShoppingCartReload: false,\r\n addCulturInfo: false\r\n });\r\n }\r\n}\r\n\r\n\r\nclass LandingQuickSelectionMobilePortlet {\r\n private currentSelectionPosition: SearchStates = SearchStates.Category;\r\n private mainModule: LandingQuickSelection;\r\n private initData: ILandingQuickSelectionInit;\r\n\r\n private datePickerMobile: AxDatePicker;\r\n private _i18nHelper: I18nHelper;\r\n\r\n init(rentalMainModule: LandingQuickSelection, init: ILandingQuickSelectionInit, i18nHelper: I18nHelper) {\r\n this.initData = init;\r\n this.mainModule = rentalMainModule;\r\n this._i18nHelper = i18nHelper;\r\n this.initEvents();\r\n }\r\n\r\n initDefaultValues() {\r\n let defaultCat = this.mainModule.catDropdown.val();\r\n let defaultProd = this.mainModule.prodDropdown.getSelected();\r\n let defaultDate = this.mainModule.datePicker?.ActivationSubject?.value;\r\n\r\n this.currentSelectionPosition = SearchStates.Category;\r\n\r\n if (defaultCat != null)\r\n this.currentSelectionPosition = SearchStates.Product;\r\n\r\n if (defaultProd.length !== 0)\r\n this.currentSelectionPosition = SearchStates.Date;\r\n\r\n if (defaultCat != null && defaultProd.length !== 0 && defaultDate != null) {\r\n this.datePickerMobile.setDate(defaultDate.Date);\r\n return;\r\n }\r\n\r\n this.toggleSelection();\r\n this.printSummary();\r\n }\r\n\r\n initEvents() {\r\n $('[data-tv4-quickselection=\"toggle\"]').on('click',\r\n () => {\r\n this.initDefaultValues();\r\n $('[data-tv4-quickselection=\"overlay\"]').toggleClass('active');\r\n });\r\n\r\n $('[data-tv4-quickselection=\"close\"]').on('click',\r\n () => {\r\n this.currentSelectionPosition = SearchStates.Category;\r\n this.resetSelections();\r\n this.toggleSelection();\r\n\r\n $('[data-tv4-quickselection=\"overlay\"]').toggleClass('active');\r\n });\r\n\r\n $('[data-tv4-quickselection--overlay=\"category\"] button').on('click',\r\n (e) => {\r\n const value = $(e.delegateTarget).attr('data-value');\r\n this.selectCategory(value);\r\n });\r\n\r\n $('[data-tv4-quickselection--overlay=\"product\"] button').on('click',\r\n (e) => {\r\n const link = $(e.delegateTarget).attr('data-link');\r\n this.selectProduct(link);\r\n });\r\n\r\n $('[data-tv4-quickselection=\"back\"]').click(x => {\r\n this.goBackOrClose();\r\n });\r\n }\r\n\r\n initDatePicker(startDate: moment.Moment) {\r\n $('[data-tv4-quickselection--overlay=\"date-picker\"]').html('');\r\n $('[data-tv4-quickselection--overlay=\"date-legend\"]').html('');\r\n this.datePickerMobile = new AxDatePicker();\r\n this.datePickerMobile.Init({\r\n StartOfWeek: this.initData.startOfWeek,\r\n Lang: this.initData.lang,\r\n StartDate: startDate,\r\n DayRange: 0,\r\n Target: $('[data-tv4-quickselection--overlay=\"date-picker\"]')[0],\r\n Mode: Mode.Endless,\r\n LegendTarget: '[data-tv4-quickselection--overlay=\"date-legend\"]',\r\n monthsShown: 2,\r\n scrollTargetQuerySelector: '[data-tv4-quickselection--overlay=\"date\"]'\r\n });\r\n\r\n this.datePickerMobile.ActivationSubject.subscribe((x: Cell) => {\r\n if (x != null) {\r\n this.mainModule.datePicker.setDate(x.Date);\r\n this.currentSelectionPosition = SearchStates.Quantity;\r\n this.toggleSelection();\r\n }\r\n });\r\n }\r\n\r\n goBackOrClose() {\r\n const originalPosition = this.currentSelectionPosition;\r\n this.currentSelectionPosition--;\r\n\r\n if (originalPosition == SearchStates.Quantity && this.datePickerMobile.ActivationSubject.value == null) {\r\n this.currentSelectionPosition--;\r\n }\r\n\r\n if (originalPosition !== SearchStates.Category) {\r\n switch (this.currentSelectionPosition) {\r\n case SearchStates.Date:\r\n this.resetCounters();\r\n this.mainModule.datePicker.resetDateSelection();\r\n this.mainModule.dateDropdown.resetSelection();\r\n this.datePickerMobile.resetDateSelection();\r\n break;\r\n case SearchStates.Product:\r\n this.resetCounters();\r\n this.mainModule.prodDropdown.resetSelection();\r\n break;\r\n case SearchStates.Category:\r\n this.mainModule.catDropdown.resetSelection();\r\n break;\r\n\r\n }\r\n } else {\r\n $('[data-tv4-quickselection=\"overlay\"]').toggleClass('active');\r\n this.resetSelections();\r\n }\r\n this.toggleSelection();\r\n }\r\n\r\n resetCounters() {\r\n const counters = this.mainModule.counter;\r\n for (let c of counters) {\r\n c.counter.resetValue();\r\n }\r\n }\r\n\r\n resetSelections() {\r\n this.mainModule.dateDropdown.resetSelection();\r\n this.mainModule.catDropdown.resetSelection();\r\n this.mainModule.prodDropdown.resetSelection();\r\n this.mainModule.quantityDropdown.resetSelection();\r\n\r\n this.datePickerMobile?.resetDateSelection();\r\n this.mainModule.datePicker?.resetDateSelection();\r\n\r\n this.resetCounters();\r\n }\r\n\r\n getTotalQuantity(mode: \"desktop\" | \"mobile\") {\r\n const counters = this.mainModule.counter.filter(x => x.mode === mode);\r\n\r\n let totalQuantity = 0;\r\n for (let c of counters) {\r\n totalQuantity += c.counter.GetValue();\r\n }\r\n\r\n return totalQuantity;\r\n }\r\n\r\n renderSubmitButtonText() {\r\n const $mobileSubmit = $('[data-tv4-quickselection=\"footer\"] [data-tv4-quickselection=\"submit\"] span');\r\n const totalQuantity = this.getTotalQuantity(\"mobile\");\r\n\r\n $('[data-tv4-quickselection=\"continue\"]').toggleClass('d-none', totalQuantity === 0);\r\n $mobileSubmit.html(this._i18nHelper.GetTranslation(Translations.TicketsX, totalQuantity));\r\n this.printSummary();\r\n }\r\n\r\n printSummary() {\r\n const $currentCategory = this.mainModule.catDropdown.getSelected();\r\n const $currentProduct = this.mainModule.prodDropdown.getSelected();\r\n\r\n if (this.currentSelectionPosition !== SearchStates.Quantity) {\r\n $('[data-tv4-quickselection=\"continue\"]').addClass('d-none');\r\n }\r\n\r\n if ($currentCategory.length == 0 || this.currentSelectionPosition === SearchStates.Category) {\r\n $('[data-tv4-quickselection=\"summary\"]').html(``);\r\n $('[data-tv4-quickselection=\"footer\"]').addClass('d-none');\r\n return;\r\n }\r\n\r\n $('[data-tv4-quickselection=\"footer\"]').removeClass('d-none');\r\n\r\n const wrapper = document.createElement('div');\r\n wrapper.classList.add('d-flex', 'ax-my-1-n', 'ax-gap-1', 'flex-wrap');\r\n\r\n\r\n const totalQuantity = this.getTotalQuantity(\"mobile\");\r\n\r\n if (totalQuantity > 0 && this.currentSelectionPosition === SearchStates.Quantity) {\r\n const innerWrapper = document.createElement('div');\r\n innerWrapper.classList.add('d-flex');\r\n\r\n const iconWrapper = document.createElement('div');\r\n const iconElem = document.createElement('i');\r\n iconElem.classList.add('las', 'la-user', 'ax-mr-1');\r\n iconWrapper.appendChild(iconElem);\r\n innerWrapper.appendChild(iconWrapper);\r\n\r\n const textWrapper = document.createElement('div');\r\n const locationElem = this._i18nHelper.GetTranslation(Translations.TicketsX, totalQuantity);\r\n textWrapper.innerHTML = locationElem;\r\n innerWrapper.appendChild(textWrapper);\r\n wrapper.appendChild(innerWrapper);\r\n }\r\n\r\n if ($currentProduct.length > 0) {\r\n const innerWrapper = document.createElement('div');\r\n innerWrapper.classList.add('d-flex');\r\n\r\n const iconWrapper = document.createElement('div');\r\n const iconElem = document.createElement('i');\r\n iconElem.classList.add('las', 'la-ticket-alt', 'ax-mr-1');\r\n iconWrapper.appendChild(iconElem);\r\n innerWrapper.appendChild(iconWrapper);\r\n\r\n const textWrapper = document.createElement('div');\r\n const locationElem = $currentProduct.html();\r\n textWrapper.innerHTML = locationElem;\r\n innerWrapper.appendChild(textWrapper);\r\n wrapper.appendChild(innerWrapper);\r\n }\r\n\r\n if (this.datePickerMobile?.ActivationSubject?.value != null) {\r\n const innerWrapper = document.createElement('div');\r\n innerWrapper.classList.add('d-flex');\r\n\r\n const iconWrapper = document.createElement('div');\r\n const iconElem = document.createElement('i');\r\n iconElem.classList.add('las', 'la-calendar', 'ax-mr-1');\r\n iconWrapper.appendChild(iconElem);\r\n innerWrapper.appendChild(iconWrapper);\r\n\r\n const textWrapper = document.createElement('div');\r\n const currentCell: Cell = this.datePickerMobile.ActivationSubject.value;\r\n textWrapper.innerHTML = currentCell.Date.format('ll');\r\n innerWrapper.appendChild(textWrapper);\r\n wrapper.appendChild(innerWrapper);\r\n }\r\n\r\n const innerWrapper = document.createElement('div');\r\n innerWrapper.classList.add('d-flex');\r\n\r\n const iconWrapper = document.createElement('div');\r\n const iconElem = document.createElement('i');\r\n iconElem.classList.add('las', 'la-list-alt', 'ax-mr-1');\r\n iconWrapper.appendChild(iconElem);\r\n innerWrapper.appendChild(iconWrapper);\r\n\r\n const textWrapper = document.createElement('div');\r\n const locationElem = $currentCategory.html();\r\n textWrapper.innerHTML = locationElem;\r\n innerWrapper.appendChild(textWrapper);\r\n wrapper.appendChild(innerWrapper);\r\n\r\n $('[data-tv4-quickselection=\"summary\"]').html(wrapper);\r\n }\r\n\r\n selectProduct(link: string) {\r\n const elem = this.mainModule.getPopper(this.mainModule.prodDropdown).find(`[data-link=\"${link}\"]`);\r\n this.mainModule.prodDropdown.select(elem);\r\n\r\n const $selectedOption = this.mainModule.prodDropdown.getSelected();\r\n const preDateAble = $selectedOption.attr('data-predateable') === 'true';\r\n\r\n this.currentSelectionPosition = preDateAble ? SearchStates.Date : SearchStates.Quantity;\r\n this.mainModule.initDatePicker();\r\n this.toggleSelection();\r\n }\r\n\r\n selectCategory(value: string) {\r\n this.mainModule.catDropdown.setValue(value);\r\n\r\n this.currentSelectionPosition = SearchStates.Product;\r\n this.mainModule.setTicketOptions(parseInt(value));\r\n this.toggleSelection();\r\n }\r\n\r\n toggleSelection() {\r\n $('[data-tv4-quickselection=\"overlay\"] .prod_selection__scrollable')[0].scrollTo(0, 0);\r\n $('[data-tv4-quickselection--overlay=\"category\"]').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Category);\r\n $('[data-tv4-quickselection--overlay=\"product\"]').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Product);\r\n $('[data-tv4-quickselection--overlay=\"date\"]').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Date);\r\n $('[data-tv4-quickselection--overlay=\"quantity\"]').toggleClass('d-none', this.currentSelectionPosition !== SearchStates.Quantity);\r\n\r\n $('.prod_selection__prod-close--back')\r\n .toggleClass('d-none', this.currentSelectionPosition === SearchStates.Category);\r\n this.printSummary();\r\n }\r\n\r\n isEmptyOrSpaces(str) {\r\n return str === null || str.match(/^ *$/) !== null;\r\n }\r\n}\r\nenum SearchStates {\r\n Category = 1,\r\n Product = 2,\r\n Date = 3,\r\n Quantity = 4,\r\n}\r\n\r\ninterface ILandingQuickSelectionInit {\r\n startOfWeek: number;\r\n datePattern: string;\r\n lang: string;\r\n setDefaultDate: boolean;\r\n}", "import { AxLoad } from \"./Lib/AxSystem/AxLoad\";\r\nimport { AxLimeStone } from \"./Limestone/AxLimeStone\";\r\nimport { AxProdDetail } from \"./Modules/AxProdSelection/AxProdDetail\";\r\nimport { AxProdMain } from \"./Modules/AxProdSelection/AxProdMain\";\r\nimport { AxPackNonPredateable } from \"./Modules/AxProdSelection/Packages/AxPackNonPredateable\";\r\nimport { AxPackPredateable } from \"./Modules/AxProdSelection/Packages/AxPackPredateable\";\r\nimport { AxProdNonPredateable } from \"./Modules/AxProdSelection/Tickets/AxProdNonPredateable\";\r\nimport { AxProdPredateable } from \"./Modules/AxProdSelection/Tickets/AxProdPredateable\";\r\nimport { AxProdSelection } from \"./Modules/AxProdSelection/AxProdSelection\";\r\nimport { AxProdSelectionCalendar } from \"./Modules/AxProdSelection/Tickets/AxProdSelectionCalendar\";\r\nimport { AxProdBooking } from \"./Modules/AxProdSelection/Tickets/AxProdBooking\";\r\nimport { AxProdSummary } from \"./Modules/AxProdSelection/AxProdSummary\";\r\nimport { AxTopBar } from \"./Modules/Global/AxTopBar\";\r\nimport { AxMain } from \"./Utility/AxMain\";\r\nimport { AxPackSelectionCalendar } from \"./Modules/AxProdSelection/Packages/AxPackSelectionCalendar\";\r\nimport { B2bMode } from \"./Modules/B2B/B2bMode\"\r\nimport { ShoppingCart } from \"./Modules/ShoppingCart/ShoppingCart\";\r\nimport { AxPackBooking } from \"./Modules/AxProdSelection/Packages/AxPackBooking\";\r\nimport { TimeSlots } from \"./Modules/Reservations/TimeSlots\";\r\nimport { Reserved } from \"./Modules/Reservations/Reserved\";\r\nimport { CategoryFilter } from \"./Modules/Categories/CategoryFilter\";\r\nimport { SubmenuAim } from \"./Modules/Global/SubmenuAim\";\r\nimport { RetailDetail } from \"./Modules/Retail/RetailDetail\";\r\nimport { RetailMain } from \"./Modules/Retail/RetailMain\";\r\nimport { Shipping } from \"./Modules/Shipping/Shipping\";\r\nimport { RetailFilter } from \"./Modules/Retail/RetailFilter\";\r\nimport { OrderHistory } from \"./Modules/Profile/OrderHistory\";\r\nimport { AxBirthDateInputTriple } from \"./Modules/Global/AxBirthDateInputTriple\";\r\nimport { MainGiftCards } from \"./Modules/GiftCard/MainGiftCards\";\r\nimport { PersonalizeGiftCard } from \"./Modules/GiftCard/PersonalizeGiftCard\";\r\nimport { PasswordValidation } from \"./Modules/Profile/PasswordValidation\";\r\nimport { MyFamily } from \"./Modules/Profile/MyFamily\";\r\nimport { SeasonCardBooking } from \"./Modules/Reservations/SeasonCardBooking\";\r\nimport { ComplexPackageFilter } from \"./Modules/ComplexPackages/ComplexPackageFilter\";\r\nimport { ComplexPackageSelection } from \"./Modules/ComplexPackages/ComplexPackageSelection\";\r\nimport { ComplexPackageDetails } from \"./Modules/ComplexPackages/ComplexPackageDetails\";\r\nimport { ComplexPackageBookingOptions } from \"./Modules/ComplexPackages/ComplexPackageBookingOptions\";\r\nimport { ComplexPackageBookingTicketsOptions } from \"./Modules/ComplexPackages/BookingOptions/ComplexPackageBookingTicketsOptions\";\r\nimport { CompPackBookingLessonProgramOptions } from \"./Modules/ComplexPackages/BookingOptions/CompPackBookingLessonProgramOptions\";\r\nimport { CompPackBookingPersonOptions } from \"./Modules/ComplexPackages/BookingOptions/CompPackBookingPersonOptions\";\r\nimport { CompPackBookingRentalOptions } from \"./Modules/ComplexPackages/BookingOptions/CompPackBookingRentalOptions\";\r\nimport { CompPackBookingLessonOptions } from \"./Modules/ComplexPackages/BookingOptions/CompPackBookingLessonOptions\";\r\nimport { Redirect } from \"./Modules/Redirect/Redirect\";\r\nimport { ComplexPackageSearchBar } from \"./Modules/ComplexPackages/ComplexPackageSearchBar\";\r\nimport { LessonsLoadingSpinner } from \"./Modules/Lessons/LessonsLoadingSpinner\";\r\nimport { Eguma } from \"./Modules/Payment/Eguma\";\r\nimport { ShoppingCartPersonalisation } from \"./Modules/ShoppingCart/ShoppingCartPersonalisation\";\r\nimport { ShoppingCartReservationTimer } from \"./Modules/ShoppingCart/ShoppingCartReservationTimer\";\r\nimport { B2BHistory } from \"./Modules/B2B/B2BHistory\";\r\nimport { ShoppingCartEntryRetail } from \"./Modules/ShoppingCart/ShoppingCartEntryRetail\";\r\nimport { FindMyTicket } from \"./Modules/FindMyTicket/FindMyTicket\";\r\nimport { MyChipCards } from \"./Modules/Profile/MyChipCards\";\r\nimport { UtilityInit } from \"./Modules/Global/UtilityInit\";\r\nimport { AxFireShoppingCartModal } from \"./Components/AxFireShoppingCartModal/AxFireShoppingCartModal\";\r\nimport { inputMaskHelper } from './Lib/Helper/InputMaskHelper';\r\nimport { AxGA4Module } from \"./Modules/AxGA4/AxGA4Module\";\r\nimport { AxStaticConfigModule } from \"./Modules/AxConfig/AxStaticConfigModule\";\r\nimport { ServerErrorPopUp } from \"./Modules/ErrorHandling/ServerErrorPopUp\";\r\nimport { VoucherPayment } from \"./Modules/Payment/VoucherPayment\";\r\nimport { Unsubscribe } from \"./Modules/NewsLetterSubscription/Unsubscribe\";\r\nimport { Banner } from \"./Modules/Global/Banner\";\r\nimport { HeroModule } from \"./Modules/Hero/HeroModule\";\r\nimport { Payment } from \"./Modules/Payment/Payment\";\r\nimport { Registration } from \"./Modules/Account/Registration\";\r\nimport { RegisterForm } from \"./Modules/Account/RegisterForm\";\r\nimport { PersonalData } from \"./Modules/ProfileSettings/PersonalData\"; \r\nimport { Resubscribe } from \"./Modules/NewsLetterSubscription/Resubscribe\";\r\nimport { PackageMinMaxConstraint } from \"./Modules/Packages/PackageMinMaxConstraint\";\r\nimport { MissingMandatoryData } from \"./Modules/Account/MissingMandatoryData\";\r\nimport { MaintenanceScriptInfo } from \"./Modules/MaintenanceMode/MaintenanceScriptInfo\";\r\nimport { RentalMain } from \"./Modules/Rental/RentalMain\";\r\nimport { RentalFilter } from \"./Modules/Rental/RentalFilter\";\r\nimport { LocalizationModule } from \"./Modules/Global/LocalizationModule\";\r\nimport { BleQrCodes } from \"./Modules/Ble/BleQrCodes\";\r\nimport { ShoppingCartDateInputTriple } from \"./Modules/ShoppingCart/ShoppingCartDateInputTriple\";\r\nimport { RentalProductDetails } from \"./Modules/Rental/ProductDetails/RentalProductDetails\";\r\nimport { DateModule } from \"./Modules/Global/DateModule\";\r\nimport { RentalShopDetails } from \"./Modules/Rental/RentalShopDetails\";\r\nimport * as RentalDetails from \"./Modules/Rental/RiderDetails/RiderDetailsModule\";\r\nimport * as LessonPackagesLandingPage from \"./Modules/LessonPackages/LandingPage\";\r\nimport * as LessonPackagesSelection from \"./Modules/LessonPackages/Selection\";\r\nimport * as LessonPackagesPersonalization from \"./Modules/LessonPackages/Personalization\";\r\nimport { AxFilterOverlay } from \"./Utility/AxFilterOverlay\";\r\nimport { LessonPackageStorage } from \"./Modules/LessonPackages/LessonPackageStorage\";\r\nimport { ToCheckout } from \"./Modules/ShoppingCart/ToCheckout\";\r\nimport { PopUpShoppingCart } from \"./Modules/ShoppingCart/PopUpShoppingCart\";\r\nimport { OneRiskNotification } from \"./Modules/ShoppingCart/OneRiskNotification\";\r\nimport { OneRisk } from \"./Modules/OneRisk/OneRisk\";\r\nimport { CustomerLessonProperties } from \"./Modules/Account/CustomerLessonProperties\";\r\nimport { LessonBuyerInfoModule } from \"./Modules/Lessons/LessonBuyerInfoModule\";\r\nimport { ConsentDocuments } from \"./Modules/ConsentDocuments/ConsentDocuments\";\r\nimport * as LandingQuickSelection from \"./Modules/AxProdSelection/LandingQuickSelection\";\r\n\r\nexport class App extends AxMain {\r\n declarations = [\r\n Payment,\r\n AxTopBar,\r\n AxProdDetail,\r\n AxProdMain,\r\n AxProdSelection,\r\n LessonPackagesLandingPage.LandingPage,\r\n LessonPackagesSelection.Selection,\r\n LessonPackagesPersonalization.Personalization,\r\n AxProdSelectionCalendar,\r\n AxProdBooking,\r\n AxPackBooking,\r\n AxProdNonPredateable,\r\n AxProdSummary,\r\n LandingQuickSelection.LandingQuickSelection,\r\n AxProdPredateable,\r\n AxPackPredateable,\r\n AxPackNonPredateable,\r\n AxPackSelectionCalendar,\r\n ShoppingCart,\r\n CategoryFilter,\r\n ToCheckout, \r\n RentalShopDetails,\r\n Registration,\r\n B2BHistory,\r\n ShoppingCart,\r\n SeasonCardBooking,\r\n TimeSlots,\r\n LessonPackageStorage,\r\n VoucherPayment,\r\n Reserved,\r\n OrderHistory,\r\n ComplexPackageFilter,\r\n ComplexPackageSelection,\r\n ConsentDocuments,\r\n ComplexPackageDetails,\r\n Eguma,\r\n AxBirthDateInputTriple,\r\n SubmenuAim,\r\n RetailDetail,\r\n RetailMain,\r\n RetailFilter,\r\n RentalMain,\r\n RentalFilter,\r\n Shipping,\r\n OrderHistory,\r\n ComplexPackageBookingOptions,\r\n ComplexPackageBookingTicketsOptions,\r\n CompPackBookingLessonProgramOptions,\r\n CompPackBookingPersonOptions,\r\n CompPackBookingRentalOptions,\r\n CompPackBookingLessonOptions,\r\n PasswordValidation,\r\n MyChipCards,\r\n Redirect,\r\n LessonsLoadingSpinner,\r\n MyFamily,\r\n ShoppingCartEntryRetail,\r\n ComplexPackageSearchBar,\r\n ShoppingCartPersonalisation,\r\n FindMyTicket,\r\n UtilityInit,\r\n ShoppingCartReservationTimer,\r\n PersonalizeGiftCard,\r\n MainGiftCards,\r\n AxFireShoppingCartModal,\r\n AxGA4Module,\r\n AxStaticConfigModule,\r\n ServerErrorPopUp,\r\n HeroModule,\r\n Banner,\r\n Unsubscribe,\r\n Resubscribe,\r\n PersonalData,\r\n MissingMandatoryData,\r\n MaintenanceScriptInfo,\r\n PopUpShoppingCart,\r\n RegisterForm,\r\n PackageMinMaxConstraint,\r\n BleQrCodes,\r\n ShoppingCartDateInputTriple,\r\n RentalProductDetails,\r\n LocalizationModule,\r\n RentalDetails.RiderDetailsModule,\r\n DateModule,\r\n OneRiskNotification,\r\n OneRisk,\r\n CustomerLessonProperties,\r\n LessonBuyerInfoModule\r\n ];\r\n\r\n utility = [\r\n inputMaskHelper,\r\n AxFilterOverlay,\r\n AxLimeStone\r\n ];\r\n\r\n providers = [\r\n AxLoad,\r\n B2bMode\r\n ];\r\n\r\n constructor() {\r\n super();\r\n this.Init();\r\n }\r\n}\r\n\r\n\r\nwindow[\"App\"] = App;"], "mappings": "+8CAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,EAAC,SAASC,EAAE,CAAc,OAAOF,IAAjB,UAAuC,OAAOC,IAApB,YAA2BA,GAAO,QAAQC,EAAE,EAAsB,OAAO,QAAnB,YAA2B,OAAO,IAAI,OAAO,CAAC,EAAEA,CAAC,GAAqB,OAAO,QAApB,aAA+C,OAAO,QAApB,YAAP,OAAsD,OAAO,MAApB,YAAyB,KAAK,MAAM,cAAcA,EAAE,CAAE,GAAG,UAAU,CAAC,OAAO,SAASA,EAAEC,EAAE,EAAEC,EAAE,CAAC,SAASC,EAAEC,EAAEC,EAAE,CAAC,GAAG,CAAC,EAAED,CAAC,EAAE,CAAC,GAAG,CAACH,EAAEG,CAAC,EAAE,CAAC,IAAIE,EAAc,OAAOC,IAAnB,YAA4BA,GAAQ,GAAG,CAACF,GAAGC,EAAE,OAAOA,EAAEF,EAAE,EAA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C,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACcC,GACdC,GACAC,GACAC,GACAC,GACAC,IAGJ,KAAA,QAAU,CACNC,GACAC,GACAC,IAGJ,KAAA,UAAY,CACRC,EACAC,IAKA,KAAK,KAAI,CACb,GAIJ,OAAO,IAAS5F", "names": ["require_basicLightbox_min", "__commonJSMin", "exports", "module", "e", "n", "o", "r", "c", "u", "s", "__require", "i", "a", "l", "t", "require_sweetalert2_all", "__commonJSMin", "exports", "module", "global", "factory", "consolePrefix", "uniqueArray", "arr", "result", "i", "capitalizeFirstLetter", "str", "toArray", "nodeList", "warn", "message", "error", "previousWarnOnceMessages", "warnOnce", "warnAboutDeprecation", "deprecatedParam", "useInstead", "callIfFunction", "arg", "hasToPromiseFn", "asPromise", "isPromise", "defaultParams", "updatableParams", "deprecatedParams", "toastIncompatibleParams", "isValidParameter", "paramName", "isUpdatableParameter", "isDeprecatedParameter", "checkIfParamIsValid", "param", "checkIfToastParamIsValid", "checkIfParamIsDeprecated", "showWarningsForParams", "params", "swalPrefix", "prefix", "items", "swalClasses", "iconTypes", "getContainer", "elementBySelector", "selectorString", "container", "elementByClass", "className", "getPopup", "getIcon", "getTitle", "getHtmlContainer", "getImage", "getProgressSteps", "getValidationMessage", "getConfirmButton", "getDenyButton", "getInputLabel", "getLoader", "getCancelButton", "getActions", "getFooter", "getTimerProgressBar", "getCloseButton", "focusable", "getFocusableElements", "focusableElementsWithTabindex", "a", "tabindexA", "tabindexB", "otherFocusableElements", "el", "isVisible", "isModal", "hasClass", "isToast", "isLoading", "states", "setInnerHtml", "elem", "html", "parsed", "child", "classList", "removeCustomClasses", "applyCustomClass", "addClass", "getInput", "popup", "inputType", "focusInput", "input", "val", "toggleClass", "target", "condition", "removeClass", "getDirectChildByClass", "childNodes", "applyNumericalStyle", "property", "value", "show", "display", "hide", "setStyle", "parent", "selector", "toggle", "allButtonsAreHidden", "isScrollable", "hasCssAnimation", "style", "animDuration", "transDuration", "animateTimerProgressBar", "timer", "reset", "timerProgressBar", "stopTimerProgressBar", "timerProgressBarWidth", "timerProgressBarFullWidth", "timerProgressBarPercent", "isNodeEnv", "RESTORE_FOCUS_TIMEOUT", "globalState", "focusPreviousActiveElement", "restoreActiveElement", "returnFocus", "resolve", "x", "y", "sweetHTML", "resetOldContainer", "oldContainer", "resetValidationMessage", "addInputChangeListeners", "file", "range", "rangeOutput", "select", "checkbox", "textarea", "getTarget", "setupAccessibility", "setupRTL", "targetElement", "init", "oldContainerExisted", "parseHtmlToContainer", "handleObject", "handleJqueryElem", "animationEndEvent", "testEl", "transEndEventNames", "measureScrollbar", "scrollDiv", "scrollbarWidth", "renderActions", "instance", "actions", "loader", "renderButtons", "confirmButton", "denyButton", "cancelButton", "renderButton", "handleButtonsStyling", "button", "buttonType", "handleBackdropParam", "backdrop", "handlePositionParam", "position", "handleGrowParam", "grow", "growClass", "renderContainer", "privateProps", "inputTypes", "renderInput", "innerParams", "rerender", "inputClass", "inputContainer", "setAttributes", "showInput", "setCustomClass", "renderInputType", "getInputContainer", "removeAttributes", "attrName", "inputAttributes", "attr", "setInputPlaceholder", "setInputLabel", "prependTo", "label", "labelClass", "rangeInput", "placeholder", "radio", "checkboxContainer", "getMargin", "initialPopupWidth", "textareaResizeHandler", "textareaWidth", "renderContent", "htmlContainer", "renderFooter", "footer", "renderCloseButton", "closeButton", "renderIcon", "icon", "setContent", "applyStyles", "iconType", "setColor", "adjustSuccessIconBackgroundColor", "popupBackgroundColor", "successIconParts", "successIconHtml", "errorIconHtml", "iconContent", "sel", "content", "renderImage", "image", "createStepElement", "step", "stepEl", "createLineElement", "lineEl", "renderProgressSteps", "progressStepsContainer", "index", "renderTitle", "title", "renderPopup", "addClasses", "render", "DismissReason", "setAriaHidden", "unsetAriaHidden", "swalStringParams", "getTemplateParams", "template", "templateContent", "showWarningsForElements", "getSwalParams", "getSwalButtons", "getSwalImage", "getSwalIcon", "getSwalInput", "getSwalStringParams", "showWarningsForAttributes", "type", "inputOptions", "option", "optionValue", "optionName", "paramNames", "tag", "allowedElements", "tagName", "allowedAttributes", "attribute", "defaultInputValidators", "string", "validationMessage", "setDefaultInputValidators", "key", "validateCustomTargetElement", "setParameters", "Timer", "callback", "delay", "n", "running", "fixScrollbar", "undoScrollbar", "iOSfix", "offset", "lockBodyScroll", "addBottomPaddingForTallPopups", "ua", "iOS", "webkit", "preventTouchMove", "e", "shouldPreventTouchMove", "event", "isStylus", "isZoom", "undoIOSfix", "SHOW_CLASS_TIMEOUT", "openPopup", "initialBodyOverflow", "addClasses$1", "setScrollingVisibility", "fixScrollContainer", "swalOpenAnimationFinished", "scrollbarPadding", "showLoading", "buttonToReplace", "Swal", "replaceButton", "handleInputOptionsAndValue", "handleInputOptions", "handleInputValue", "getInputValue", "getCheckboxValue", "getRadioValue", "getFileValue", "processInputOptions", "populateInputOptions", "formatInputOptions", "inputValue", "err", "renderOption", "optionLabel", "isSelected", "inputOption", "optgroup", "o", "radioValue", "radioLabel", "radioInput", "radioLabelElement", "radios", "valueFormatted", "hideLoading", "domCache", "showRelatedButton", "getInput$1", "privateMethods", "isVisible$1", "clickConfirm", "clickDeny", "clickCancel", "removeKeydownHandler", "addKeydownHandler", "dismissWith", "keydownHandler", "setFocus", "increment", "focusableElements", "arrowKeysNextButton", "arrowKeysPreviousButton", "handleEnter", "handleTab", "handleArrows", "handleEsc", "btnIndex", "sibling", "buttonToFocus", "removePopupAndResetState", "didClose", "triggerDidCloseAndDispose", "removeBodyClasses", "close", "resolveValue", "prepareResolveValue", "swalPromiseResolve", "triggerClosePopup", "handleAwaitingPromise", "isAwaitingPromise", "handlePopupAnimation", "rejectPromise", "animationIsSupported", "animatePopup", "setButtonsDisabled", "buttons", "disabled", "setInputDisabled", "enableButtons", "disableButtons", "enableInput", "disableInput", "showValidationMessage", "resetValidationMessage$1", "getProgressSteps$1", "update", "validUpdatableParams", "filterValidParams", "updatedParams", "_destroy", "disposeWeakMaps", "disposeSwal", "unsetWeakMaps", "obj", "instanceMethods", "handleConfirmButtonClick", "handleConfirmOrDenyWithInput", "confirm", "handleDenyButtonClick", "deny", "handleCancelButtonClick", "handleInputValidator", "preDenyValue", "error$$1", "rejectWith", "succeedWith", "preConfirmValue", "handlePopupClick", "handleToastClick", "handleModalMousedown", "handleContainerMousedown", "handleModalClick", "isAnyButtonShown", "ignoreOutsideClick", "isJqueryElement", "isElement", "argsToParams", "args", "name", "fire", "_len", "_key", "mixin", "mixinParams", "MixinSwal", "priorityMixinParams", "getTimerLeft", "stopTimer", "resumeTimer", "remaining", "toggleTimer", "increaseTimer", "isTimerRunning", "bodyClickListenerAdded", "clickHandlers", "bindClickHandler", "bodyClickListener", "staticMethods", "currentInstance", "SweetAlert", "outerParams", "promise", "userParams", "prepareParams", "populateDomCache", "swalPromise", "onFulfilled", "onFinally", "reject", "dismiss", "setupTimer", "initFocus", "templateParams", "globalState$$1", "blurActiveElement", "focusButton", "t", "require_photoswipe", "__commonJSMin", "exports", "module", "root", "factory", "PhotoSwipe", "template", "UiClass", "items", "options", "framework", "target", "type", "listener", "unbind", "methodName", "i", "obj", "classes", "tag", "el", "yOffset", "className", "reg", "parentEl", "childClassName", "node", "array", "value", "key", "o1", "o2", "preventOverwrite", "prop", "k", "helperEl", "helperStyle", "vendor", "features", "ua", "v", "match", "androidversion", "styleChecks", "vendors", "styleCheckItem", "styleName", "a", "lastTime", "fn", "currTime", "timeToCall", "id", "evName", "_handleEv", "self", "DOUBLE_TAP_RADIUS", "NUM_HOLDERS", "_options", "isMouseClick", "item", "_getEmptyPoint", "_isOpen", "_isDestroying", "_closedByScroll", "_currentItemIndex", "_containerStyle", "_containerShiftIndex", "_currPanDist", "_startPanOffset", "_panOffset", "_upMoveEvents", "_downEvents", "_globalEventHandlers", "_viewportSize", "_currZoomLevel", "_startZoomLevel", "_translatePrefix", "_translateSufix", "_updateSizeInterval", "_itemsNeedUpdate", "_currPositionIndex", "_offset", "_slideSize", "_itemHolders", "_prevItemIndex", "_indexDiff", "_dragStartEvent", "_dragMoveEvent", "_dragEndEvent", "_dragCancelEvent", "_transformKey", "_pointerEventEnabled", "_isFixedPosition", "_likelyTouchDevice", "_modules", "_requestAF", "_cancelAF", "_initalClassName", "_initalWindowScrollY", "_oldIE", "_currentWindowScrollY", "_features", "_windowVisibleSize", "_renderMaxResolution", "_orientationChangeTimeout", "_registerModule", "name", "_getLoopedId", "index", "numSlides", "_getNumItems", "_listeners", "_listen", "_shout", "listeners", "args", "_getCurrentTime", "_applyBgOpacity", "opacity", "_bgOpacity", "_applyZoomTransform", "styleObj", "x", "y", "zoom", "_applyCurrentZoomPan", "allowRenderResolution", "_currZoomElementStyle", "_setImageSize", "_applyZoomPanToItem", "_setTranslateX", "elStyle", "_moveMainScroll", "dragging", "newSlideIndexOffset", "delta", "_mainScrollPos", "_calculatePanOffset", "axis", "zoomLevel", "m", "_midZoomPoint", "_equalizePoints", "p1", "p2", "_roundPoint", "p", "_mouseMoveTimeout", "_onFirstMouseMove", "_bindEvents", "_unbindEvents", "_isDragging", "_calculatePanBounds", "update", "bounds", "_calculateItemSize", "_currPanBounds", "_getMinZoomLevel", "_getMaxZoomLevel", "_modifyDestPanOffset", "destPanBounds", "destPanOffset", "destZoomLevel", "_setupTransforms", "allow3dTransform", "zoomRatio", "s", "w", "h", "_onKeyDown", "e", "keydownAction", "_onGlobalClick", "_moved", "_zoomStarted", "_mainScrollAnimating", "_verticalDragInitiated", "_updatePageScrollOffset", "_animations", "_numAnimations", "_stopAnimation", "_registerStartAnimation", "_stopAllAnimations", "_animateProp", "b", "endProp", "d", "easingFn", "onUpdate", "onComplete", "startAnimTime", "t", "animloop", "publicMethods", "_isZooming", "panX", "panY", "oldPhone", "ui", "_getItemAt", "rootClasses", "_showOrHide", "_showOrHideTimeout", "_stopDragUpdateLoop", "force", "diff", "emulateSetContent", "zoomElement", "beforeAnimation", "diffAbs", "tempHolder", "prevItem", "windowScrollY", "holder", "hIndex", "centerPoint", "speed", "updateFn", "initialZoomLevel", "initialPanOffset", "now", "MIN_SWIPE_DISTANCE", "DIRECTION_CHECK_OFFSET", "_gestureStartTime", "_gestureCheckSpeedTime", "_currPoint", "_startPoint", "_currPointers", "_startMainScrollPos", "_releaseAnimData", "_posPoints", "_tempPoint", "_isZoomingIn", "_oldAndroidTouchEndTimeout", "_currZoomedItemIndex", "_centerPoint", "_lastReleaseTime", "_isMultitouch", "_dragAnimFrame", "_mainScrollShifted", "_currentPoints", "_currPointsDistance", "_startPointsDistance", "_currCenterPoint", "_direction", "_isFirstMove", "_opacityChanged", "_wasOverInitialZoom", "_isEqualPoints", "_isNearbyPoints", "touch0", "touch1", "_calculatePointsDistance", "_dragUpdateLoop", "_renderMovement", "_canPan", "_closestElement", "_preventObj", "_preventDefaultEventBehaviour", "isDown", "_convertTouchToPoint", "touch", "_findCenterOfPoints", "pCenter", "_pushPosPoint", "time", "o", "_calculateVerticalDragOpacityRatio", "_ePoint1", "_ePoint2", "_tempPointsArr", "_tempCounter", "_getTouchPoints", "_panOrMoveMainScroll", "panFriction", "overDiff", "newOffset", "startOverDiff", "dir", "newMainScrollPosition", "mainScrollDiff", "newPanPos", "newMainScrollPos", "_onDragStart", "_initialZoomRunning", "pointerIndex", "startPointsList", "numPoints", "_onDragMove", "touchesList", "pointsDistance", "_calculateZoomLevel", "zoomFriction", "minZoomLevel", "maxZoomLevel", "minusDiff", "percent", "opacityRatio", "mainScrollChanged", "_onDragRelease", "releasePoint", "MSPOINTER_TYPES", "touchList", "gestureType", "releaseTimeDiff", "_initDragReleaseAnimationData", "initalPanY", "initialBgOpacity", "itemChanged", "_finishSwipeMainScrollGesture", "_completeZoomGesture", "_completePanGesture", "lastFlickDuration", "tempReleasePos", "pos", "animData", "itemsDiff", "totalShiftDist", "isFastLastFlick", "nextCircle", "animateToX", "animateToDist", "finishAnimDuration", "touchesDistance", "destOpacity", "initialOpacity", "addEventNames", "pref", "down", "move", "up", "cancel", "img", "out", "completeFn", "_initialContentSet", "thumbBounds", "duration", "startAnimation", "closeWithRaf", "fadeEverything", "initalBgOpacity", "_items", "_tempPanAreaSize", "_imagesToAppendPool", "_controllerDefaultOptions", "_initialIsLoop", "_getZeroBounds", "_calculateSingleItemPanBounds", "realPanElementW", "realPanElementH", "viewportSize", "isInitial", "hRatio", "vRatio", "scaleMode", "_appendImage", "baseDiv", "preventAnimation", "keepPlaceholder", "_preloadImage", "_checkForError", "cleanUp", "maxRes", "_appendImagesPool", "poolItem", "isNext", "preloadBefore", "preloadAfter", "placeholderClassName", "placeholder", "tapTimer", "tapReleasePoint", "_dispatchTapEvent", "origEvent", "pointerType", "eDetail", "p0", "clickedTagName", "_wheelDelta", "onInit", "events", "hasDraggingClass", "updateZoomable", "removeDraggingClass", "newPanX", "newPanY", "doubleTapZoomLevel", "zoomOut", "_historyDefaultOptions", "_historyUpdateTimeout", "_hashChangeTimeout", "_hashAnimCheckTimeout", "_hashChangedByScript", "_hashChangedByHistory", "_hashReseted", "_initialHash", "_historyChanged", "_closedFromURL", "_urlChangedOnce", "_windowLoc", "_supportsPushState", "_getHash", "_cleanHistoryTimeouts", "_parseItemIndexFromURL", "hash", "params", "vars", "pair", "searchfor", "_updateHash", "pid", "newHash", "newURL", "returnToOriginal", "require_photoswipe_ui_default", "__commonJSMin", "exports", "module", "root", "factory", "PhotoSwipeUI_Default", "pswp", "framework", "ui", "_overlayUIUpdated", "_controlsVisible", "_fullscrenAPI", "_controls", "_captionContainer", "_fakeCaptionContainer", "_indexIndicator", "_shareButton", "_shareModal", "_shareModalHidden", "_initalCloseOnScrollValue", "_isIdle", "_listen", "_loadingIndicator", "_loadingIndicatorHidden", "_loadingIndicatorTimeout", "_galleryHasOneSlide", "_options", "_defaultUIOptions", "item", "captionEl", "_blockControlsTap", "_blockControlsTapTimeout", "_onControlsTap", "e", "_onIdleMouseMove", "target", "uiElement", "clickedClass", "found", "i", "_uiElements", "tapDelay", "_fitControlsInViewport", "_togglePswpClass", "el", "cName", "add", "_countNumItems", "hasOneSlide", "_toggleShareModalClass", "_toggleShareModal", "_updateShareURLs", "_openWindowPopup", "shareButtonOut", "shareButtonData", "shareURL", "image_url", "page_url", "share_text", "_hasCloseClass", "_idleInterval", "_idleTimer", "_idleIncrement", "_onMouseLeaveWindow", "from", "_setupFullscreenAPI", "_setupLoadingIndicator", "_toggleLoadingIndicator", "index", "hide", "_applyNavBarGaps", "gap", "bars", "captionSize", "_setupIdle", "_setupHidingControlsDuringGestures", "now", "pinchControlsHidden", "_setupUIElements", "classAttr", "loopThroughChildElements", "sChildren", "l", "a", "topBar", "point", "initialZoomLevel", "isDown", "preventObj", "t", "isIdle", "d", "dE", "api", "tF", "require_exif", "__commonJSMin", "exports", "module", "debug", "root", "EXIF", "obj", "ExifTags", "TiffTags", "GPSTags", "IFD1Tags", "StringValues", "addEvent", "element", "event", "handler", "imageHasData", "img", "base64ToArrayBuffer", "base64", "contentType", "binary", "len", "buffer", "view", "i", "objectURLToBlob", "url", "callback", "http", "e", "getImageData", "handleBinaryFile", "binFile", "data", "findEXIFinJPEG", "iptcdata", "findIPTCinJPEG", "xmpdata", "findXMPinJPEG", "arrayBuffer", "fileReader", "blob", "file", "dataView", "offset", "length", "marker", "readEXIFData", "isFieldSegmentStart", "nameHeaderLength", "startOffset", "sectionLength", "readIPTCData", "IptcFieldMap", "fieldValue", "fieldName", "dataSize", "segmentType", "segmentSize", "segmentStartPos", "getStringFromDB", "readTags", "tiffStart", "dirStart", "strings", "bigEnd", "entries", "tags", "entryOffset", "tag", "readTagValue", "type", "numValues", "valueOffset", "vals", "val", "n", "numerator", "denominator", "getNextIFDOffset", "readThumbnailImage", "firstIFDOffset", "IFD1OffsetPointer", "thumbTags", "tOffset", "tLength", "start", "outstr", "exifData", "gpsData", "tiffOffset", "dom", "xmpString", "xmpEndIndex", "indexOfXmp", "domDocument", "xml2Object", "xml2json", "xml", "json", "j", "attribute", "child", "nodeName", "old", "item", "attributes", "idx", "itemAtt", "dataKey", "dataValue", "a", "strPretty", "require_sweetalert2", "__commonJSMin", "exports", "module", "global", "factory", "consolePrefix", "uniqueArray", "arr", "result", "i", "capitalizeFirstLetter", "str", "toArray", "nodeList", "warn", "message", "error", "previousWarnOnceMessages", "warnOnce", "warnAboutDeprecation", "deprecatedParam", "useInstead", "callIfFunction", "arg", "hasToPromiseFn", "asPromise", "isPromise", "defaultParams", "updatableParams", "deprecatedParams", "toastIncompatibleParams", "isValidParameter", "paramName", "isUpdatableParameter", "isDeprecatedParameter", "checkIfParamIsValid", "param", "checkIfToastParamIsValid", "checkIfParamIsDeprecated", "showWarningsForParams", "params", "swalPrefix", "prefix", "items", "swalClasses", "iconTypes", "getContainer", "elementBySelector", "selectorString", "container", "elementByClass", "className", "getPopup", "getIcon", "getTitle", "getHtmlContainer", "getImage", "getProgressSteps", "getValidationMessage", "getConfirmButton", "getDenyButton", "getInputLabel", "getLoader", "getCancelButton", "getActions", "getFooter", "getTimerProgressBar", "getCloseButton", "focusable", "getFocusableElements", "focusableElementsWithTabindex", "a", "tabindexA", "tabindexB", "otherFocusableElements", "el", "isVisible", "isModal", "hasClass", "isToast", "isLoading", "states", "setInnerHtml", "elem", "html", "parsed", "child", "classList", "removeCustomClasses", "applyCustomClass", "addClass", "getInput", "popup", "inputType", "focusInput", "input", "val", "toggleClass", "target", "condition", "removeClass", "getDirectChildByClass", "childNodes", "applyNumericalStyle", "property", "value", "show", "display", "hide", "setStyle", "parent", "selector", "toggle", "allButtonsAreHidden", "isScrollable", "hasCssAnimation", "style", "animDuration", "transDuration", "animateTimerProgressBar", "timer", "reset", "timerProgressBar", "stopTimerProgressBar", "timerProgressBarWidth", "timerProgressBarFullWidth", "timerProgressBarPercent", "isNodeEnv", "RESTORE_FOCUS_TIMEOUT", "globalState", "focusPreviousActiveElement", "restoreActiveElement", "returnFocus", "resolve", "x", "y", "sweetHTML", "resetOldContainer", "oldContainer", "resetValidationMessage", "addInputChangeListeners", "file", "range", "rangeOutput", "select", "checkbox", "textarea", "getTarget", "setupAccessibility", "setupRTL", "targetElement", "init", "oldContainerExisted", "parseHtmlToContainer", "handleObject", "handleJqueryElem", "animationEndEvent", "testEl", "transEndEventNames", "measureScrollbar", "scrollDiv", "scrollbarWidth", "renderActions", "instance", "actions", "loader", "renderButtons", "confirmButton", "denyButton", "cancelButton", "renderButton", "handleButtonsStyling", "button", "buttonType", "handleBackdropParam", "backdrop", "handlePositionParam", "position", "handleGrowParam", "grow", "growClass", "renderContainer", "privateProps", "inputTypes", "renderInput", "innerParams", "rerender", "inputClass", "inputContainer", "setAttributes", "showInput", "setCustomClass", "renderInputType", "getInputContainer", "removeAttributes", "attrName", "inputAttributes", "attr", "setInputPlaceholder", "setInputLabel", "prependTo", "label", "labelClass", "rangeInput", "placeholder", "radio", "checkboxContainer", "getMargin", "initialPopupWidth", "textareaResizeHandler", "textareaWidth", "renderContent", "htmlContainer", "renderFooter", "footer", "renderCloseButton", "closeButton", "renderIcon", "icon", "setContent", "applyStyles", "iconType", "setColor", "adjustSuccessIconBackgroundColor", "popupBackgroundColor", "successIconParts", "successIconHtml", "errorIconHtml", "iconContent", "sel", "content", "renderImage", "image", "createStepElement", "step", "stepEl", "createLineElement", "lineEl", "renderProgressSteps", "progressStepsContainer", "index", "renderTitle", "title", "renderPopup", "addClasses", "render", "DismissReason", "setAriaHidden", "unsetAriaHidden", "swalStringParams", "getTemplateParams", "template", "templateContent", "showWarningsForElements", "getSwalParams", "getSwalButtons", "getSwalImage", "getSwalIcon", "getSwalInput", "getSwalStringParams", "showWarningsForAttributes", "type", "inputOptions", "option", "optionValue", "optionName", "paramNames", "tag", "allowedElements", "tagName", "allowedAttributes", "attribute", "defaultInputValidators", "string", "validationMessage", "setDefaultInputValidators", "key", "validateCustomTargetElement", "setParameters", "Timer", "callback", "delay", "n", "running", "fixScrollbar", "undoScrollbar", "iOSfix", "offset", "lockBodyScroll", "addBottomPaddingForTallPopups", "ua", "iOS", "webkit", "preventTouchMove", "e", "shouldPreventTouchMove", "event", "isStylus", "isZoom", "undoIOSfix", "SHOW_CLASS_TIMEOUT", "openPopup", "initialBodyOverflow", "addClasses$1", "setScrollingVisibility", "fixScrollContainer", "swalOpenAnimationFinished", "scrollbarPadding", "showLoading", "buttonToReplace", "Swal", "replaceButton", "handleInputOptionsAndValue", "handleInputOptions", "handleInputValue", "getInputValue", "getCheckboxValue", "getRadioValue", "getFileValue", "processInputOptions", "populateInputOptions", "formatInputOptions", "inputValue", "err", "renderOption", "optionLabel", "isSelected", "inputOption", "optgroup", "o", "radioValue", "radioLabel", "radioInput", "radioLabelElement", "radios", "valueFormatted", "hideLoading", "domCache", "showRelatedButton", "getInput$1", "privateMethods", "isVisible$1", "clickConfirm", "clickDeny", "clickCancel", "removeKeydownHandler", "addKeydownHandler", "dismissWith", "keydownHandler", "setFocus", "increment", "focusableElements", "arrowKeysNextButton", "arrowKeysPreviousButton", "handleEnter", "handleTab", "handleArrows", "handleEsc", "btnIndex", "sibling", "buttonToFocus", "removePopupAndResetState", "didClose", "triggerDidCloseAndDispose", "removeBodyClasses", "close", "resolveValue", "prepareResolveValue", "swalPromiseResolve", "triggerClosePopup", "handleAwaitingPromise", "isAwaitingPromise", "handlePopupAnimation", "rejectPromise", "animationIsSupported", "animatePopup", "setButtonsDisabled", "buttons", "disabled", "setInputDisabled", "enableButtons", "disableButtons", "enableInput", "disableInput", "showValidationMessage", "resetValidationMessage$1", "getProgressSteps$1", "update", "validUpdatableParams", "filterValidParams", "updatedParams", "_destroy", "disposeWeakMaps", "disposeSwal", "unsetWeakMaps", "obj", "instanceMethods", "handleConfirmButtonClick", "handleConfirmOrDenyWithInput", "confirm", "handleDenyButtonClick", "deny", "handleCancelButtonClick", "handleInputValidator", "preDenyValue", "error$$1", "rejectWith", "succeedWith", "preConfirmValue", "handlePopupClick", "handleToastClick", "handleModalMousedown", "handleContainerMousedown", "handleModalClick", "isAnyButtonShown", "ignoreOutsideClick", "isJqueryElement", "isElement", "argsToParams", "args", "name", "fire", "_len", "_key", "mixin", "mixinParams", "MixinSwal", "priorityMixinParams", "getTimerLeft", "stopTimer", "resumeTimer", "remaining", "toggleTimer", "increaseTimer", "isTimerRunning", "bodyClickListenerAdded", "clickHandlers", "bindClickHandler", "bodyClickListener", "staticMethods", "currentInstance", "SweetAlert", "outerParams", "promise", "userParams", "prepareParams", "populateDomCache", "swalPromise", "onFulfilled", "onFinally", "reject", "dismiss", "setupTimer", "initFocus", "templateParams", "globalState$$1", "blurActiveElement", "focusButton", "constructor", "data", "width", "height", "length", "QrScanner", "constructor", "video", "onDecode", "canvasSizeOrOnDecodeErrorOrOptions", "canvasSizeOrCalculateScanRegion", "preferredCamera", "DEFAULT_CANVAS_SIZE", "$video", "$canvas", "document", "createElement", "_onDecode", "console", "warn", "_legacyOnDecode", "b", "c", "_onDecodeError", "options", "onDecodeError", "_calculateScanRegion", "calculateScanRegion", "_preferredCamera", "_legacyCanvasSize", "_maxScansPerSecond", "maxScansPerSecond", "_onPlay", "bind", "_onLoadedMetaData", "_onVisibilityChange", "_updateOverlay", "disablePictureInPicture", "playsInline", "muted", "shouldHideVideo", "hidden", "body", "contains", "appendChild", "a", "highlightScanRegion", "highlightCodeOutline", "d", "$overlay", "overlay", "f", "overlayStyle", "position", "display", "pointerEvents", "classList", "add", "gotExternalOverlay", "innerHTML", "firstElementChild", "animate", "transform", "duration", "iterations", "Infinity", "direction", "easing", "e", "videoContainer", "insertBefore", "nextSibling", "insertAdjacentHTML", "$codeOutlineHighlight", "lastElementChild", "_scanRegion", "requestAnimationFrame", "m", "videoStyle", "style", "setProperty", "visibility", "opacity", "width", "height", "parentElement", "removeChild", "addEventListener", "window", "_qrEnginePromise", "createQrEngine", "workerPath", "hasCamera", "__async", "listCameras", "length", "requestLabels", "navigator", "mediaDevices", "filter", "device", "openedStream", "enumerateCameras", "every", "camera", "label", "getUserMedia", "audio", "map", "i", "id", "deviceId", "_stopVideoStream", "hasFlash", "stream", "srcObject", "MediaStream", "_getCameraStream", "getVideoTracks", "getSettings", "isFlashOn", "_flashOn", "toggleFlash", "turnFlashOff", "turnFlashOn", "_destroyed", "_active", "_paused", "applyConstraints", "advanced", "torch", "_restartVideoStream", "destroy", "removeEventListener", "stop", "_postWorkerMessage", "start", "Error", "location", "protocol", "play", "facingMode", "_setVideoMirror", "catch", "pause", "stopStreamImmediately", "stopStream", "Promise", "resolve", "setTimeout", "setCamera", "facingModeOrDeviceId", "scanImage", "imageOrFileOrBlobOrUrl", "scanRegionOrOptions", "qrEngine", "canvas", "disallowCanvasResizing", "alsoTryWithoutScanRegion", "scanRegion", "returnDetailedScanResult", "image", "canvasContext", "all", "_loadImage", "_drawToCanvas", "detailedScanResult", "Worker", "g", "gotExternalEngine", "_postWorkerMessageSync", "qrEngineWorker", "reject", "timeout", "onMessage", "onError", "expectedResponseId", "event", "data", "clearTimeout", "cornerPoints", "_convertPoints", "NO_QR_CODE_FOUND", "error", "t", "x", "k", "imageData", "buffer", "race", "scanResult", "rawValue", "l", "message", "test", "errorMessage", "_disableBarcodeDetector", "setGrayscaleWeights", "red", "green", "blue", "useIntegerApproximation", "setInversionMode", "inversionMode", "then", "createWorker", "BarcodeDetector", "getSupportedFormats", "includes", "userAgentData", "brands", "some", "brand", "platform", "getHighEntropyValues", "architecture", "platformVersion", "parseInt", "formats", "_scanFrame", "Math", "round", "videoWidth", "scanRegionSize", "y", "videoHeight", "downScaledWidth", "downScaledHeight", "h", "n", "p", "q", "videoObjectFit", "videoScaledWidth", "videoScaledHeight", "elementWidth", "elementHeight", "videoAspectRatio", "elementAspectRatio", "min", "v", "videoY", "lengthValue", "parseFloat", "endsWith", "u", "regionWidth", "regionHeight", "top", "elementY", "regionY", "left", "elementX", "isVideoMirrored", "videoX", "regionX", "points", "point", "scaleFactorX", "offsetX", "scaleFactorY", "offsetY", "paused", "ended", "requestVideoFrameCallback", "readyState", "timeSinceLastScan", "minimumTimeBetweenScans", "_lastScanTimestamp", "Date", "now", "result", "_codeOutlineHighlightRemovalTimeout", "undefined", "setAttribute", "join", "log", "constraint", "preferenceType", "exact", "constraints", "wasPaused", "track", "removeTrack", "_getFacingMode", "videoStream", "videoTrack", "scanRegionWidth", "scanRegionHeight", "canvasWidth", "canvasHeight", "alpha", "context", "imageSmoothingEnabled", "drawImage", "scanRegionX", "scanRegionY", "Image", "_awaitImageLoad", "HTMLVideoElement", "HTMLCanvasElement", "SVGImageElement", "OffscreenCanvas", "ImageBitmap", "File", "Blob", "URL", "src", "createObjectURL", "toString", "revokeObjectURL", "complete", "naturalWidth", "listener", "ErrorEvent", "qrEngineOrQrEnginePromise", "type", "transfer", "postMessage", "require_stub", "__commonJSMin", "exports", "module", "ms", "getItem", "key", "setItem", "value", "removeItem", "found", "clear", "require_parse", "__commonJSMin", "exports", "module", "parse", "rawValue", "parsed", "parseValue", "err", "require_tracking", "__commonJSMin", "exports", "module", "parse", "listeners", "listening", "listen", "change", "e", "all", "fire", "listener", "on", "key", "fn", "off", "ns", "require_local_storage", "__commonJSMin", "exports", "module", "stub", "parse", "tracking", "ls", "accessor", "key", "value", "get", "set", "raw", "e", "remove", "clear", "backend", "store", "require_mobile_detect", "__commonJSMin", "exports", "module", "define", "undefined", "impl", "hasOwnProp", "isArray", "value", "equalIC", "a", "b", "containsIC", "array", "valueLC", "i", "len", "convertPropsToRegExp", "object", "key", "prepareUserAgent", "userAgent", "values", "verPos", "mobileDetectRules", "rules", "result", "propertyName", "props", "patterns", "match", "version", "numbers", "cache", "maxPhoneWidth", "phone", "tablet", "phoneSized", "MobileDetect", "t", "$isMobile", "ua", "pattern", "factory", "require_caret_string", "__commonJSMin", "exports", "CaretString", "str", "caretPosition", "require_next", "__commonJSMin", "exports", "Next", "state", "insert", "pass", "value", "require_notation", "__commonJSMin", "exports", "Notation", "character", "characterSet", "isOptional", "require_isNull", "__commonJSMin", "exports", "isNull", "value", "require_state", "__commonJSMin", "exports", "isNull_1", "State", "child", "require_e_o_l_state", "__commonJSMin", "exports", "state_1", "EOLState", "child", "character", "require_fixed_state", "__commonJSMin", "exports", "state_1", "next_1", "isNull_1", "FixedState", "child", "ownCharacter", "character", "require_free_state", "__commonJSMin", "exports", "state_1", "next_1", "isNull_1", "FreeState", "child", "ownCharacter", "character", "require_string", "__commonJSMin", "exports", "char", "another", "endIndex", "require_optional_value_state", "__commonJSMin", "exports", "state_1", "next_1", "isNull_1", "OptionalValueState", "_OptionalValueState", "child", "type", "character", "StateType", "Literal", "Numeric", "AlphaNumeric", "Ellipsis", "inheritedType", "Custom", "characterSet", "require_value_state", "__commonJSMin", "exports", "state_1", "next_1", "isNull_1", "ValueState", "_ValueState", "child", "type", "character", "StateType", "Literal", "Numeric", "AlphaNumeric", "Ellipsis", "inheritedType", "Custom", "characterSet", "require_model", "__commonJSMin", "exports", "__export", "m", "p", "require_affinity_calculation_strategy", "__commonJSMin", "exports", "model_1", "AffinityCalculationStrategy", "AffinityCalculation", "strategy", "mask", "text", "autocomplete", "require_format_sanitizer", "__commonJSMin", "exports", "FormatSanitizer", "_FormatSanitizer", "formatString", "blocks", "e", "currentBlock", "escape", "char", "resultingBlocks", "block", "blockBuffer", "blockCharacter", "sortedBlocks", "sortedBlock", "str", "squareBraceOpen", "curlyBraceOpen", "require_compiler", "__commonJSMin", "exports", "model_1", "format_sanitizer_1", "Compiler", "customNotations", "formatString", "sanitizedString", "e", "valuable", "fixed", "lastCharacter", "char", "str", "notation", "x", "require_caret_string_iterator", "__commonJSMin", "exports", "CaretStringIterator", "caretString", "currentIndex", "char", "require_mask", "__commonJSMin", "exports", "model_1", "compiler_1", "caret_string_iterator_1", "Mask", "_Mask", "format", "customNotations", "cachedMask", "text", "autocomplete", "iterator", "affinity", "extractedValue", "modifiedString", "modifiedCaretPosition", "state", "beforeCaret", "character", "next", "nxt", "length", "placeholder", "Result", "formattedText", "complete", "require_mask_affinity", "__commonJSMin", "exports", "MaskAffinity", "mask", "affinity", "require_masked_text_changed_listener", "__commonJSMin", "exports", "model_1", "affinity_calculation_strategy_1", "mask_1", "mask_affinity_1", "MaskedTextChangedListener", "_MaskedTextChangedListener", "primaryFormat", "field", "listener", "affineFormats", "customNotations", "affinityCalculationStrategy", "autocomplete", "ev", "text", "result", "caretPosition", "primaryAffinity", "maskAndAffinities", "format", "mask", "affinity", "a", "b", "insertIndex", "maskAffinity", "index", "hasFocus", "event", "isDeletion", "isInside", "require_dist", "__commonJSMin", "exports", "__export", "m", "p", "extendStatics", "d", "b", "p", "__extends", "__", "__decorate", "decorators", "target", "key", "desc", "c", "r", "d", "i", "__awaiter", "thisArg", "_arguments", "P", "generator", "adopt", "value", "resolve", "reject", "fulfilled", "step", "e", "rejected", "result", "__generator", "body", "_", "t", "f", "y", "g", "verb", "n", "v", "op", "__values", "o", "s", "m", "__read", "n", "r", "ar", "e", "error", "__spreadArray", "to", "from", "pack", "l", "ar", "__await", "v", "__asyncGenerator", "thisArg", "_arguments", "generator", "g", "i", "q", "verb", "awaitReturn", "f", "reject", "n", "a", "b", "resume", "step", "e", "settle", "r", "fulfill", "value", "__asyncValues", "o", "m", "i", "__values", "verb", "n", "v", "resolve", "reject", "settle", "d", "Map", "key", "value", "ModuleName", "aliasName", "orgName", "target", "AxLoad", "AxLoad_1", "name", "init", "alias", "callLoaded", "moduleInstance", "module", "modules", "timeout", "tmp", "Map", "__decorate", "ModuleName", "AxAlert", "selector", "e", "AxButton", "btn", "$btn", "AxPortletExpandable", "i", "x", "$portlet", "i2", "button", "options", "onOpen", "onClose", "selector", "callback", "div", "event", "AxTab", "selector", "i", "e", "$e", "startTarget", "holder", "AxTabListener", "c", "targetName", "active", "tabHolders", "x", "y", "tabHolder", "$menu", "currentTarget", "contentTarget", "event", "target", "AxLimeStone", "_AxButton", "AxButton", "_AxPortletExpandable", "AxPortletExpandable", "portletTabHandler", "AxTab", "event", "selector", "AxAlert", "currentValue", "currentIndex", "listObj", "__decorate", "ModuleName", "isObject", "obj", "extend", "target", "src", "key", "ssrDocument", "getDocument", "doc", "ssrWindow", "callback", "id", "getWindow", "win", "_inheritsLoose", "subClass", "superClass", "_getPrototypeOf", "o", "_setPrototypeOf", "p", "_isNativeReflectConstruct", "e", "_construct", "Parent", "args", "Class", "a", "Constructor", "instance", "_isNativeFunction", "fn", "_wrapNativeSuper", "_cache", "Wrapper", "_assertThisInitialized", "self", "makeReactive", "obj", "proto", "value", "Dom7", "_Array", "items", "_this", "arrayFlat", "arr", "res", "el", "arrayFilter", "callback", "arrayUnique", "uniqueArray", "i", "qsa", "selector", "context", "a", "res", "i", "$", "window", "getWindow", "document", "getDocument", "arr", "Dom7", "html", "toCreate", "tempParent", "arrayUnique", "addClass", "_len", "classes", "_key", "classNames", "arrayFlat", "c", "el", "_el$classList", "removeClass", "_len2", "_key2", "_el$classList2", "toggleClass", "_len3", "_key3", "className", "hasClass", "_len4", "_key4", "arrayFilter", "attr", "attrs", "value", "attrName", "removeAttr", "transform", "i", "transition", "duration", "on", "_len5", "args", "_key5", "eventType", "targetSelector", "listener", "capture", "handleLiveEvent", "e", "target", "eventData", "$", "_parents", "k", "handleEvent", "events", "j", "el", "_event", "event", "off", "_len6", "_key6", "handlers", "handler", "trigger", "window", "getWindow", "_len9", "args", "_key9", "events", "eventData", "i", "event", "j", "el", "evt", "data", "dataIndex", "transitionEnd", "callback", "dom", "fireCallBack", "e", "outerWidth", "includeMargins", "_styles", "outerHeight", "includeMargins", "_styles2", "offset", "window", "getWindow", "document", "getDocument", "el", "box", "body", "clientTop", "clientLeft", "scrollTop", "scrollLeft", "styles", "window", "getWindow", "css", "props", "value", "_prop", "each", "callback", "el", "index", "filter", "result", "arrayFilter", "$", "html", "i", "text", "is", "selector", "document", "getDocument", "compareWith", "Dom7", "child", "eq", "length", "returnIndex", "append", "newChild", "k", "tempDiv", "j", "prepend", "newChild", "document", "getDocument", "i", "j", "tempDiv", "Dom7", "next", "selector", "$", "nextAll", "nextEls", "el", "_next", "prev", "prevAll", "prevEls", "_prev", "parent", "selector", "parents", "i", "$", "_parent", "closest", "find", "foundElements", "found", "j", "children", "childNodes", "remove", "noTrigger", "shortcut", "name", "eventHandler", "_len", "args", "_key", "i", "$", "click", "blur", "focus", "focusin", "focusout", "keyup", "keydown", "keypress", "submit", "change", "mousedown", "mousemove", "mouseup", "mouseenter", "mouseleave", "mouseout", "mouseover", "touchstart", "touchend", "touchmove", "resize", "scroll", "Methods", "addClass", "removeClass", "hasClass", "toggleClass", "attr", "removeAttr", "transform", "transition", "on", "off", "trigger", "transitionEnd", "outerWidth", "outerHeight", "styles", "offset", "css", "each", "html", "text", "is", "index", "eq", "append", "prepend", "next", "nextAll", "prev", "prevAll", "parent", "parents", "closest", "find", "children", "filter", "remove", "methodName", "$", "dom_default", "deleteProps", "obj", "object", "key", "e", "nextTick", "callback", "delay", "now", "getComputedStyle", "el", "window", "getWindow", "style", "getTranslate", "axis", "matrix", "curTransform", "transformMatrix", "curStyle", "a", "isObject", "o", "isNode", "node", "extend", "to", "noExtend", "i", "nextSource", "keysArray", "nextIndex", "len", "nextKey", "desc", "bindModuleMethods", "instance", "subKey", "classesToSelector", "classes", "createElementIfNotDefined", "$container", "params", "createElements", "checkProps", "document", "getDocument", "element", "support", "calcSupport", "window", "getWindow", "document", "getDocument", "supportsPassive", "opts", "e", "getSupport", "device", "calcDevice", "_temp", "_ref", "userAgent", "support", "getSupport", "window", "getWindow", "platform", "ua", "screenWidth", "screenHeight", "android", "ipad", "ipod", "iphone", "windows", "macos", "iPadScreens", "getDevice", "overrides", "browser", "calcBrowser", "window", "getWindow", "isSafari", "ua", "getBrowser", "supportsResizeObserver", "window", "getWindow", "resize_default", "swiper", "extend", "entries", "width", "height", "newWidth", "newHeight", "_ref", "contentBoxSize", "contentRect", "target", "_extends", "target", "i", "source", "key", "Observer", "options", "window", "getWindow", "swiper", "ObserverFunc", "observer", "mutations", "observerUpdate", "containerParents", "observer_default", "bindModuleMethods", "modular_default", "instanceParams", "instance", "moduleName", "module", "extend", "modulesParams", "moduleParams", "moduleEventName", "events_emitter_default", "events", "handler", "priority", "self", "method", "event", "onceHandler", "_len", "args", "_key", "index", "eventHandler", "data", "context", "_len2", "_key2", "eventsArray", "updateSize", "swiper", "width", "height", "$el", "extend", "updateSlides", "swiper", "getDirectionLabel", "property", "getDirectionPropertyValue", "node", "label", "params", "$wrapperEl", "swiperSize", "rtl", "wrongRTL", "isVirtual", "previousSlidesLength", "slides", "slidesLength", "snapGrid", "slidesGrid", "slidesSizesGrid", "offsetBefore", "offsetAfter", "previousSnapGridLength", "previousSlidesGridLength", "spaceBetween", "slidePosition", "prevSlideSize", "index", "slidesNumberEvenToRows", "slideSize", "slidesPerColumn", "slidesPerRow", "numFullColumns", "i", "slide", "newSlideOrderIndex", "column", "row", "groupIndex", "slideIndexInGroup", "columnsInGroup", "slideStyles", "currentTransform", "currentWebKitTransform", "width", "paddingLeft", "paddingRight", "marginLeft", "marginRight", "boxSizing", "_slide$", "clientWidth", "offsetWidth", "newSlidesGrid", "_$wrapperEl$css", "_$wrapperEl$css2", "_i", "slidesGridItem", "_i2", "_slidesGridItem", "_slides$filter$css", "key", "_", "slideIndex", "allSlidesSize", "slideSizeValue", "maxSnap", "snap", "_allSlidesSize", "allSlidesOffset", "snapIndex", "extend", "updateAutoHeight", "speed", "swiper", "activeSlides", "isVirtual", "newHeight", "i", "getSlideByIndex", "index", "el", "slide", "height", "updateSlidesOffset", "swiper", "slides", "i", "updateSlidesProgress", "translate", "swiper", "params", "slides", "rtl", "offsetCenter", "i", "slide", "slideProgress", "slideBefore", "slideAfter", "isVisible", "dom_default", "updateProgress", "translate", "swiper", "multiplier", "params", "translatesDiff", "progress", "isBeginning", "isEnd", "wasBeginning", "wasEnd", "extend", "updateSlidesClasses", "swiper", "slides", "params", "$wrapperEl", "activeIndex", "realIndex", "isVirtual", "activeSlide", "nextSlide", "prevSlide", "updateActiveIndex", "newActiveIndex", "swiper", "translate", "slidesGrid", "snapGrid", "params", "previousIndex", "previousRealIndex", "previousSnapIndex", "activeIndex", "snapIndex", "i", "skip", "realIndex", "extend", "updateClickedSlide", "e", "swiper", "params", "slide", "dom_default", "slideFound", "slideIndex", "i", "update_default", "updateSize", "updateSlides", "updateAutoHeight", "updateSlidesOffset", "updateSlidesProgress", "updateProgress", "updateSlidesClasses", "updateActiveIndex", "updateClickedSlide", "getSwiperTranslate", "axis", "swiper", "params", "rtl", "translate", "$wrapperEl", "currentTranslate", "getTranslate", "setTranslate", "translate", "byController", "swiper", "rtl", "params", "$wrapperEl", "wrapperEl", "progress", "x", "y", "z", "newProgress", "translatesDiff", "minTranslate", "maxTranslate", "translateTo", "translate", "speed", "runCallbacks", "translateBounds", "internal", "swiper", "params", "wrapperEl", "minTranslate", "maxTranslate", "newTranslate", "isH", "_wrapperEl$scrollTo", "e", "translate_default", "getSwiperTranslate", "setTranslate", "minTranslate", "maxTranslate", "translateTo", "setTransition", "duration", "byController", "swiper", "transitionStart", "runCallbacks", "direction", "swiper", "activeIndex", "params", "previousIndex", "dir", "transitionEnd", "runCallbacks", "direction", "swiper", "activeIndex", "previousIndex", "params", "dir", "transition_default", "setTransition", "transitionStart", "transitionEnd", "slideTo", "index", "speed", "runCallbacks", "internal", "initial", "indexAsNumber", "isValidNumber", "swiper", "slideIndex", "params", "snapGrid", "slidesGrid", "previousIndex", "activeIndex", "rtl", "wrapperEl", "enabled", "skip", "snapIndex", "translate", "i", "normalizedTranslate", "normalizedGird", "normalizedGridNext", "direction", "isH", "t", "_wrapperEl$scrollTo", "e", "slideToLoop", "index", "speed", "runCallbacks", "internal", "swiper", "newIndex", "slideNext", "speed", "runCallbacks", "internal", "swiper", "params", "animating", "enabled", "increment", "slidePrev", "speed", "runCallbacks", "internal", "swiper", "params", "animating", "snapGrid", "slidesGrid", "rtlTranslate", "enabled", "translate", "normalize", "val", "normalizedTranslate", "normalizedSnapGrid", "prevSnap", "snap", "prevIndex", "slideReset", "speed", "runCallbacks", "internal", "swiper", "slideToClosest", "speed", "runCallbacks", "internal", "threshold", "swiper", "index", "skip", "snapIndex", "translate", "currentSnap", "nextSnap", "prevSnap", "_currentSnap", "slideToClickedSlide", "swiper", "params", "$wrapperEl", "slidesPerView", "slideToIndex", "realIndex", "dom_default", "nextTick", "slide_default", "slideTo", "slideToLoop", "slideNext", "slidePrev", "slideReset", "slideToClosest", "slideToClickedSlide", "loopCreate", "swiper", "document", "getDocument", "params", "$wrapperEl", "slides", "blankSlidesNum", "i", "blankNode", "dom_default", "prependSlides", "appendSlides", "el", "index", "slide", "_i", "_i2", "loopFix", "swiper", "activeIndex", "slides", "loopedSlides", "allowSlidePrev", "allowSlideNext", "snapGrid", "rtl", "newIndex", "snapTranslate", "diff", "slideChanged", "_slideChanged", "loopDestroy", "swiper", "$wrapperEl", "params", "slides", "loop_default", "loopCreate", "loopFix", "loopDestroy", "setGrabCursor", "moving", "swiper", "el", "unsetGrabCursor", "swiper", "grab_cursor_default", "setGrabCursor", "unsetGrabCursor", "appendSlide", "slides", "swiper", "$wrapperEl", "params", "i", "prependSlide", "slides", "swiper", "params", "$wrapperEl", "activeIndex", "newActiveIndex", "i", "addSlide", "index", "slides", "swiper", "$wrapperEl", "params", "activeIndex", "activeIndexBuffer", "baseLength", "newActiveIndex", "slidesBuffer", "i", "currentSlide", "_i", "_i2", "removeSlide", "slidesIndexes", "swiper", "params", "$wrapperEl", "activeIndex", "activeIndexBuffer", "newActiveIndex", "indexToRemove", "i", "removeAllSlides", "swiper", "slidesIndexes", "i", "manipulation_default", "appendSlide", "prependSlide", "addSlide", "removeSlide", "removeAllSlides", "closestElement", "selector", "base", "__closestFrom", "el", "getDocument", "getWindow", "found", "onTouchStart", "event", "swiper", "document", "window", "data", "params", "touches", "enabled", "e", "$targetEl", "dom_default", "swipingClassHasValue", "noSwipingSelector", "isTargetShadow", "startX", "startY", "edgeSwipeDetection", "edgeSwipeThreshold", "extend", "now", "preventDefault", "shouldPreventDefault", "onTouchMove", "event", "document", "getDocument", "swiper", "data", "params", "touches", "rtl", "enabled", "e", "targetTouch", "pageX", "pageY", "extend", "now", "dom_default", "diffX", "diffY", "touchAngle", "diff", "disableParentSwiper", "resistanceRatio", "onTouchEnd", "event", "swiper", "data", "params", "touches", "rtl", "$wrapperEl", "slidesGrid", "snapGrid", "enabled", "e", "touchEndTime", "now", "timeDiff", "nextTick", "currentPos", "lastMoveEvent", "velocityEvent", "distance", "time", "momentumDuration", "momentumDistance", "newPosition", "doBounce", "afterBouncePosition", "bounceAmount", "needsLoopFix", "nextSlide", "j", "moveDistance", "currentSlideSize", "stopIndex", "groupSize", "i", "_increment", "ratio", "increment", "isNavButtonTarget", "onResize", "swiper", "params", "el", "allowSlideNext", "allowSlidePrev", "snapGrid", "onClick", "e", "swiper", "onScroll", "swiper", "wrapperEl", "rtlTranslate", "enabled", "newProgress", "translatesDiff", "dummyEventAttached", "dummyEventListener", "attachEvents", "swiper", "document", "getDocument", "params", "touchEvents", "el", "wrapperEl", "device", "support", "onTouchStart", "onTouchMove", "onTouchEnd", "onScroll", "onClick", "capture", "passiveListener", "onResize", "detachEvents", "events_default", "setBreakpoint", "swiper", "activeIndex", "initialized", "_swiper$loopedSlides", "loopedSlides", "params", "$el", "breakpoints", "breakpoint", "breakpointOnlyParams", "param", "paramValue", "breakpointParams", "wasMultiRow", "isMultiRow", "wasEnabled", "directionChanged", "needsReLoop", "extend", "isEnabled", "getBreakpoint", "breakpoints", "base", "containerEl", "breakpoint", "window", "getWindow", "currentHeight", "points", "point", "minRatio", "value", "a", "b", "i", "_points$i", "breakpoints_default", "setBreakpoint", "getBreakpoint", "prepareClasses", "entries", "prefix", "resultClasses", "item", "classNames", "addClasses", "swiper", "params", "rtl", "$el", "device", "support", "suffixes", "removeClasses", "swiper", "$el", "classNames", "classes_default", "addClasses", "removeClasses", "loadImage", "imageEl", "src", "srcset", "sizes", "checkForComplete", "callback", "window", "getWindow", "image", "onReady", "isPicture", "dom_default", "preloadImages", "swiper", "onReady", "i", "imageEl", "images_default", "loadImage", "preloadImages", "checkOverflow", "swiper", "params", "wasLocked", "lastSlidePosition", "check_overflow_default", "defaults_default", "_defineProperties", "target", "props", "i", "descriptor", "_createClass", "Constructor", "protoProps", "staticProps", "prototypes", "modular_default", "events_emitter_default", "update_default", "translate_default", "transition_default", "slide_default", "loop_default", "grab_cursor_default", "manipulation_default", "events_default", "breakpoints_default", "check_overflow_default", "classes_default", "images_default", "extendedDefaults", "Swiper", "el", "params", "_len", "args", "_key", "extend", "dom_default", "swipers", "containerEl", "newParams", "swiper", "getSupport", "getDevice", "getBrowser", "moduleName", "module", "moduleParamName", "moduleParams", "swiperParams", "defaults_default", "eventName", "touch", "desktop", "now", "_proto", "progress", "speed", "min", "max", "current", "classes", "className", "slideEl", "updates", "classNames", "slides", "slidesGrid", "swiperSize", "activeIndex", "spv", "slideSize", "breakLoop", "_i", "_i2", "snapGrid", "setTranslate", "translateValue", "newTranslate", "translated", "newDirection", "needUpdate", "currentDirection", "$el", "getWrapperSelector", "getWrapper", "res", "options", "$wrapperEl", "document", "getDocument", "wrapper", "mounted", "deleteInstance", "cleanStyles", "deleteProps", "newDefaults", "name", "m", "prototypeGroup", "protoMethod", "resize_default", "observer_default", "core_class_default", "_extends", "target", "i", "source", "key", "Navigation", "$el", "disabled", "swiper", "params", "toggleEl", "_swiper$navigation", "$nextEl", "$prevEl", "createElementIfNotDefined", "dom_default", "extend", "_swiper$navigation2", "navigation_default", "bindModuleMethods", "_swiper$navigation3", "e", "_swiper$navigation4", "targetEl", "isHidden", "_extends", "target", "i", "source", "key", "Pagination", "swiper", "rtl", "params", "slidesLength", "$el", "current", "total", "bullets", "firstIndex", "lastIndex", "midIndex", "bullet", "$bullet", "dom_default", "bulletIndex", "$firstDisplayedBullet", "$lastDisplayedBullet", "_i", "dynamicBulletsLength", "bulletsOffset", "offsetProp", "classesToSelector", "progressbarDirection", "scale", "scaleX", "scaleY", "paginationHTML", "numberOfBullets", "createElementIfNotDefined", "e", "index", "extend", "pagination_default", "number", "bindModuleMethods", "targetEl", "isHidden", "basicLightbox", "core_class_default", "navigation_default", "pagination_default", "AxProdDetail", "init", "observer", "e", "count", "changeMediaPoint", "topFunction", "scrollFunction", "setIndex", "contentCount", "numb", "imageContainer", "videoContainer", "imageContainerModal", "videoContainerModal", "modal", "modalClose", "modalExpand", "modalCount", "bslContentModal", "i", "bslContent", "scrollBtn", "html", "outer", "btnClose", "ele", "clonedNode", "instance", "setupVidControlsModal", "bslightbox", "figure", "styleUri", "setupVidControls", "placeholder", "container", "video", "videoControls", "playpause", "stop", "mute", "volinc", "voldec", "progress", "progressBar", "fullscreen", "alterVolume", "rect", "pos", "handleFullscreen", "dir", "currentVolume", "setFullscreenData", "state", "stateString", "__decorate", "ModuleName", "defaults", "warn", "msg", "_typeof", "obj", "classCallCheck", "instance", "Constructor", "createClass", "defineProperties", "target", "props", "descriptor", "protoProps", "staticProps", "_extends", "i", "source", "key", "get", "object", "property", "receiver", "desc", "parent", "getter", "inherits", "subClass", "superClass", "possibleConstructorReturn", "self", "call", "toInt", "value", "toFloat", "isString", "isObject", "type", "isNumber", "isFunction", "isUndefined", "isArray", "mount", "glide", "extensions", "events", "components", "name", "_name", "define", "prop", "definition", "sortKeys", "r", "k", "mergeOptions", "settings", "options", "EventsBus", "event", "handler", "index", "context", "item", "Glide", "selector", "transformers", "pattern", "distance", "interval", "o", "status", "Run", "Components", "Events", "move", "_this", "length", "steps", "direction", "countableSteps", "step", "now", "throttle", "func", "wait", "timeout", "args", "result", "previous", "later", "throttled", "at", "remaining", "MARGIN_TYPE", "Gaps", "slides", "len", "style", "perView", "siblings", "node", "n", "matched", "exist", "TRACK_SELECTOR", "Html", "slide", "t", "Peek", "Move", "offset", "translate", "Sizes", "width", "dimention", "Build", "classes", "sibling", "Clones", "items", "_Glide$settings", "peekIncrementer", "part", "start", "end", "clone", "_i", "_clone", "_Components$Html", "wrapper", "half", "prepend", "append", "_i2", "_i3", "EventsBinder", "listeners", "el", "closure", "capture", "Resize", "Binder", "VALID_DIRECTIONS", "FLIPED_MOVEMENTS", "Direction", "token", "Rtl", "Gap", "Grow", "Peeking", "peek", "Focusing", "gap", "focusAt", "slideWidth", "mutator", "TRANSFORMERS", "transformer", "Translate", "transform", "Transition", "disabled", "callback", "supportsPassive", "opts", "e", "supportsPassive$1", "START_EVENTS", "MOVE_EVENTS", "END_EVENTS", "MOUSE_EVENTS", "Swipe", "swipeSin", "swipeStartX", "swipeStartY", "swipe", "touchAngle", "touchRatio", "subExSx", "subEySy", "powEX", "powEY", "swipeHypotenuse", "swipeCathetus", "threshold", "swipeDistance", "swipeDeg", "_this2", "_this3", "Images", "Anchors", "detached", "prevented", "NAV_SELECTOR", "CONTROLS_SELECTOR", "Controls", "controls", "elements", "Keyboard", "Autoplay", "autoplay", "sortBreakpoints", "points", "Breakpoints", "point", "COMPONENTS", "Glide$1", "_Core", "Glide$$1", "glide_esm_default", "AxProdMain", "glide", "Components", "Events", "PREV_CONTROL_SELECTOR", "NEXT_CONTROL_SELECTOR", "component", "perView", "slidesCount", "init", "i", "x", "glideID", "rows", "glide_esm_default", "e", "__decorate", "ModuleName", "ProductMapper", "productList", "personTypes", "prod", "positions", "I18nHelper", "_I18nHelper", "trans", "key", "args", "Translations", "substring", "_a", "Map", "AxProgressBar", "options", "step", "outer", "icon", "label", "isOverflow", "currentActiveIndex", "x", "firstInactive", "startIndexDif", "firstInactiveEnd", "endIndexDif", "stepToShow", "reverseSteps", "stepToRemove", "element", "ProgressBar", "i18nHelper", "I18nHelper", "initData", "progressBar", "AxProgressBar", "count", "steps", "ProgressBarMode", "AxLoad", "x", "step", "Translations", "isString", "obj", "defer", "res", "rej", "promise", "resolve", "reject", "makeString", "object", "copy", "a", "s", "m", "lastOfPathSeparatorRegExp", "cleanKey", "key", "canNotTraverseDeeper", "getLastOfPath", "path", "Empty", "stack", "stackIndex", "setPath", "newValue", "k", "e", "p", "last", "pushPath", "concat", "getPath", "getPathWithDefaults", "data", "defaultData", "value", "deepExtend", "target", "source", "overwrite", "prop", "regexEscape", "str", "_entityMap", "escape", "RegExpCache", "capacity", "pattern", "regExpFromCache", "regExpNew", "chars", "looksLikeObjectPathRegExpCache", "looksLikeObjectPath", "nsSeparator", "keySeparator", "possibleChars", "c", "r", "matched", "ki", "deepFind", "tokens", "current", "i", "next", "nextPath", "j", "getCleanedCode", "code", "consoleLogger", "args", "type", "Logger", "_Logger", "concreteLogger", "options", "_len", "_key", "_len2", "_key2", "_len3", "_key3", "_len4", "_key4", "lvl", "prefix", "debugOnly", "moduleName", "__spreadValues", "baseLogger", "EventEmitter", "events", "listener", "event", "numListeners", "_ref", "observer", "numTimesAdded", "_ref2", "ResourceStore", "ns", "index", "lng", "ignoreJSONStructure", "result", "resources", "deep", "pack", "v", "postProcessor", "module", "processors", "translator", "processor", "checkedLoadedFor", "Translator", "_Translator", "services", "resolved", "namespaces", "wouldCheckForNsInKey", "seemsNaturalLanguage", "parts", "keys", "lastKey", "returnDetails", "namespace", "appendNamespaceToCIMode", "resUsedKey", "resExactUsedKey", "resType", "noObject", "joinArrays", "handleAsObjectInI18nFormat", "handleAsObject", "__spreadProps", "resTypeIsArray", "newKeyToUse", "deepKey", "usedDefault", "usedKey", "needsPluralHandling", "hasDefaultValue", "defaultValueSuffix", "defaultValueSuffixOrdinalFallback", "needsZeroSuffixLookup", "defaultValue", "resForMissing", "updateMissing", "fk", "lngs", "fallbackLngs", "send", "l", "specificDefaultValue", "defaultForMissing", "language", "suffixes", "suffix", "_this", "skipOnVariables", "nestBef", "nb", "na", "nestAft", "postProcess", "postProcessorNames", "found", "exactUsedKey", "usedLng", "usedNS", "extracted", "needsContextHandling", "codes", "finalKeys", "pluralSuffix", "zeroSuffix", "ordinalPrefix", "contextKey", "possibleKey", "optionsKeys", "useOptionsReplaceForData", "option", "capitalize", "string", "LanguageUtil", "formattedCode", "specialCases", "part", "cleanedLng", "lngOnly", "supportedLng", "fallbacks", "fallbackCode", "fallbackCodes", "addCode", "fc", "sets", "_rulesPluralsTypes", "n", "nonIntlVersions", "intlVersions", "suffixesOrder", "createRules", "rules", "set", "PluralResolver", "languageUtils", "cleanedCode", "cacheKey", "rule", "err", "lngPart", "pluralCategory1", "pluralCategory2", "pluralCategory", "number", "count", "idx", "returnSuffix", "deepFindWithDefaults", "regexSafe", "val", "Interpolator", "escape$1", "escapeValue", "useRawValueToEscape", "prefixEscaped", "suffixEscaped", "formatSeparator", "unescapeSuffix", "unescapePrefix", "nestingPrefix", "nestingPrefixEscaped", "nestingSuffix", "nestingSuffixEscaped", "nestingOptionsSeparator", "maxReplaces", "alwaysFormat", "getOrResetRegExp", "existingRegExp", "match", "replaces", "handleFormat", "f", "missingInterpolationHandler", "todo", "matchedVar", "temp", "safeValue", "clonedOptions", "handleHasOptions", "inheritedOptions", "sep", "optionsString", "matchedSingleQuotes", "matchedDoubleQuotes", "formatters", "doReduce", "elem", "parseFormatStr", "formatStr", "formatName", "formatOptions", "optStr", "opt", "rest", "trimmedKey", "createCachedFormatter", "fn", "cache", "optForCache", "formatter", "Formatter", "name", "format", "formats", "lastIndex", "mem", "formatted", "valOptions", "error", "removePending", "q", "Connector", "backend", "store", "languages", "callback", "toLoad", "pending", "toLoadLanguages", "toLoadNamespaces", "hasAllNamespaces", "loaded", "loadedKeys", "fcName", "tried", "wait", "resolver", "fallbackValue", "isUpdate", "clb", "opts", "get", "ret", "transformOptions", "noop", "bindMemberFunctions", "inst", "I18n", "_I18n", "defOpts", "createClassOnDemand", "ClassOrObject", "lu", "deferred", "load", "finish", "t", "usedCallback", "append", "li", "lngInLngs", "_this2", "setLngProps", "done", "setLng", "keyPrefix", "_this3", "fixedT", "resultKey", "fallbackLng", "lastLng", "loadNotPending", "loadState", "preResult", "preloaded", "newLngs", "rtlLngs", "forkResourceStore", "mergedOptions", "clone", "instance", "createInstance", "dir", "init", "loadResources", "reloadResources", "use", "changeLanguage", "getFixedT", "exists", "setDefaultNamespace", "hasLoadedNamespace", "loadNamespaces", "loadLanguages", "en_default", "defaultNS", "instance", "en_default", "i18n_default", "JQElementHelper", "$parent", "func", "elem", "AxDropdownInteraction", "options", "$parent", "$target", "$popperElem", "isHero", "value", "results", "index", "i18n_default", "hasMultiSelect", "tippyInstance", "popperInstance", "currentValue", "Direction", "_a", "_b", "$popperElement", "retVal", "elem", "isMultiSelect", "$selection", "val", "option", "disabled", "$option", "newValue", "existingAttr", "$singleTarget", "lineText", "$hero", "$newLabel", "i", "items", "$existingLabel", "targetId", "$label", "targetSelected", "isFunction", "value", "createErrorClass", "createImpl", "_super", "instance", "ctorFunc", "UnsubscriptionError", "createErrorClass", "_super", "errors", "err", "i", "arrRemove", "arr", "item", "index", "Subscription", "initialTeardown", "errors", "_parentage", "_parentage_1", "__values", "_parentage_1_1", "parent_1", "initialFinalizer", "isFunction", "e", "UnsubscriptionError", "_finalizers", "_finalizers_1", "_finalizers_1_1", "finalizer", "execFinalizer", "err", "__spreadArray", "__read", "teardown", "_a", "parent", "arrRemove", "empty", "EMPTY_SUBSCRIPTION", "Subscription", "isSubscription", "value", "isFunction", "execFinalizer", "finalizer", "config", "timeoutProvider", "handler", "timeout", "args", "_i", "delegate", "__spreadArray", "__read", "handle", "reportUnhandledError", "err", "timeoutProvider", "onUnhandledError", "config", "noop", "COMPLETE_NOTIFICATION", "createNotification", "errorNotification", "error", "nextNotification", "value", "kind", "context", "errorContext", "cb", "config", "isRoot", "_a", "errorThrown", "error", "captureError", "err", "Subscriber", "_super", "__extends", "destination", "_this", "isSubscription", "EMPTY_OBSERVER", "next", "error", "complete", "SafeSubscriber", "value", "handleStoppedNotification", "nextNotification", "err", "errorNotification", "COMPLETE_NOTIFICATION", "Subscription", "_bind", "bind", "fn", "thisArg", "ConsumerObserver", "partialObserver", "value", "error", "handleUnhandledError", "err", "SafeSubscriber", "_super", "__extends", "observerOrNext", "complete", "_this", "isFunction", "context_1", "config", "Subscriber", "handleUnhandledError", "error", "config", "captureError", "reportUnhandledError", "defaultErrorHandler", "err", "handleStoppedNotification", "notification", "subscriber", "onStoppedNotification", "timeoutProvider", "EMPTY_OBSERVER", "noop", "observable", "identity", "x", "pipeFromArray", "fns", "identity", "input", "prev", "fn", "Observable", "subscribe", "operator", "observable", "observerOrNext", "error", "complete", "_this", "subscriber", "isSubscriber", "SafeSubscriber", "errorContext", "_a", "source", "sink", "err", "next", "promiseCtor", "getPromiseCtor", "resolve", "reject", "value", "operations", "_i", "pipeFromArray", "x", "getPromiseCtor", "promiseCtor", "_a", "config", "isObserver", "value", "isFunction", "isSubscriber", "Subscriber", "isSubscription", "hasLift", "source", "isFunction", "operate", "init", "liftedSource", "err", "createOperatorSubscriber", "destination", "onNext", "onComplete", "onError", "onFinalize", "OperatorSubscriber", "_super", "__extends", "shouldUnsubscribe", "_this", "value", "err", "closed_1", "_a", "Subscriber", "ObjectUnsubscribedError", "createErrorClass", "_super", "Subject", "_super", "__extends", "_this", "operator", "subject", "AnonymousSubject", "ObjectUnsubscribedError", "value", "errorContext", "_b", "__values", "_c", "observer", "err", "observers", "_a", "subscriber", "hasError", "isStopped", "EMPTY_SUBSCRIPTION", "Subscription", "arrRemove", "thrownError", "observable", "Observable", "destination", "source", "AnonymousSubject", "_super", "__extends", "destination", "source", "_this", "value", "_b", "_a", "err", "subscriber", "EMPTY_SUBSCRIPTION", "Subject", "BehaviorSubject", "_super", "__extends", "_value", "_this", "subscriber", "subscription", "_a", "hasError", "thrownError", "value", "Subject", "dateTimestampProvider", "Action", "_super", "__extends", "scheduler", "work", "state", "delay", "Subscription", "intervalProvider", "handler", "timeout", "args", "_i", "delegate", "__spreadArray", "__read", "handle", "AsyncAction", "_super", "__extends", "scheduler", "work", "_this", "state", "delay", "id", "_a", "_id", "intervalProvider", "_scheduler", "error", "_delay", "errored", "errorValue", "e", "actions", "arrRemove", "Action", "Scheduler", "schedulerActionCtor", "now", "work", "delay", "state", "dateTimestampProvider", "AsyncScheduler", "_super", "__extends", "SchedulerAction", "now", "Scheduler", "_this", "action", "actions", "error", "asyncScheduler", "AsyncScheduler", "AsyncAction", "isArrayLike", "x", "isPromise", "value", "isFunction", "isInteropObservable", "input", "isFunction", "observable", "isAsyncIterable", "obj", "isFunction", "createInvalidObservableTypeError", "input", "getSymbolIterator", "iterator", "isIterable", "input", "isFunction", "iterator", "readableStreamLikeToAsyncGenerator", "readableStream", "reader", "__await", "_a", "_b", "value", "done", "isReadableStreamLike", "obj", "isFunction", "innerFrom", "input", "Observable", "isInteropObservable", "fromInteropObservable", "isArrayLike", "fromArrayLike", "isPromise", "fromPromise", "isAsyncIterable", "fromAsyncIterable", "isIterable", "fromIterable", "isReadableStreamLike", "fromReadableStreamLike", "createInvalidObservableTypeError", "obj", "subscriber", "obs", "observable", "isFunction", "array", "i", "promise", "value", "err", "reportUnhandledError", "iterable", "iterable_1", "__values", "iterable_1_1", "asyncIterable", "process", "readableStream", "readableStreamLikeToAsyncGenerator", "asyncIterable_1", "__asyncValues", "asyncIterable_1_1", "executeSchedule", "parentSubscription", "scheduler", "work", "delay", "repeat", "scheduleSubscription", "map", "project", "thisArg", "operate", "source", "subscriber", "index", "createOperatorSubscriber", "value", "isArray", "callOrApply", "fn", "args", "__spreadArray", "__read", "mapOneOrManyArgs", "map", "mergeInternals", "source", "subscriber", "project", "concurrent", "onBeforeNext", "expand", "innerSubScheduler", "additionalFinalizer", "buffer", "active", "index", "isComplete", "checkComplete", "outerNext", "value", "doInnerSub", "innerComplete", "innerFrom", "createOperatorSubscriber", "innerValue", "bufferedValue", "executeSchedule", "err", "mergeMap", "project", "resultSelector", "concurrent", "isFunction", "a", "i", "map", "b", "ii", "innerFrom", "operate", "source", "subscriber", "mergeInternals", "nodeEventEmitterMethods", "eventTargetMethods", "jqueryMethods", "fromEvent", "target", "eventName", "options", "resultSelector", "isFunction", "mapOneOrManyArgs", "_a", "__read", "isEventTarget", "methodName", "handler", "isNodeStyleEventEmitter", "toCommonHandlerRegistry", "isJQueryStyleEventEmitter", "add", "remove", "isArrayLike", "mergeMap", "subTarget", "innerFrom", "Observable", "subscriber", "args", "_i", "debounceTime", "dueTime", "scheduler", "asyncScheduler", "operate", "source", "subscriber", "activeTask", "lastValue", "lastTime", "emit", "value", "emitWhenIdle", "targetTime", "now", "createOperatorSubscriber", "top", "bottom", "right", "left", "auto", "basePlacements", "start", "end", "clippingParents", "viewport", "popper", "reference", "variationPlacements", "acc", "placement", "placements", "beforeRead", "read", "afterRead", "beforeMain", "main", "afterMain", "beforeWrite", "write", "afterWrite", "modifierPhases", "getNodeName", "element", "getWindow", "node", "ownerDocument", "isElement", "node", "OwnElement", "getWindow", "isHTMLElement", "isShadowRoot", "applyStyles", "_ref", "state", "name", "style", "attributes", "element", "isHTMLElement", "getNodeName", "value", "effect", "_ref2", "initialStyles", "styleProperties", "property", "attribute", "applyStyles_default", "getBasePlacement", "placement", "max", "min", "round", "getUAString", "uaData", "item", "isLayoutViewport", "getUAString", "getBoundingClientRect", "element", "includeScale", "isFixedStrategy", "clientRect", "scaleX", "scaleY", "isHTMLElement", "round", "_ref", "isElement", "getWindow", "visualViewport", "addVisualOffsets", "isLayoutViewport", "x", "y", "width", "height", "getLayoutRect", "element", "clientRect", "getBoundingClientRect", "width", "height", "contains", "parent", "child", "rootNode", "isShadowRoot", "next", "getComputedStyle", "element", "getWindow", "isTableElement", "element", "getNodeName", "getDocumentElement", "element", "isElement", "getParentNode", "element", "getNodeName", "isShadowRoot", "getDocumentElement", "getTrueOffsetParent", "element", "isHTMLElement", "getComputedStyle", "getContainingBlock", "isFirefox", "getUAString", "isIE", "elementCss", "currentNode", "getParentNode", "isShadowRoot", "getNodeName", "css", "getOffsetParent", "window", "getWindow", "offsetParent", "isTableElement", "getMainAxisFromPlacement", "placement", "within", "min", "value", "max", "withinMaxClamp", "v", "getFreshSideObject", "mergePaddingObject", "paddingObject", "getFreshSideObject", "expandToHashMap", "value", "keys", "hashMap", "key", "toPaddingObject", "padding", "state", "mergePaddingObject", "expandToHashMap", "basePlacements", "arrow", "_ref", "_state$modifiersData$", "name", "options", "arrowElement", "popperOffsets", "basePlacement", "getBasePlacement", "axis", "getMainAxisFromPlacement", "isVertical", "left", "right", "len", "paddingObject", "arrowRect", "getLayoutRect", "minProp", "top", "maxProp", "bottom", "endDiff", "startDiff", "arrowOffsetParent", "getOffsetParent", "clientSize", "centerToReference", "min", "max", "center", "offset", "within", "axisProp", "effect", "_ref2", "_options$element", "contains", "arrow_default", "getVariation", "placement", "unsetSides", "roundOffsetsByDPR", "_ref", "win", "x", "y", "dpr", "round", "mapToStyles", "_ref2", "_Object$assign2", "popper", "popperRect", "placement", "variation", "offsets", "position", "gpuAcceleration", "adaptive", "roundOffsets", "isFixed", "_offsets$x", "_offsets$y", "_ref3", "hasX", "hasY", "sideX", "left", "sideY", "top", "offsetParent", "getOffsetParent", "heightProp", "widthProp", "getWindow", "getDocumentElement", "getComputedStyle", "right", "end", "bottom", "offsetY", "offsetX", "commonStyles", "_ref4", "_Object$assign", "computeStyles", "_ref5", "state", "options", "_options$gpuAccelerat", "_options$adaptive", "_options$roundOffsets", "getBasePlacement", "getVariation", "computeStyles_default", "passive", "effect", "_ref", "state", "instance", "options", "_options$scroll", "scroll", "_options$resize", "resize", "window", "getWindow", "scrollParents", "scrollParent", "eventListeners_default", "hash", "getOppositePlacement", "placement", "matched", "hash", "getOppositeVariationPlacement", "placement", "matched", "getWindowScroll", "node", "win", "getWindow", "scrollLeft", "scrollTop", "getWindowScrollBarX", "element", "getBoundingClientRect", "getDocumentElement", "getWindowScroll", "getViewportRect", "element", "strategy", "win", "getWindow", "html", "getDocumentElement", "visualViewport", "width", "height", "x", "y", "layoutViewport", "isLayoutViewport", "getWindowScrollBarX", "getDocumentRect", "element", "_element$ownerDocumen", "html", "getDocumentElement", "winScroll", "getWindowScroll", "body", "width", "max", "height", "x", "getWindowScrollBarX", "y", "getComputedStyle", "isScrollParent", "element", "_getComputedStyle", "getComputedStyle", "overflow", "overflowX", "overflowY", "getScrollParent", "node", "getNodeName", "isHTMLElement", "isScrollParent", "getParentNode", "listScrollParents", "element", "list", "_element$ownerDocumen", "scrollParent", "getScrollParent", "isBody", "win", "getWindow", "target", "isScrollParent", "updatedList", "getParentNode", "rectToClientRect", "rect", "getInnerBoundingClientRect", "element", "strategy", "rect", "getBoundingClientRect", "getClientRectFromMixedType", "clippingParent", "viewport", "rectToClientRect", "getViewportRect", "isElement", "getDocumentRect", "getDocumentElement", "getClippingParents", "clippingParents", "listScrollParents", "getParentNode", "canEscapeClipping", "getComputedStyle", "clipperElement", "isHTMLElement", "getOffsetParent", "contains", "getNodeName", "getClippingRect", "boundary", "rootBoundary", "mainClippingParents", "firstClippingParent", "clippingRect", "accRect", "max", "min", "computeOffsets", "_ref", "reference", "element", "placement", "basePlacement", "getBasePlacement", "variation", "getVariation", "commonX", "commonY", "offsets", "top", "bottom", "right", "left", "mainAxis", "getMainAxisFromPlacement", "len", "start", "end", "detectOverflow", "state", "options", "_options", "_options$placement", "placement", "_options$strategy", "strategy", "_options$boundary", "boundary", "clippingParents", "_options$rootBoundary", "rootBoundary", "viewport", "_options$elementConte", "elementContext", "popper", "_options$altBoundary", "altBoundary", "_options$padding", "padding", "paddingObject", "mergePaddingObject", "expandToHashMap", "basePlacements", "altContext", "reference", "popperRect", "element", "clippingClientRect", "getClippingRect", "isElement", "getDocumentElement", "referenceClientRect", "getBoundingClientRect", "popperOffsets", "computeOffsets", "popperClientRect", "rectToClientRect", "elementClientRect", "overflowOffsets", "offsetData", "offset", "key", "multiply", "right", "bottom", "axis", "top", "computeAutoPlacement", "state", "options", "_options", "placement", "boundary", "rootBoundary", "padding", "flipVariations", "_options$allowedAutoP", "allowedAutoPlacements", "placements", "variation", "getVariation", "variationPlacements", "basePlacements", "allowedPlacements", "overflows", "acc", "detectOverflow", "getBasePlacement", "a", "b", "getExpandedFallbackPlacements", "placement", "getBasePlacement", "auto", "oppositePlacement", "getOppositePlacement", "getOppositeVariationPlacement", "flip", "_ref", "state", "options", "name", "_options$mainAxis", "checkMainAxis", "_options$altAxis", "checkAltAxis", "specifiedFallbackPlacements", "padding", "boundary", "rootBoundary", "altBoundary", "_options$flipVariatio", "flipVariations", "allowedAutoPlacements", "preferredPlacement", "basePlacement", "isBasePlacement", "fallbackPlacements", "placements", "acc", "computeAutoPlacement", "referenceRect", "popperRect", "checksMap", "makeFallbackChecks", "firstFittingPlacement", "i", "_basePlacement", "isStartVariation", "getVariation", "start", "isVertical", "top", "bottom", "len", "overflow", "detectOverflow", "mainVariationSide", "right", "left", "altVariationSide", "checks", "check", "numberOfChecks", "_loop", "_i", "fittingPlacement", "_ret", "flip_default", "getSideOffsets", "overflow", "rect", "preventedOffsets", "isAnySideFullyClipped", "top", "right", "bottom", "left", "side", "hide", "_ref", "state", "name", "referenceRect", "popperRect", "referenceOverflow", "detectOverflow", "popperAltOverflow", "referenceClippingOffsets", "popperEscapeOffsets", "isReferenceHidden", "hasPopperEscaped", "hide_default", "distanceAndSkiddingToXY", "placement", "rects", "offset", "basePlacement", "getBasePlacement", "invertDistance", "left", "top", "_ref", "skidding", "distance", "right", "_ref2", "state", "options", "name", "_options$offset", "data", "placements", "acc", "_data$state$placement", "x", "y", "offset_default", "popperOffsets", "_ref", "state", "name", "computeOffsets", "popperOffsets_default", "getAltAxis", "axis", "preventOverflow", "_ref", "state", "options", "name", "_options$mainAxis", "checkMainAxis", "_options$altAxis", "checkAltAxis", "boundary", "rootBoundary", "altBoundary", "padding", "_options$tether", "tether", "_options$tetherOffset", "tetherOffset", "overflow", "detectOverflow", "basePlacement", "getBasePlacement", "variation", "getVariation", "isBasePlacement", "mainAxis", "getMainAxisFromPlacement", "altAxis", "getAltAxis", "popperOffsets", "referenceRect", "popperRect", "tetherOffsetValue", "normalizedTetherOffsetValue", "offsetModifierState", "data", "_offsetModifierState$", "mainSide", "top", "left", "altSide", "bottom", "right", "len", "offset", "min", "max", "additive", "minLen", "start", "maxLen", "arrowElement", "arrowRect", "getLayoutRect", "arrowPaddingObject", "getFreshSideObject", "arrowPaddingMin", "arrowPaddingMax", "arrowLen", "within", "minOffset", "maxOffset", "arrowOffsetParent", "getOffsetParent", "clientOffset", "offsetModifierValue", "tetherMin", "tetherMax", "preventedOffset", "_offsetModifierState$2", "_mainSide", "_altSide", "_offset", "_len", "_min", "_max", "isOriginSide", "_offsetModifierValue", "_tetherMin", "_tetherMax", "_preventedOffset", "withinMaxClamp", "preventOverflow_default", "getHTMLElementScroll", "element", "getNodeScroll", "node", "getWindow", "isHTMLElement", "getWindowScroll", "getHTMLElementScroll", "isElementScaled", "element", "rect", "scaleX", "round", "scaleY", "getCompositeRect", "elementOrVirtualElement", "offsetParent", "isFixed", "isOffsetParentAnElement", "isHTMLElement", "offsetParentIsScaled", "documentElement", "getDocumentElement", "getBoundingClientRect", "scroll", "offsets", "getNodeName", "isScrollParent", "getNodeScroll", "getWindowScrollBarX", "order", "modifiers", "map", "visited", "result", "modifier", "sort", "requires", "dep", "depModifier", "orderModifiers", "orderedModifiers", "modifierPhases", "acc", "phase", "debounce", "fn", "pending", "resolve", "mergeByName", "modifiers", "merged", "current", "existing", "key", "DEFAULT_OPTIONS", "areValidElements", "_len", "args", "_key", "element", "popperGenerator", "generatorOptions", "_generatorOptions", "_generatorOptions$def", "defaultModifiers", "_generatorOptions$def2", "defaultOptions", "reference", "popper", "options", "state", "effectCleanupFns", "isDestroyed", "instance", "setOptionsAction", "cleanupModifierEffects", "isElement", "listScrollParents", "orderedModifiers", "orderModifiers", "mergeByName", "m", "runModifierEffects", "_state$elements", "getCompositeRect", "getOffsetParent", "getLayoutRect", "modifier", "index", "_state$orderedModifie", "fn", "_state$orderedModifie2", "_options", "name", "debounce", "resolve", "_ref", "_ref$options", "effect", "cleanupFn", "noopFn", "defaultModifiers", "eventListeners_default", "popperOffsets_default", "computeStyles_default", "applyStyles_default", "offset_default", "flip_default", "preventOverflow_default", "arrow_default", "hide_default", "createPopper", "popperGenerator", "BOX_CLASS", "CONTENT_CLASS", "BACKDROP_CLASS", "ARROW_CLASS", "SVG_ARROW_CLASS", "TOUCH_OPTIONS", "passive", "capture", "TIPPY_DEFAULT_APPEND_TO", "document", "body", "getValueAtIndexOrReturn", "value", "index", "defaultValue", "Array", "isArray", "v", "isType", "type", "str", "toString", "call", "indexOf", "invokeWithArgsOrReturn", "args", "debounce", "fn", "ms", "timeout", "arg", "clearTimeout", "setTimeout", "splitBySpaces", "value", "split", "filter", "Boolean", "normalizeToArray", "concat", "pushIfUnique", "arr", "indexOf", "push", "unique", "item", "index", "getBasePlacement", "placement", "arrayFrom", "slice", "call", "removeUndefinedProps", "obj", "Object", "keys", "reduce", "acc", "key", "undefined", "div", "document", "createElement", "isElement", "some", "type", "isType", "isNodeList", "isMouseEvent", "isReferenceElement", "_tippy", "reference", "getArrayOfElements", "Array", "isArray", "querySelectorAll", "setTransitionDuration", "els", "forEach", "el", "style", "transitionDuration", "setVisibilityState", "state", "setAttribute", "getOwnerDocument", "elementOrElements", "_element$ownerDocumen", "_normalizeToArray", "element", "ownerDocument", "body", "isCursorOutsideInteractiveBorder", "popperTreeData", "event", "clientX", "clientY", "every", "_ref", "popperRect", "popperState", "props", "interactiveBorder", "basePlacement", "offsetData", "modifiersData", "offset", "topDistance", "top", "y", "bottomDistance", "bottom", "leftDistance", "left", "x", "rightDistance", "right", "exceedsTop", "exceedsBottom", "exceedsLeft", "exceedsRight", "updateTransitionEndListener", "box", "action", "listener", "method", "actualContains", "parent", "child", "target", "_target$getRootNode", "contains", "getRootNode", "host", "currentInput", "isTouch", "lastMouseMoveTime", "onDocumentTouchStart", "window", "performance", "addEventListener", "onDocumentMouseMove", "now", "removeEventListener", "onWindowBlur", "activeElement", "instance", "blur", "isVisible", "bindGlobalEventListeners", "TOUCH_OPTIONS", "isBrowser", "isIE11", "msCrypto", "pluginProps", "animateFill", "followCursor", "inlinePositioning", "sticky", "renderProps", "allowHTML", "animation", "arrow", "content", "inertia", "maxWidth", "role", "theme", "zIndex", "defaultProps", "appendTo", "TIPPY_DEFAULT_APPEND_TO", "aria", "expanded", "delay", "duration", "getReferenceClientRect", "hideOnClick", "ignoreAttributes", "interactive", "interactiveBorder", "interactiveDebounce", "moveTransition", "offset", "onAfterUpdate", "onBeforeUpdate", "onCreate", "onDestroy", "onHidden", "onHide", "onMount", "onShow", "onShown", "onTrigger", "onUntrigger", "onClickOutside", "placement", "plugins", "popperOptions", "render", "showOnCreate", "touch", "trigger", "triggerTarget", "defaultKeys", "Object", "keys", "setDefaultProps", "partialProps", "forEach", "key", "getExtendedPassedProps", "passedProps", "reduce", "acc", "plugin", "name", "defaultValue", "_name", "undefined", "getDataAttributeProps", "reference", "propKeys", "props", "valueAsString", "getAttribute", "trim", "JSON", "parse", "e", "evaluateProps", "out", "invokeWithArgsOrReturn", "innerHTML", "dangerouslySetInnerHTML", "element", "html", "createArrowElement", "value", "arrow", "div", "className", "ARROW_CLASS", "SVG_ARROW_CLASS", "isElement", "appendChild", "setContent", "content", "props", "allowHTML", "textContent", "getChildren", "popper", "box", "firstElementChild", "boxChildren", "arrayFrom", "children", "find", "node", "classList", "contains", "CONTENT_CLASS", "backdrop", "BACKDROP_CLASS", "render", "instance", "BOX_CLASS", "setAttribute", "onUpdate", "prevProps", "nextProps", "_getChildren", "theme", "removeAttribute", "animation", "inertia", "style", "maxWidth", "role", "removeChild", "$$tippy", "idCounter", "mouseMoveListeners", "mountedInstances", "createTippy", "reference", "passedProps", "evaluateProps", "defaultProps", "getExtendedPassedProps", "removeUndefinedProps", "showTimeout", "hideTimeout", "scheduleHideAnimationFrame", "isVisibleFromClick", "didHideDueToDocumentMouseDown", "didTouchMove", "ignoreOnFirstUpdate", "lastTriggerEvent", "currentTransitionEndListener", "onFirstUpdate", "listeners", "debouncedOnMouseMove", "debounce", "onMouseMove", "interactiveDebounce", "currentTarget", "id", "popperInstance", "plugins", "unique", "state", "isEnabled", "isVisible", "isDestroyed", "isMounted", "isShown", "clearDelayTimeouts", "setProps", "show", "hide", "hideWithInteractivity", "enable", "disable", "unmount", "destroy", "_props$render", "_tippy", "pluginsHooks", "map", "plugin", "fn", "hasAriaExpanded", "hasAttribute", "addListeners", "handleAriaExpandedAttribute", "handleStyles", "invokeHook", "showOnCreate", "scheduleShow", "addEventListener", "interactive", "trigger", "indexOf", "getDocument", "getNormalizedTouchSettings", "touch", "Array", "isArray", "getIsCustomTouchBehavior", "getIsDefaultRenderFn", "_instance$props$rende", "getCurrentTarget", "parent", "parentNode", "getOwnerDocument", "document", "getDefaultTemplateChildren", "getDelay", "isShow", "currentInput", "isTouch", "type", "getValueAtIndexOrReturn", "delay", "fromHide", "pointerEvents", "zIndex", "hook", "args", "shouldInvokePropsHook", "forEach", "pluginHooks", "_instance$props", "handleAriaContentAttribute", "aria", "attr", "nodes", "normalizeToArray", "triggerTarget", "currentValue", "getAttribute", "nextValue", "replace", "trim", "expanded", "cleanupInteractiveMouseListeners", "removeEventListener", "filter", "listener", "onDocumentPress", "event", "actualTarget", "composedPath", "target", "actualContains", "some", "el", "hideOnClick", "setTimeout", "removeDocumentPress", "onTouchMove", "onTouchStart", "addDocumentPress", "doc", "TOUCH_OPTIONS", "onTransitionedOut", "duration", "callback", "onTransitionEnd", "onTransitionedIn", "updateTransitionEndListener", "on", "eventType", "handler", "options", "push", "onTrigger", "passive", "onMouseLeave", "splitBySpaces", "isIE11", "onBlurOrFocusOut", "removeListeners", "_ref", "_lastTriggerEvent", "shouldScheduleClickHide", "isEventListenerStopped", "wasFocused", "isMouseEvent", "scheduleHide", "isCursorOverReferenceOrPopper", "popperTreeData", "getNestedPopperTree", "concat", "_instance$popperInsta", "popperRect", "getBoundingClientRect", "popperState", "Boolean", "isCursorOutsideInteractiveBorder", "shouldBail", "relatedTarget", "createPopperInstance", "destroyPopperInstance", "_instance$props2", "popperOptions", "placement", "offset", "getReferenceClientRect", "moveTransition", "computedReference", "contextElement", "tippyModifier", "name", "enabled", "phase", "requires", "_ref2", "_getDefaultTemplateCh", "attributes", "modifiers", "padding", "top", "bottom", "left", "right", "adaptive", "createPopper", "mount", "appendTo", "TIPPY_DEFAULT_APPEND_TO", "invokeWithArgsOrReturn", "querySelectorAll", "_getNormalizedTouchSe", "touchValue", "touchDelay", "requestAnimationFrame", "clearTimeout", "cancelAnimationFrame", "partialProps", "ignoreAttributes", "nestedPopper", "forceUpdate", "isAlreadyVisible", "isDisabled", "isTouchAndTouchDisabled", "onShow", "visibility", "transition", "_getDefaultTemplateCh2", "setTransitionDuration", "_instance$popperInsta2", "offsetHeight", "_getDefaultTemplateCh3", "setVisibilityState", "pushIfUnique", "isAlreadyHidden", "onHide", "_getDefaultTemplateCh4", "i", "tippy", "targets", "optionalProps", "bindGlobalEventListeners", "elements", "getArrayOfElements", "isSingleContentElement", "isMoreThanOneReferenceElement", "instances", "reduce", "acc", "setDefaultProps", "applyStylesModifier", "applyStyles", "effect", "_ref", "state", "initialStyles", "popper", "position", "options", "strategy", "left", "top", "margin", "arrow", "reference", "Object", "assign", "elements", "style", "styles", "tippy", "setDefaultProps", "render", "AxDropdownEvents", "selector", "options", "JQElementHelper", "AxDropdownInteraction", "Subject", "BehaviorSubject", "$elem", "$menu", "isMultiSelect", "instance", "tippy_esm_default", "$parent", "$popperInstance", "$selectedList", "selected", "$selected", "$popperElem", "event", "currentTarget", "e", "id", "$target", "hasMultiSelect", "interSectionCallback", "entries", "observer", "entry", "Direction", "AxDropdown", "jqElementHelper", "JQElementHelper", "selector", "options", "AxDropdownEvents", "$parent", "$elem", "i", "e", "instance", "value", "option", "disabled", "$elements", "parent", "scrollToElement", "a", "m", "InputIconHelper", "$elem", "$icon", "InputEventHelper", "$elem", "$parent", "$icon", "InputIconHelper", "hasValue", "inputTypePassword", "strength", "password", "$passwordStrength", "$progressText", "$lengthCheckIndicator", "$lowerCaseCheckIndicator", "$upperCaseCheckIndicator", "$numberCheckIndicator", "$specialCharCheckIndicator", "AxInput", "selector", "JQElementHelper", "$elem", "$parent", "$icon", "iconHelper", "InputIconHelper", "inputEventHelper", "InputEventHelper", "AxFormValidation", "options", "i18n_default", "i", "e", "_a", "form", "event", "validator", "error", "element", "value", "regexp", "password", "onOpenEvent", "onOpenedEvent", "onHideEvent", "onHiddenEvent", "AxModal", "jqElementHelper", "JQElementHelper", "el", "$currentModal", "options", "_a", "_b", "_c", "_d", "$elem", "modalAttr", "e", "$modal", "staticBackdrop", "target", "modal", "AxCounter", "options", "$e", "Subject", "x", "min", "max", "value", "y", "BodyUtility", "scrollTop", "CheckMinMaxConstraintResult", "PackageMinMaxConstraint", "I18nHelper", "initData", "count", "minMaxOk", "minOk", "maxOk", "result", "that", "Translations", "__decorate", "ModuleName", "LoadingSpinnerPositionEnum", "RandomHelper", "length", "result", "characters", "charactersLength", "i", "S4", "AxLoading", "_RandomHelper", "RandomHelper", "elems", "transparent", "position", "elem", "prepend", "guid", "active", "x", "loadingIndicator", "LoadingSpinnerPositionEnum", "ProductCalcModel", "DatumFrom", "DatumTo", "Quantity", "CustomerCardsTypeNo", "PersTypNo", "PoolNo", "ArtikelNo", "RentalItemNo", "RentalPersTypeNo", "WareSaleItemNo", "PackPos", "RemainingNo", "BestMatchHandler", "getBestMatchActivated", "divisor", "betterMatchHolderName", "packageNameHolderName", "betterPriceHolderName", "originalSinglePriceName", "calculatedPriceHolderName", "AxLoading", "ticketTypeNo", "poolNo", "dateFrom", "productList", "resolve", "reject", "__awaiter", "soapDateFrom", "x", "LoadingSpinnerPositionEnum", "requestValues", "apiCallResult", "bestMatchResultList", "productCalcMap", "prod", "productCalcModel", "ProductCalcModel", "data", "bestMatchResults", "bestMatchResultObj", "bestMatchTicketResult", "betterMatchHolder", "packageNameHolder", "betterPriceHolder", "originalSinglePriceHolder", "calculatedPriceHolder", "bestMatchResult", "product", "quantity", "originalPrice", "sumBetterMatchProducts", "sumUnmatchedProducts", "prodSelectionId", "price", "TicketList", "_I18nHelper", "I18nHelper", "_BodyUtility", "BodyUtility", "AxDropdown", "BehaviorSubject", "initData", "_a", "BestMatchHandler", "x", "prod", "axCounter", "AxCounter", "dateFrom", "updateBasePrice", "totalAmount", "totalAmountFrc", "quantity", "namedProducts", "foreignCurrency", "bestMatchResultList", "bestMatchResult", "price", "priceFrc", "totalPrice", "summaryText", "Translations", "quantityOK", "checkMinMaxConstraintResult", "CheckMinMaxConstraintResult", "minMaxConstraintModule", "AxLoad", "totalPriceFrc", "RequestHelper", "formArray", "returnArray", "parameterName", "result", "tmp", "item", "obj", "data", "path", "options", "method", "form", "constructElements", "parentString", "createInput", "key", "i", "name", "value", "hiddenField", "url", "absolutePath", "urlObj", "href", "link", "SummaryRedirect", "_requestHelper", "RequestHelper", "postURL", "data", "timeSlots", "AxLoad", "result", "NonPreDateable", "_Progressbar", "ProgressBar", "_TicketList", "TicketList", "_summaryRedirect", "SummaryRedirect", "initData", "ProgressBarMode", "x", "quantityOk", "AxPackNonPredateable", "NonPreDateable", "_ProductMapper", "ProductMapper", "_AxLimestone", "AxLimeStone", "initData", "e", "x", "requestObj", "__decorate", "ModuleName", "InteractionHelper", "cell", "parent", "informSubscribers", "sendSubscription", "tmpCell", "x", "targetDate", "filteredCells", "tmpDate", "date", "text", "removeCache", "existingEntry", "retVal", "Direction", "AxPEventHelper", "ActionHelper", "InteractionHelper", "parent", "cell", "ev", "date", "a", "b", "elem", "direction", "Direction", "newEntries", "currentHeight", "currentWidth", "newWeekRows", "orgWeekRows", "rowHeight", "currentMonths", "i", "weekRows", "entry", "newHeight", "count", "height", "margin", "animateProperties", "axDatePickerResizeObserver", "entries", "entry", "target", "weekWrapper", "sampleDaySize", "_b", "_a", "e", "i", "RenderHelper", "_AxLoading", "AxLoading", "datePicker", "tbl", "calendarWrapper", "calendarSlider", "Mode", "newEntries", "month", "year", "x", "resolve", "reject", "h", "monthEntry", "innerHead", "j", "weekdayName", "cellElem", "cellText", "cell", "child", "addText", "direction", "monthHeader", "monthNavigator", "Direction", "index", "monthWrapper", "dt", "dateTemp", "currentWeek", "startOfWeekTemp", "monthDays", "startOfWeek", "displayDate", "innerDay", "dateHolder", "dayRange", "nextYear", "cellObj", "blockedDays", "availableDates", "onlyDateSelection", "dayNum", "Mode", "AxDatePicker", "RenderH", "RenderHelper", "EventHelper", "AxPEventHelper", "ActionHelper", "InteractionHelper", "BehaviorSubject", "options", "potentialTargets", "_a", "date", "informSubscribers", "text", "removeCache", "x", "Mode", "ev", "scrollTarget", "a", "b", "month", "PreDateable", "_summaryRedirect", "SummaryRedirect", "_Progressbar", "ProgressBar", "_TicketList", "TicketList", "_I18nHelper", "I18nHelper", "AxDropdown", "initData", "ProgressBarMode", "AxDatePicker", "endDate", "Mode", "x", "y", "tmp", "date", "startDate", "res", "rej", "z", "availableDates", "tmpDate", "dateEntry", "dateList", "lastPriceList", "priceEntry", "totalQuantity", "totalAmount", "prod", "price", "cell", "dayPriceList", "priceChange", "cellTariff", "formatedDate", "dayEntry", "Translations", "checkMinMaxConstraintResult", "CheckMinMaxConstraintResult", "minMaxConstraintModule", "AxLoad", "AxPackPredateable", "PreDateable", "_ProductMapper", "ProductMapper", "_AxLimestone", "AxLimeStone", "initData", "e", "requestObj", "__decorate", "ModuleName", "AxProdNonPredateable", "NonPreDateable", "_ProductMapper", "ProductMapper", "_AxLimestone", "AxLimeStone", "initData", "e", "x", "requestObj", "__decorate", "ModuleName", "import_sweetalert2", "AxProdPredateable", "PreDateable", "_ProductMapper", "ProductMapper", "_AxLimestone", "AxLimeStone", "initData", "e", "currentDate", "momentInstance", "Swal", "Translations", "result", "requestObj", "__decorate", "ModuleName", "Product", "id", "name", "price", "originalPrice", "foreignPrice", "quantity", "subProductIdentifier", "timeSlotGroupKeys", "listElement", "min", "max", "AxProdSelection", "_AxLimestone", "AxLimeStone", "BehaviorSubject", "Subject", "initData", "BestMatchHandler", "prod", "axCounter", "AxCounter", "x", "existingEntry", "e", "date", "productList", "informSubscriber", "quantity", "cultureInfo", "divisor", "totalAmount", "totalAmountFrc", "prodSummary", "foreignCurrency", "bestMatchResultList", "bestMatchResult", "price", "priceFrc", "totalPrice", "totalPriceFrc", "Product", "__decorate", "ModuleName", "AxCalendarTrinity", "i18nHelper", "I18nHelper", "Subject", "month", "year", "options", "_a", "tmp", "legend", "i", "elem", "months", "append", "tbl", "startdate", "h", "dt", "dateStart", "dateTemp", "currentWeek", "monthHeader", "startOfWeekTemp", "cell", "innerHead", "j", "weekdayName", "cellText", "startOfWeek", "displayDate", "innerDay", "dateHolder", "dayNum", "dayName", "dayContent", "inner", "cellinner", "block", "infoObj", "infoHolderParent", "infoHolderSecondLine", "infoHolderThirdLine", "infoHolderDiscount", "currencyInfo", "priceDiscountPercentage", "availabilityMarker", "weatherHolderParent", "weatherImg", "weatherHolderTemperatures", "weatherHolderMinTemp", "weatherHolderMaxTemp", "that", "date", "activeClass", "contingentsFree", "contingentsCountTotal", "showContingentsAlertPercent", "contingentsLeftText", "showContingentsAlertTrigger", "infoHolderContingents", "contingentHoverAlert", "addClass", "removeClass", "element", "discountLabel", "originalPriceTag", "discountPercent", "discountText", "price", "priceWithoutDiscount", "contingentNr", "packageNr", "tariffSheetNr", "validTimeSpan", "Translations", "startDate", "endDate", "start", "end", "count", "m", "calRows", "calCols", "AxScrollspy", "selector", "offset", "skip", "randomHelper", "RandomHelper", "Subject", "AxScrollSpyListener", "sections", "i", "e", "currentOffsetTarget", "_b", "_a", "nextTargetOffset", "count", "key", "map", "tmpOffset", "scrollPosition", "lastIndex", "ScrollSubject", "guid", "id", "target", "SubCCalendar", "_I18nHelper", "I18nHelper", "_Progressbar", "ProgressBar", "initData", "ProgressBarMode", "AxCalendarTrinity", "AxLoad", "AxScrollspy", "x", "$targets", "ev", "instance", "tippy_esm_default", "Translations", "subject", "dt", "month", "year", "elem", "parentScope", "IsFirstLoad", "totalQuantity", "prodList", "totalAmount", "totalAmountWithoutDiscount", "prod", "currentProd", "frontendViewProd", "price", "priceWithoutDiscount", "priceDiscountPercentage", "product", "confList", "groupKey", "existingEntry", "cont", "quantity", "date", "checkMinMaxConstraintResult", "CheckMinMaxConstraintResult", "minMaxConstraintModule", "summaryText", "productDay", "AxProdSelectionCalendar", "SubCCalendar", "initData", "x", "month", "year", "resp", "dt", "dtEnd", "m", "day", "cont", "contNum", "_a", "weatherData", "_b", "infoObject", "__decorate", "ModuleName", "AxSlide", "initData", "i", "e", "AxSliderInternal", "holder", "elemSelector", "event", "maxSize", "x", "currTrans", "_a", "TimeSlotKey", "timeSlotGroupKey", "timeSlotKey1", "timeSlotKey2", "other", "ConfigHelper", "configId", "ConfigDataType", "callback", "result", "configDataType", "data", "resp", "e", "resolve", "reject", "__awaiter", "ConfigDefinition", "DateHelper", "soapDate", "AxBooking", "i18nHelper", "I18nHelper", "_summaryRedirect", "SummaryRedirect", "progressbar", "ProgressBar", "_AxLimeStone", "AxLimeStone", "_Slide", "AxSlide", "_AxTab", "AxTab", "initData", "that", "ProgressBarMode", "ConfigHelper", "ConfigDefinition", "x", "AxLoad", "e", "_f", "_c", "_b", "_a", "_e", "_d", "Translations", "$target", "targetWidth", "currTrans", "scrollAbleWidth", "resizeEntries", "entry", "i", "timeSlotGroupKey", "selectedIndex", "tmpSlot", "langID", "$activeTab", "isFirstLoad", "sumQuantity", "prod", "slot", "$tmpButton", "free", "newStatus", "oldStatus", "childSpan", "childIcon", "availabilityText", "timeSlotKey", "index", "tmpButton", "tmpColor", "triggerChecks", "$elem", "color", "timeSlotKey1", "timeSlotKey2", "TimeSlotKey", "currentTimeSlot", "timeSlot", "selectedSoapTime", "activeTabSortNrAttr", "activeTabSortNr", "allTabs", "allSorts", "selectedMoment", "DateHelper", "selectedHour", "sortNr", "inactiveSorts", "sort", "inactiveTab", "dataTarget", "tsHolder", "allotmentTimeContainer", "hourInHeader", "soapDateInHeader", "chips", "chipSoapTime", "chipMoment", "thisChip", "startIndex", "b", "sortIndex", "activeTab", "dataTargetActiveTab", "activeTabChips", "nextTab", "dataTargetNext", "nextTabsChips", "activeChipMoment", "j", "nextTabChipSoapTime", "time", "nearestTimeSlot", "alwaysSame", "slotDay", "currentOffset", "offset", "$template", "timeSlotDay", "configNo", "multiDay", "selectedSlot", "label", "$entry", "quantityFound", "configActiveTab", "minMaxConstraintModule", "checkMinMaxConstraintResult", "quantityOk", "quantity", "summaryText", "dateText", "$activeLang", "init", "tmpDay", "TimeSlotKeyDto", "timeSlotKey", "AxProdBooking", "AxBooking", "initData", "requestObj", "timeSlot", "TimeSlotKeyDto", "prod", "__decorate", "ModuleName", "import_sweetalert2", "AxProdSummary", "_Progressbar", "ProgressBar", "_AxLimestone", "AxLimeStone", "_I18nHelper", "I18nHelper", "init", "progress", "ProgressBarMode", "e", "delegatedTarget", "$e", "currentDate", "momentInstance", "Swal", "Translations", "result", "continueShoppingPath", "AxLoad", "__decorate", "ModuleName", "AxTopBar", "slimHeader", "x", "e", "i", "targetID", "$target", "difTarget", "$innerToggler", "direction", "$targetBurger", "subMenuTarget", "__decorate", "ModuleName", "AxMain", "i", "prov", "j", "currentDec", "name", "dep", "utilMod", "tmpName", "AxPackSelectionCalendar", "SubCCalendar", "initData", "x", "month", "year", "that", "resp", "i", "weatherData", "infoObject", "__decorate", "ModuleName", "import_sweetalert2", "B2bMode", "_AxLimestone", "AxLimeStone", "_i18nHelper", "I18nHelper", "url", "errTitle", "Translations", "that", "result", "Swal", "callback", "data", "status", "xhr", "link", "filename", "ajaxOptions", "thrownError", "laEl", "isInvoice", "__decorate", "ModuleName", "import_sweetalert2", "ProductTypeConstant", "ArrayHelper", "value", "index", "self", "CookieHelper", "name", "value", "days", "expires", "date", "nameEQ", "ca", "i", "c", "ShoppingCart", "_Progressbar", "ProgressBar", "_i18nHelper", "I18nHelper", "_arrayHelper", "ArrayHelper", "_axButton", "AxButton", "_requestHelper", "RequestHelper", "_cookieHelper", "CookieHelper", "_dateInitData", "BirthDateInitData", "init", "e", "AxAlert", "progress", "ProgressBarMode", "pattern", "regExp", "openpassMissing", "index", "elem", "id", "hiddenInputProductType", "ProductTypeConstant", "swal", "Translations", "validationError", "i", "counter", "relatedTicketsString", "cartEntryId", "totalCartEntries", "_a", "axCounter", "AxCounter", "debounceTime", "currentCount", "itemsToDelete", "dateInitData", "AxLoad", "cartEntryIDToUpdatePerson", "firstName", "lastName", "dateOfBirth", "data", "resp", "state", "prefix", "fileInputs", "exists", "input", "userAgent", "isSafari", "isChecked", "target", "$e", "errorList", "result", "allTrue", "tippy_esm_default", "containerSelector", "code", "message", "div$", "span$", "relatedTickets", "acc", "x", "itemsToAdd", "__decorate", "ModuleName", "shoppingCart", "ShoppingCart", "cookieHelper", "CookieHelper", "payAtPickupState", "payAtPickupCookie", "BirthDateInitData", "AxPackBooking", "AxBooking", "initData", "requestObj", "timeSlot", "TimeSlotKeyDto", "prod", "__decorate", "ModuleName", "import_sweetalert2", "AxAlertBanner", "elementName", "message", "success", "additionalClasses", "$elem", "iconClass", "x", "TimeSlots", "_Progressbar", "ProgressBar", "_AxProgressBar", "AxProgressBar", "_RequestHelper", "RequestHelper", "_i18nHelper", "I18nHelper", "AxDropdown", "AxAlertBanner", "init", "AxDatePicker", "sts", "e", "Mode", "x", "ddlDate$", "fromEvent", "sp", "formatedDate", "$slot_div", "resp", "$elem", "color", "timeSlotGroupKey", "timeSlotKey1", "timeSlotKey2", "timeSlotKey", "TimeSlotKey", "timeSlot", "$tmpButton", "tmpColor", "index", "tmpButton", "contains", "tmp", "Swal", "Translations", "result", "data", "__decorate", "ModuleName", "import_sweetalert2", "Reserved", "_Progressbar", "ProgressBar", "_AxProgressBar", "AxProgressBar", "_RequestHelper", "RequestHelper", "_i18nHelper", "I18nHelper", "AxAlertBanner", "init", "that", "count", "sts", "e", "step", "date", "real_date", "Swal", "Translations", "result", "resp", "__decorate", "ModuleName", "CategoryFilter", "glide", "Components", "Events", "PREV_CONTROL_SELECTOR", "NEXT_CONTROL_SELECTOR", "component", "perView", "slidesCount", "init", "x", "glide_esm_default", "e", "groupId", "headerHeight", "elements", "i", "tempId", "__decorate", "ModuleName", "SubmenuAim", "init", "menu_root", "__decorate", "ModuleName", "MenuDirection", "import_photoswipe", "import_photoswipe_ui_default", "import_sweetalert2", "AssetHelper", "assets", "retVal", "asset", "resolutionSplit", "w", "h", "colorHelper", "color", "tmp", "r", "g", "b", "l", "s", "h", "hex", "shorthandRegex", "m", "result", "a", "v", "color1Rgb", "color2Rgb", "color1Luminance", "color2Luminance", "LocalStorageKeyCollection", "retailHelper", "colorFilters", "colorPicker", "colorHelper", "e", "$e", "bgColor", "whiteLumi", "reloadCallback", "productIndicator", "detail", "performanceTypes", "nav", "storageFilter", "LocalStorageKeyCollection", "filterList", "RetailDetail", "_assetHelper", "AssetHelper", "_axLimestone", "AxLimeStone", "_i18nHelper", "I18nHelper", "_retailHelper", "retailHelper", "AxDropdown", "init", "$parent", "value", "quantity", "x", "src", "item", "y", "reloaded", "storageFilter", "filter", "$e", "variants", "firstItem", "variant", "$elem", "variantList", "activeE", "currentVariants", "a", "b", "deletedVariants", "searchV", "itemsToSearch", "otherV", "delV", "$variantE", "groupedFilter", "r", "key", "notDeletedFilters", "$toActive", "items", "maxAvailable", "$dropdownMenu", "i", "inner", "index", "scaledImagePath", "groupKey", "currentSrc", "$variantActive", "swiperAssets", "count", "image", "imageSrc", "tmp", "swipeElem", "PhotoSwipe", "PhotoSwipeUI_Default", "$target", "questionID", "e", "answerList", "error", "errorMsg", "quest", "mandatoryButEmpty", "qElem", "Translations", "Swal", "result", "AxLoad", "__decorate", "ModuleName", "RetailMain", "glide", "Components", "Events", "PREV_CONTROL_SELECTOR", "NEXT_CONTROL_SELECTOR", "component", "perView", "slidesCount", "init", "i", "x", "glideID", "rows", "smallGap", "glide_esm_default", "e", "__decorate", "ModuleName", "import_sweetalert2", "ShippingStatus", "Shipping", "_AxLimestone", "AxLimeStone", "init", "x", "target", "resp", "Swal", "result", "typeID", "ShippingStatus", "data", "y", "modalSelector", "type", "additionalSelector", "address", "formSelector", "__decorate", "ModuleName", "RetailFilter", "_retailHelper", "retailHelper", "_axLoading", "AxLoading", "_bodyUtility", "BodyUtility", "init", "x", "e", "gVariant", "tVariant", "tmp", "storageFilter", "filter", "groupedFilter", "r", "a", "key", "group", "sampleVariant", "availableItems", "anyElementActive", "priceMinFilterChanged", "priceMaxFilterChanged", "variant", "itemsWithVariant", "y", "$container", "elementActive", "$e", "featureType", "featureName", "filterList", "filteredItems", "multiSelectFilter", "baseList", "chipFilter", "priceFilteredItems", "item", "entriesLeft", "min", "prev", "curr", "max", "event", "tariff", "itemList", "oldMin", "oldMax", "oldFrom", "oldTo", "from", "to", "$target", "i", "siblings", "searchValue", "list", "toggleValue", "size", "state", "mainItem", "__decorate", "ModuleName", "import_sweetalert2", "OrderHistory", "_Porlet", "AxPortletExpandable", "I18nHelper", "init", "AxLoading", "AxLoad", "e", "elem", "transNr", "posNr", "delegatedTarget", "$e", "key", "view", "postData", "ticketDefIsKGT23", "waiverIsEnabled", "oneRISKProcessRequired", "waiverCompeling", "transactionNumber", "x", "cancelButtons", "i", "ev", "serialNr", "poolNr", "button", "apiRequestData", "result", "Swal", "Translations", "data", "that", "resp", "__decorate", "ModuleName", "AxBirthDateInputTriple", "AxDropdown", "initData", "$parent", "value", "momentFamilyMemberDate", "monthValue", "dayValue", "yearValue", "daysInMonth", "_a", "inner", "month", "day", "year", "momentDate", "$outputElem", "__decorate", "ModuleName", "AxCounterWithInput", "options", "x", "minus", "minusChar", "inputContainer", "input", "additionalText", "plus", "plusChar", "component", "fn", "old", "checkBoundaries", "incrementFn", "newValue", "decrementFn", "amount", "ProgressBar", "i18nHelper", "I18nHelper", "Translations", "import_sweetalert2", "import_exif_js", "MainGiftCards", "_I18nHelper", "I18nHelper", "_ProgressBarGiftCards", "ProgressBar", "_AxProgressBar", "AxProgressBar", "_AxInputWithCounter", "AxCounterWithInput", "_AxLimestone", "AxLimeStone", "amount", "_RequestHelper", "RequestHelper", "glide", "Components", "Events", "PREV_CONTROL_SELECTOR", "NEXT_CONTROL_SELECTOR", "component", "perView", "slidesCount", "init", "tippy_esm_default", "Translations", "that", "steps", "ProgressBarActiveStepEnum", "x", "e", "scrollY", "screenHeight", "heightToShowBtn", "delay", "resolve", "oldValue", "depositStepSize", "defaultNumberOfTemplates", "glide_esm_default", "giftCardsCount", "max", "elemm", "newAmount", "giftCardValue", "item", "value", "cropData", "count", "i", "container", "id", "checkid", "selectedElementId", "optionId", "isSelected", "Swal", "url", "formData", "file", "xhr", "_a", "_b", "_c", "_d", "_e", "_f", "done", "filework", "resp", "errFile", "filesize", "acceptedFiles", "imageName", "requestObj", "fileToWorkWith", "EXIF", "img", "event", "asset", "__decorate", "ModuleName", "ProgressBarActiveStepEnum", "import_sweetalert2", "PriceHelper", "cultureInfo", "checkCurrencySymbolConfig", "AxLoad", "ConfigHelper", "ConfigDefinition", "currencyWebUseIsoSymbol", "totalAmount", "calculatedPrice", "price", "PersonalizeGiftCard", "_ProgressBarGiftCards", "ProgressBar", "_AxProgressBar", "AxProgressBar", "_AxLimestone", "AxLimeStone", "_I18nHelper", "I18nHelper", "AxDropdown", "init", "PriceHelper", "$parent", "value", "quantity", "steps", "ProgressBarActiveStepEnum", "retailItemNr", "tariff", "giftCard", "result", "AxLoad", "Swal", "Translations", "btnContinueMobile", "btnContinueDesktop", "btnGoBackMobile", "btnGoBackDesktop", "success", "recipientEmail", "from", "to", "message", "fromStr", "toStr", "messageStr", "email", "x", "maxLength", "oldLength", "oldString", "currentLength", "__decorate", "ModuleName", "import_sweetalert2", "PasswordValidation", "_I18nHelper", "I18nHelper", "_requestHelper", "RequestHelper", "AxInput", "AxFormValidation", "baseForm", "resp", "Swal", "Translations", "result", "__decorate", "ModuleName", "import_sweetalert2", "import_exif_js", "AccountRentalDataInitData", "parentId", "AccountRentalData", "AxDropdown", "init", "rentalWeight", "rentalHeight", "rentalShoeSize", "rentalSkiLevel", "$parent", "value", "rentalViewModel", "resp", "__decorate", "ModuleName", "LessonProperty", "id", "name", "lessonPropertyType", "LessonPropertyType", "InitCustomerProps", "parentId", "formElementPrefix", "CustomerLessonProperties", "init", "AxDropdown", "elem", "changedValue", "dir", "values", "value", "i", "temp", "propFieldName", "index", "lessonProperty", "parent", "propName", "propElement", "propType", "__decorate", "ModuleName", "MyFamily", "i18nHelper", "I18nHelper", "AccountRentalData", "CustomerLessonProperties", "init", "AxLoading", "InitCustomerProps", "$target", "accNr", "onSubmitAction", "_a", "result", "event", "AccountRentalDataInitData", "AxLoad", "x", "famMember", "accNo", "file", "xhr", "formData", "done", "EXIF", "allMetaData", "reader", "imageFamTicket", "y", "resp", "swal", "Translations", "__decorate", "ModuleName", "inputMaskHelper", "proj4d", "birthdayPattern", "i18nHelper", "I18nHelper", "value", "element", "Translations", "__decorate", "ModuleName", "SeasonCardBooking", "_i18nHelper", "I18nHelper", "AxDropdown", "init", "FormValidator", "Translations", "x", "projNr", "posNr", "serialNr", "fromEvent", "e", "$parent", "maskOptions", "inputMaskHelper", "result", "decodedText", "decodedResult", "that", "error", "map", "event", "sp", "elemId", "data", "url", "str", "__decorate", "ModuleName", "FormValidator", "ctrlID", "msgEleID", "messages", "btnNext", "element", "evt", "flag", "AxCheck", "_AxCheck", "identifier", "label", "newValue", "checkbox", "ComplexPackageFilter", "init", "AxLoading", "AxLoad", "buttonMobileFilter", "event", "compPackFilterFooter", "compPackFilterMobileSafeButton", "filterCloseButtonMobile", "x", "i", "obj", "id", "AxCheck", "data", "compPacksResultsContainer", "compPacksResultsSearchButton", "result", "resultFilter", "element", "name", "fromDate", "toDate", "check", "identifier", "newValue", "axCheckBox", "reload", "__decorate", "ModuleName", "ComplexPackageSelection", "init", "AxLoading", "i", "obj", "body", "packageId", "tariffSheetId", "__decorate", "ModuleName", "import_sweetalert2", "ComplexPackageDetails", "_I18nHelper", "I18nHelper", "AxDropdown", "initData", "AxLoading", "that", "event", "selectedCompackBookingDate", "selectedDateMoment", "formattedDate", "selectedSoapDateTemp", "Swal", "result", "target", "endDate", "startDate", "x", "AxDatePicker", "Mode", "y", "clickedElement", "locationSelect", "res", "rej", "availableDates", "body", "url", "Translations", "cell", "fromDate", "toDate", "data", "response", "i", "dateTemp", "momentDate", "__decorate", "ModuleName", "import_sweetalert2", "CompPackBookingValues", "projNr", "packageId", "tariffSheetId", "soapDateStart", "soapDateEnd", "ComplexPackageBookingOptions", "init", "AxLoading", "I18nHelper", "CompPackBookingValues", "selector", "i", "bookingModule", "AxLoad", "$personDropdown", "$lessonOptionHolder", "$lessonProgramDropdown", "isLesson", "isRentalOptionsHolder", "$skillLevelPillHolder", "$genderDropdown", "$heightDropdown", "$weightDropdown", "$shoeSizeDropdown", "valid", "_b", "_a", "ticket", "elementName", "$element", "bookingRequiredList", "timeSlot", "_c", "isTimeSlotSelected", "bookingValues", "ticketEntry", "data", "result", "comPackBookingResult", "Swal", "Translations", "__decorate", "ModuleName", "CompPackOrderTicketValues", "projNr", "ticketTypeNr", "poolNr", "personTypeNr", "packagePositionNr", "hasTimeSlots", "timeSlotKeys", "ComplexPackageBookingTicketsOptions", "_AxLimestone", "AxLimeStone", "_AxTab", "AxTab", "BehaviorSubject", "Subject", "init", "AxLoad", "ticketType", "activeTab", "projNr", "poolNr", "ticketTypeNr", "personTypeNr", "hasTimeSlots", "packagePositionNr", "ticketValues", "CompPackOrderTicketValues", "timeSlotDayList", "timeSlotGroupKeyList", "ticketsSlotsTag", "$hiddenViewDataHolder", "timeSlotsViewData", "_a", "timeSlotList", "selector", "entry", "timeSlotKey", "TimeSlotKey", "e", "_g", "_d", "_c", "_b", "_f", "_e", "ticketTypeNo", "packagePosNr", "selectedTimeSlots", "timeSlotKeyList", "$currentTarget", "timeSlotGroupKey", "selectedIndex", "i", "tmpSlot", "tmpSlotEntryTemp", "slot", "$timeButton", "dayData", "selectedTimeSlot", "timeSlotDay", "groupKey", "oldStatus", "newStatus", "x", "langID", "selectedTimeslots", "index", "el", "$button", "color", "$template", "isMultiDay", "selectedSlot", "timeSlot", "$entry", "label", "timeslot", "subC", "time", "timeSlotByDay", "nearestTimeSlot", "alwaysSame", "slotDay", "timeSlotGroupSameDay", "currentOffset", "offset", "triggerChecks", "$elem", "timeSlotKey1", "timeSlotKey2", "checkSuballotmentQuantity", "$activeTab", "currentTimeSlot", "selected", "$productSelection", "productSelectionColor", "configActiveTab", "timeSlotSelected", "__decorate", "ModuleName", "CompPackOrderLessonProgramValues", "lessonProjNr", "lessonGroupNr", "lessonDefNr", "lessonProgramNr", "lessonProgramProjNr", "lessonProgramGroupNr", "CompPackBookingLessonProgramOptions", "AxDropdown", "AxLoading", "init", "AxLoad", "$selected", "$currentSelected", "lessonProjNr", "lessonGroupNr", "lessonGroupDefNr", "lessonProgramProjNr", "lessonProgramGroupNr", "lessonProgramNr", "lessonProgramValues", "CompPackOrderLessonProgramValues", "data", "timeSlotData", "_a", "result", "__decorate", "ModuleName", "CompPackBookingPersonOptions", "AxDropdown", "CustomerLessonProperties", "init", "AxLoading", "AxLoad", "_", "value", "accountId", "unitInt", "data", "result", "InitCustomerProps", "e", "$parent", "feet", "inches", "totalInches", "meters", "weight", "userSkillLevel", "x", "$target", "i", "skillLevelId", "__decorate", "ModuleName", "CompPackOrderRentalValues", "rentalItemNr", "rentalPersTypeNr", "packagePositionNr", "CompPackBookingRentalOptions", "AxDropdown", "init", "PriceHelper", "AxLoad", "rentalItem", "rentalValues", "CompPackOrderRentalValues", "i", "obj", "id", "AxCheck", "object", "packagePrice", "additionalPrice", "additionalItemsSelected", "check", "rentalItemId", "personType", "packagePositionNr", "additionalRentalItem", "additionalRentalOrder", "rentalItemPrice", "newPrice", "x", "locationId", "__decorate", "ModuleName", "CompPackOrderLessonValues", "lessonsNr", "lessonWebNr", "lessonArcNr", "lessonDefNr", "packagePositionNr", "CompPackBookingLessonOptions", "AxDropdown", "init", "AxLoad", "lesson", "$target", "lessonsNr", "lessonWebNr", "lessonArcNr", "lessonDefNr", "packagePositionNr", "lessonValues", "CompPackOrderLessonValues", "__decorate", "ModuleName", "Redirect", "_AxLoading", "AxLoading", "init", "e", "__decorate", "ModuleName", "ComplexPackageSearchBar", "_I18nHelper", "I18nHelper", "AxDropdown", "initData", "event", "target", "x", "currentFromDate", "formattedDate", "Mode", "currentToDate", "legendTarget", "axDatePicker", "onChange", "checkDate", "mode", "dropDown", "currentDate", "endDate", "AxDatePicker", "y", "cell", "datePicker", "that", "startDate", "res", "rej", "availableDates", "currentUrl", "newUrl", "clickedElement", "locationSelect", "fromDateString", "toDateString", "__decorate", "ModuleName", "LessonsLoadingSpinner", "init", "AxLoading", "element", "key", "__decorate", "ModuleName", "Eguma", "_AxLimestone", "AxLimeStone", "init", "PriceHelper", "x", "egumaVoucher", "resp", "__decorate", "ModuleName", "ShoppingCartPersonalisation", "init", "__decorate", "ModuleName", "ShoppingCartReservationTimer", "init", "AxLoading", "reservationTimeHolders", "i", "result", "reservationEndTimeString", "reservationHolderElem", "diffTime", "duration", "interval", "temp", "x", "durationNumber", "minutes", "seconds", "__decorate", "ModuleName", "import_sweetalert2", "B2BHistory", "_I18nHelper", "I18nHelper", "_axLoading", "AxLoading", "init", "x", "$x", "posNr", "transNr", "resp", "e", "$elem", "serialNr", "poolNr", "data", "result", "Swal", "Translations", "__decorate", "ModuleName", "ShoppingCartEntryRetail", "_axLoading", "AxLoading", "AxDropdown", "init", "$parent", "value", "cartEntryID", "quantity", "orgQuantity", "x", "__decorate", "ModuleName", "FindMyTicket", "_i18nHelper", "I18nHelper", "AxDropdown", "init", "$x", "y", "inputMaskHelper", "x", "target", "$target", "value", "mobileTriggered", "$parent", "wtpNr", "resp", "data", "AxAlert", "__decorate", "ModuleName", "QrScanner", "wtpScanner", "callback", "md", "devices", "device", "options", "hasWebcam", "result", "wtpMatch", "e", "MyChipCards", "_wtpScanner", "wtpScanner", "init", "x", "$target", "data", "resp", "target", "inputMaskHelper", "AxAlert", "__decorate", "ModuleName", "UtilityInit", "init", "tippy_esm_default", "__decorate", "ModuleName", "import_sweetalert2", "AxFireShoppingCartModal", "AxFireShoppingCartModal_1", "LimeStone", "AxLimeStone", "I18nHelper", "init", "result", "resetQuantity", "continueShoppingPath", "configModule", "AxLoad", "_", "route", "redirect", "title", "Translations", "Swal", "continuePath", "__decorate", "ModuleName", "AxStaticConfigModule", "AxStaticConfigModule_1", "init", "__decorate", "ModuleName", "silent", "AxGA4Module", "init", "AxStaticConfigModule", "call", "proceedToCheckout", "deleteItem", "e", "x", "dataTarget", "resp", "data", "rentalItemParam", "value", "packOrRental", "jsonObj", "parsedObject", "respData", "argPackageNr", "argTariffSheetNr", "rentalItem", "configModule", "AxLoad", "__decorate", "ModuleName", "import_sweetalert2", "ServerErrorPopUp", "I18nHelper", "init", "errorText", "Translations", "Swal", "__decorate", "ModuleName", "VoucherPayment", "_AxLimestone", "AxLimeStone", "_i18nHelper", "I18nHelper", "init", "PriceHelper", "x", "voucherData", "resp", "Translations", "__decorate", "ModuleName", "Unsubscribe", "token", "that", "unsubscribeUrl", "__decorate", "ModuleName", "Banner", "_cookieHelper", "CookieHelper", "init", "$alertBanner", "$infoBanner", "bannerId", "x", "__decorate", "ModuleName", "HeroModule", "init", "scroll", "__decorate", "ModuleName", "import_sweetalert2", "Payment", "_Progressbar", "ProgressBar", "_I18nHelper", "I18nHelper", "init", "progress", "ProgressBarMode", "e", "waiverId", "postData", "ticketDefIsKGT23", "currentDate", "momentInstance", "value", "index", "cartEntryDate", "_b", "_a", "Swal", "Translations", "result", "waiverModalNr", "name", "__decorate", "ModuleName", "ls", "AccountStorageService", "formData", "LocalStorageKeyCollection", "referrer", "currentUrl", "refParam", "data", "url", "pathChunks", "_a", "x", "Registration", "_storage", "AccountStorageService", "_requestHelper", "RequestHelper", "AxDropdown", "I18nHelper", "init", "AxLoad", "currentUrl", "currentStorage", "x", "y", "e", "rentalViewModel", "resp", "AxFormValidation", "hasValues", "hasSameValue", "hasGuestFieldErrors", "$selected", "isoCode", "countryEntry", "res", "subDivisionList", "postalCode", "$dropDownParent", "$stateField", "selectedDivision", "newInfoDiv", "newInfoInput", "newInfoLabel", "Translations", "newInfoDivGroupAssistance", "that", "$parent", "value", "__decorate", "ModuleName", "RegisterForm", "_requestHelper", "RequestHelper", "_axButton", "AxButton", "_storage", "AccountStorageService", "I18nHelper", "init", "AxModal", "AxInput", "AxLoad", "AxFormValidation", "form", "event", "storageData", "resp", "show", "consentDeliveryInfo", "email", "result", "value", "dropdownVal", "element", "termsCheck", "addCheck", "index", "elem", "temp", "i", "val", "baseForm", "rentalForm", "e", "languages", "languageCode", "l", "__decorate", "ModuleName", "InitCustomerProps", "parentId", "formElementPrefix", "PersonalData", "AxDropdown", "I18nHelper", "AccountRentalData", "CustomerLessonProperties", "init", "AccountRentalDataInitData", "x", "y", "observerConfig", "countryObserver", "mutationsList", "mutation", "isoCode", "AxLoad", "e", "languages", "languageCode", "$searchables", "country", "countryName", "countryEntry", "res", "subDivisionList", "postalCode", "$dropDownParent", "$stateField", "selectedDivision", "newInfoDiv", "newInfoInput", "newInfoLabel", "Translations", "newInfoDivGroupAssistance", "__decorate", "ModuleName", "import_sweetalert2", "Resubscribe", "I18nHelper", "AxLoading", "resp", "Swal", "Translations", "result", "partial", "__decorate", "ModuleName", "import_sweetalert2", "MissingMandatoryData", "I18nHelper", "AccountRentalData", "init", "AccountRentalDataInitData", "event", "element", "resp", "Swal", "Translations", "result", "__decorate", "ModuleName", "MaintenanceScriptInfo", "init", "x", "progess", "percentDone", "__decorate", "ModuleName", "RentalMain", "_requestHelper", "RequestHelper", "AxDropdown", "glide", "Components", "Events", "PREV_CONTROL_SELECTOR", "NEXT_CONTROL_SELECTOR", "component", "perView", "slidesCount", "init", "RentalMainMobilePortlet", "AxInput", "AxDatePicker", "endDate", "Mode", "x", "cell", "arc", "duration", "cat", "date", "url", "i", "glideID", "rows", "smallGap", "glide_esm_default", "e", "__decorate", "ModuleName", "RentalMainMobilePortlet", "SearchStates", "rentalMainModule", "init", "endDate", "AxDatePicker", "Mode", "x", "searchVal", "e", "originalPosition", "currentLocationValue", "currentDateValue", "currentDurationValue", "wrapper", "innerWrapper", "locationElem", "iconWrapper", "iconElem", "textWrapper", "currentCell", "value", "str", "RentalFilterResetHelper", "rentalFilterModule", "triggerChangeEvent", "$elem", "RentalFilterPriceSlider", "rentalFilterModule", "AxLoading", "filterListEmpty", "_a", "min", "prev", "curr", "max", "x", "priceFilteredItems", "y", "item", "entriesLeft", "event", "tariff", "RentalFilter", "_axLoading", "AxLoading", "_bodyUtility", "BodyUtility", "_requestHelper", "RequestHelper", "_filterResetHelper", "RentalFilterResetHelper", "i18nHelper", "I18nHelper", "AxDropdown", "init", "RentalFilterPriceSlider", "active", "count", "Translations", "AxDatePicker", "endDate", "Mode", "parent", "element", "x", "request", "url", "filterCount", "rangeSlider", "requestObj", "urlPath", "arcId", "durationIdentifier", "dateCell", "catId", "date", "dateRaw", "durationId", "cell", "__decorate", "ModuleName", "LocalizationModule", "init", "__decorate", "ModuleName", "BleQrCodes", "init", "I18nHelper", "parentName", "loadTicketButton", "e", "cartEntryId", "orderNr", "mode", "copyLinkButton", "text", "Translations", "data", "resp", "bleBcIdentifierName", "txt", "addOverlay", "scrollTop", "__decorate", "ModuleName", "ShoppingCartDateInputTriple", "_dateInitData", "BirthDateInitData", "init", "i", "e", "cartEntryId", "dateInitData", "AxLoad", "__decorate", "ModuleName", "BirthDateInitData", "RentalProdSelectionTimings", "RentDetailsProdSelectTimings", "init", "prodSelectComponentManager", "AxDatePicker", "AxDropdown", "RentalProdSelectionTimings", "endDate", "Mode", "$parent", "instance", "x", "cell", "dateValue", "elem", "import_photoswipe", "import_photoswipe_ui_default", "RentalDetailLightbox", "_assetHelper", "AssetHelper", "assetList", "swiper", "core_class_default", "x", "src", "index", "swiperAssets", "count", "image", "imageSrc", "tmp", "swipeElem", "PhotoSwipe", "PhotoSwipeUI_Default", "RentDetailsProdSelectionAbstract", "bookingTimeParameterSelection", "AxLoad", "PriceHelper", "locationId", "RentDetailsSingleItemSelectionSection", "wrapperElement", "pricesPerPersonType", "PriceHelper", "localizationModule", "AxLoad", "basePriceLabelText", "sumPriceLabelPrice", "personTypePrice", "x", "axCounter", "AxCounter", "RentDetailsProdSelectSingleItemHandler", "RentDetailsProdSelectionAbstract", "prodSelectionTimings", "pricesPerPersonType", "rentalProductPortlets", "i", "wrapperElement", "rentalPackSelection", "RentDetailsSingleItemSelectionSection", "selectionTotalPrice", "packPriceTotal", "selectionTotalCount", "selectionComp", "tempArr", "tempItem", "postData", "data", "RequestHelper", "RentalDetailsPackOptionSelectionItem", "productId", "packagePosition", "productName", "productPrice", "isSelected", "RentDetailsProdOptItemSelectSection", "availableOptionalItems", "drawSeparator", "wrapper", "parentComponent", "row", "separator", "i", "newItemSelectionData", "RentalDetailsPackOptionSelectionItem", "checkBoxCol", "x", "optItemsTotalPrice", "y", "selectionData", "optionalItem", "col", "checkboxWrapper", "localizationModule", "AxLoad", "priceString", "PriceHelper", "optionalItemLabelString", "label", "optionalItemIdentifier", "checkBox", "span", "event", "RentDetailsPackItemSelectionSection", "wrapperElement", "packageList", "localizationModule", "AxLoad", "PriceHelper", "postData", "i", "packageSelectionData", "basePriceLabelText", "sumPriceLabelPrice", "optItemsTotalPrice", "optItemSection", "packageData", "x", "temp", "optionalItem", "RentalDetailsPackOptionSelectionItem", "_a", "count", "wrapperId", "wrapper", "optionalItemSection", "RentDetailsProdOptItemSelectSection", "axCounter", "AxCounter", "RentDetailsProdSelectPackHandler", "RentDetailsProdSelectionAbstract", "prodSelectionTimings", "packageList", "rentalPackageWrappers", "i", "wrapperElement", "rentalPackSelectionSection", "RentDetailsPackItemSelectionSection", "selectionTotalPrice", "packPriceTotal", "selectionTotalCount", "selectionComp", "selectedPackages", "tempPack", "postDataPack", "data", "RequestHelper", "RentDetailsProdSelectCompManager", "rentalSelectionItem", "AxLoading", "AxDropdown", "prodSelectionTimings", "data", "url", "res", "returnView", "retailsAlertBannerData", "DetailsAlertBannersData", "alertBannerText", "alertElement", "rentalDetailsAlertBannerData", "alertMsgHolderDiv", "headerParagraph", "alertMesg", "index", "paragraph", "result", "pricesPerPersonType", "RentDetailsProdSelectSingleItemHandler", "packageList", "RentDetailsProdSelectPackHandler", "elem", "arcNr", "rentalProductDetailsModule", "AxLoad", "arcAlertBannerHeaderText", "arcAlertMessages", "pickupTimeAtAllArcsValid", "RentalProductDetails", "init", "I18nHelper", "AxLoading", "localizationModule", "AxLoad", "RentalDetailLightbox", "PriceHelper", "RentDetailsProdSelectCompManager", "RentDetailsProdSelectTimings", "locationIsSet", "timingsSet", "quantityOk", "totalPrice", "bntText", "Translations", "__decorate", "ModuleName", "DateModule", "init", "__decorate", "ModuleName", "RentalShopDetails", "init", "glide_esm_default", "__decorate", "ModuleName", "import_mobile_detect", "flushPending", "flushing", "queue", "lastFlushedIndex", "scheduler", "callback", "queueJob", "job", "queueFlush", "dequeueJob", "index", "flushJobs", "i", "reactive", "effect", "release", "raw", "shouldSchedule", "disableEffectScheduling", "setReactivityEngine", "engine", "task", "overrideEffect", "override", "elementBoundEffect", "el", "cleanup2", "effectReference", "watch", "getter", "firstTime", "oldValue", "value", "onAttributeAddeds", "onElRemoveds", "onElAddeds", "onElAdded", "onElRemoved", "onAttributesAdded", "onAttributeRemoved", "name", "cleanupAttributes", "names", "cleanupElement", "_a", "_b", "observer", "onMutate", "currentlyObserving", "startObservingMutations", "stopObservingMutations", "flushObserver", "queuedMutations", "records", "queueLengthWhenTriggered", "mutateDom", "result", "isCollecting", "deferredMutations", "deferMutations", "flushAndStopDeferringMutations", "mutations", "addedNodes", "removedNodes", "addedAttributes", "removedAttributes", "node", "add2", "remove", "attrs", "scope", "mergeProxies", "closestDataStack", "addScopeToNode", "data2", "referenceNode", "objects", "mergeProxyTrap", "obj", "thisProxy", "collapseProxies", "target", "descriptor", "acc", "key", "initInterceptors", "isObject2", "val", "recurse", "basePath", "enumerable", "path", "interceptor", "mutateObj", "get", "set", "initialValue", "initialize", "innerValue", "carry", "segment", "magics", "magic", "injectMagics", "memoizedUtilities", "getUtilities", "utilities", "getElementBoundUtilities", "utils", "__spreadValues", "tryCatch", "expression", "args", "e", "handleError", "error2", "shouldAutoEvaluateFunctions", "dontAutoEvaluateFunctions", "cache", "evaluate", "extras", "evaluateLater", "theEvaluatorFunction", "normalEvaluator", "setEvaluator", "newEvaluator", "overriddenMagics", "dataStack", "evaluator", "generateEvaluatorFromFunction", "generateEvaluatorFromString", "func", "receiver", "scope2", "params", "runIfTypeOfFunction", "evaluatorMemo", "generateFunctionFromString", "AsyncFunction", "__async", "rightSideSafeExpression", "func2", "completeScope", "promise", "prefixAsString", "prefix", "subject", "setPrefix", "newPrefix", "directiveHandlers", "directive", "directive2", "pos", "directiveOrder", "directiveExists", "directives", "attributes", "originalAttributeOverride", "vAttributes", "staticAttributes", "attributesOnly", "attribute", "attr", "transformedAttributeMap", "toTransformedAttributes", "newName", "oldName", "outNonAlpineAttributes", "toParsedDirectives", "byPriority", "getDirectiveHandler", "isDeferringHandlers", "directiveHandlerStacks", "currentHandlerStackKey", "deferHandlingDirectives", "flushHandlers", "stopDeferring", "cleanups", "effect3", "cleanupEffect", "alpine_default", "noop", "handler4", "fullHandler", "startingWith", "replacement", "into", "newValue", "attributeTransformers", "transform", "mapAttributes", "alpineAttributeRegex", "typeMatch", "valueMatch", "modifiers", "original", "DEFAULT", "a", "b", "typeA", "typeB", "dispatch", "detail", "walk", "el2", "skip", "warn", "message", "started", "start", "initTree", "destroyTree", "handle", "outNestedComponents", "closestRoot", "allSelectors", "warnAboutMissingPlugins", "rootSelectorCallbacks", "initSelectorCallbacks", "rootSelectors", "fn", "addRootSelector", "selectorCallback", "addInitSelector", "includeInitSelectors", "findClosest", "element", "selector", "isRoot", "initInterceptors2", "interceptInit", "markerDispenser", "walker", "intercept", "root", "plugin2", "selectors", "tickStack", "isHolding", "nextTick", "releaseNextTicks", "res", "holdNextTicks", "setClasses", "setClassesFromString", "setClassesFromObject", "classString", "split", "classString2", "missingClasses", "addClassesAndReturnUndo", "classes", "classObject", "forAdd", "bool", "forRemove", "added", "removed", "setStyles", "setStylesFromObject", "setStylesFromString", "previousStyles", "value2", "kebabCase", "once", "fallback", "called", "evaluate2", "registerTransitionsFromHelper", "registerTransitionsFromClassString", "stage", "registerTransitionObject", "doesntSpecify", "transitioningIn", "transitioningOut", "wantsAll", "wantsOpacity", "wantsScale", "opacityValue", "scaleValue", "modifierValue", "delay", "origin", "property", "durationIn", "durationOut", "easing", "setFunction", "defaultValue", "before", "after", "transition", "show", "hide", "nextTick2", "clickAwayCompatibleShow", "resolve", "reject", "closest", "closestHide", "hideAfterChildren", "parent", "during", "start2", "end", "undoStart", "undoDuring", "undoEnd", "performTransition", "stages", "interrupted", "reachedBefore", "reachedEnd", "finish", "duration", "rawValue", "match", "isCloning", "skipDuringClone", "onlyDuringClone", "interceptors", "interceptClone", "cloneNode", "from", "to", "dontRegisterReactiveSideEffects", "isCloningLegacy", "clone", "oldEl", "newEl", "cloneTree", "hasRunThroughFirstEl", "el3", "callback2", "storedEffect", "bind", "camelCase", "bindInputValue", "bindStyles", "bindClasses", "bindAttributeAndProperty", "bindAttribute", "isRadio", "safeParseBoolean", "checkedAttrLooseCompare", "isCheckbox", "updateSelect", "setPropertyIfChanged", "attributeShouldntBePreservedIfFalsy", "isBooleanAttr", "setIfChanged", "attrName", "propName", "arrayWrappedValue", "option", "char", "valueA", "valueB", "booleanAttributes", "getBinding", "getAttributeBinding", "extractProp", "extract", "binding", "debounce", "wait", "timeout", "context", "later", "throttle", "limit", "inThrottle", "entangle", "outerGet", "outerSet", "innerGet", "innerSet", "firstRun", "outerHash", "innerHash", "reference", "outer", "inner", "cloneIfObject", "outerHashLatest", "innerHashLatest", "plugin", "stores", "isReactive", "store", "getStores", "binds", "bind2", "bindings", "getBindings", "applyBindingsObject", "injectBindingProviders", "cleanupRunners", "datas", "data", "injectDataProviders", "Alpine", "makeMap", "str", "expectsLowerCase", "map", "list", "specialBooleanAttrs", "isBooleanAttr2", "EMPTY_OBJ", "EMPTY_ARR", "hasOwnProperty", "hasOwn", "isArray", "isMap", "toTypeString", "isString", "isSymbol", "isObject", "objectToString", "toRawType", "isIntegerKey", "cacheStringFunction", "camelizeRE", "camelize", "_", "c", "hyphenateRE", "hyphenate", "capitalize", "toHandlerKey", "hasChanged", "targetMap", "effectStack", "activeEffect", "ITERATE_KEY", "MAP_KEY_ITERATE_KEY", "isEffect", "effect2", "options", "createReactiveEffect", "stop", "cleanup", "uid", "enableTracking", "resetTracking", "deps", "shouldTrack", "trackStack", "pauseTracking", "last", "track", "type", "depsMap", "dep", "trigger", "oldTarget", "effects", "effectsToAdd", "key2", "run", "isNonTrackableKeys", "builtInSymbols", "get2", "createGetter", "readonlyGet", "arrayInstrumentations", "createArrayInstrumentations", "instrumentations", "arr", "toRaw", "l", "isReadonly", "shallow", "shallowReadonlyMap", "readonlyMap", "shallowReactiveMap", "reactiveMap", "targetIsArray", "isRef", "readonly", "reactive2", "set2", "createSetter", "hadKey", "deleteProperty", "has", "ownKeys", "mutableHandlers", "readonlyHandlers", "toReactive", "toReadonly", "toShallow", "getProto", "v", "get$1", "isShallow", "rawTarget", "rawKey", "has2", "wrap", "has$1", "size", "add", "set$1", "get3", "checkIdentityKeys", "deleteEntry", "clear", "hadItems", "createForEach", "thisArg", "observed", "createIterableMethod", "method", "targetIsMap", "isPair", "isKeyOnly", "innerIterator", "done", "createReadonlyMethod", "createInstrumentations", "mutableInstrumentations2", "shallowInstrumentations2", "readonlyInstrumentations2", "shallowReadonlyInstrumentations2", "mutableInstrumentations", "readonlyInstrumentations", "shallowInstrumentations", "shallowReadonlyInstrumentations", "createInstrumentationGetter", "mutableCollectionHandlers", "readonlyCollectionHandlers", "targetTypeMap", "rawType", "getTargetType", "createReactiveObject", "baseHandlers", "collectionHandlers", "proxyMap", "existingProxy", "targetType", "proxy", "evaluateLater2", "unwatch", "getArrayOfRefObject", "refObjects", "globalIdMemo", "findAndIncrementId", "closestIdRoot", "setIdRoot", "cacheKey", "cacheIdByNameOnElement", "id", "output", "warnMissingPluginMagic", "magicName", "slug", "evaluateInnerSet", "releaseEntanglement", "getTarget", "clone2", "eventName", "placeInDom", "clone3", "target2", "modifiers2", "teleportContainerDuringClone", "handler", "on", "event", "listenerTarget", "wrapHandler", "wrapper", "dotSyntax", "camelCase2", "nextModifier", "isNumeric", "next", "isKeyEvent", "isClickEvent", "isListeningForASpecificKeyThatHasntBeenPressed", "kebabCase2", "keyModifiers", "debounceIndex", "keyToModifiers", "selectedSystemKeyModifiers", "modifier", "modifierToKeyMap", "scopeTarget", "evaluateGet", "evaluateSet", "getValue", "isGetterSetter", "setValue", "removeListener", "getInputValue", "removeResetListener", "currentValue", "safeParseNumber", "checkedAttrLooseCompare2", "number", "isNumeric2", "handler2", "bindingProviders", "storeKeyForXFor", "shouldSkipRegisteringDataDuringClone", "magicContext", "dataProviderContext", "reactiveData", "undo", "toggle", "iteratorNames", "parseForExpression", "evaluateItems", "evaluateKey", "loop", "templateEl", "items", "isNumeric3", "lookup", "prevKeys", "scopes", "keys", "getIterationScopeVariables", "adds", "moves", "removes", "sames", "lastKey", "prevIndex", "keyInSpot", "keyForSpot", "elInSpot", "elForSpot", "marker", "lastKey2", "lastEl", "reactiveScope", "newScope", "forIteratorRE", "stripParensRE", "forAliasRE", "inMatch", "item", "iteratorMatch", "scopeVariables", "handler3", "warnMissingPluginDirective", "directiveName", "src_default", "module_default", "ProductAndRiderDetailsService", "_ProductAndRiderDetailsService", "productInfoPortlets", "productAndRiderDetails", "RentalAllowedStatus", "rentalItemId", "isAllowed", "errorMessage", "CheckAllowedRentalIItemsService", "_CheckAllowedRentalIItemsService", "AxLoad", "customerAccountNr", "productAndRiderDetails", "ProductAndRiderDetailsService", "rentalItemId", "customerSelectedItems", "x", "data", "url", "resolve", "reject", "res", "rentalAllowedStatus", "RentalAllowedStatus", "error", "RiderSelection", "AxDropdown", "AxLoad", "module_default", "PriceHelper", "productAndRiderDetails", "elem", "accountId", "currentAccountId", "_a", "ConfigHelper", "ConfigDefinition", "rentalIsAllowedActivated", "rentalAllowed", "checkAllowedRentalIItemsService", "CheckAllowedRentalIItemsService", "rentalAllowedStatus", "error", "text", "mode", "productName", "price", "dateOdBirth", "email", "x", "ProductInfoPortlet", "element", "addToCartModel", "AxLoad", "AxLoading", "x", "valid", "_a", "_b", "prom", "asyncValid", "i18nHelper", "I18nHelper", "Translations", "text", "$parent", "value", "intValue", "instance", "LockerData", "AxDropdown", "AxLoad", "validationFormOptions", "form", "inputs", "AxFormValidation", "i", "input", "AxInput", "_a", "resolve", "reject", "resp", "element", "p", "value", "inputMaskHelper", "x", "productAndRiderDetails", "lockerWtpNrTemp", "parent", "intValue", "RiderData", "Models", "RiderDetailsModelBundle", "import_ts_input_mask", "PersonDataForm", "unitSystem", "AxDropdown", "AxLoad", "productAndRiderDetails", "resolve", "ConfigHelper", "ConfigDefinition", "useTextInput", "__awaiter", "validationFormOptions", "form", "inputs", "AxFormValidation", "i", "input", "AxInput", "radio", "event", "selectedVal", "e", "weightInLbs", "heightInMeter", "kg", "lbs", "meters", "feet", "inches", "totalInches", "heightInInches", "weight", "height", "_a", "RiderData", "elem", "value", "that", "dropdownVal", "inputElement", "listener", "maskFilled", "extractedValue", "formattedText", "DropdownOption", "label", "value", "DropdownComponent", "selector", "parentId", "labelText", "options", "allRentalProperties", "onSelectCallback", "AxDropdown", "initialOptions", "notAvailableOptions", "option", "opt", "item", "array", "existingItem", "elem", "dropdown", "dropdownTrigger", "selectionSpan", "ul", "optionElement", "textLeft", "text", "WtpRentalPropertyRequestData", "propertyId", "propertyType", "isStringValue", "GetRentalPropertiesResultDto", "message", "success", "setSelectedProperties", "portlet", "property", "retrievedProperty", "prop", "RentalPropertiesSelection", "prodRiderAndDetails", "I18nHelper", "_a", "item", "RentalPropertyPortlet", "propertyToSelect", "selectedValue", "packItem", "x", "_b", "result", "requestData", "WtpRentalPropertyRequestData", "propertySelection", "PropertyToSelect", "options", "onSelectCallback", "dropDown", "DropdownComponent", "itemId", "url", "data", "resolve", "res", "getRentalPropertiesResult", "GetRentalPropertiesResultDto", "rentalPropertyValues", "value", "itemName", "packagePosition", "AxLoading", "holder", "RandomHelper", "header", "Translations", "wtpRentalPropertyRequestData", "dropdownComponent", "availableValues", "DropdownOption", "Components", "RiderDetailsCompBundle", "RiderDetailsModule", "init", "AxLoading", "MobileDetect", "RiderSelection", "activatedProductPortlet", "productPortlet", "holder", "prodAndRiderDetails", "RentalPropertiesSelection", "accountId", "url", "proAndRiderDetails", "data", "LoadingSpinnerPositionEnum", "res", "RequestHelper", "PersonDataForm", "x", "productAndRiderDetailsList", "allPortlets", "productPosition", "productAndRiderDetails", "newPortlet", "ProductInfoPortlet", "valid", "portlet", "index", "everyThingSet", "i", "_b", "_a", "ProductAndRiderDetailsService", "AxLoad", "LockerData", "errorMsg", "personDataForm", "prodDetails", "RiderData", "__decorate", "ModuleName", "LessonFilter", "initData", "Subject", "date", "dateM", "picker", "searchDto", "level", "location", "quantity", "x", "datePickerOptions", "Mode", "tmp", "AxDatePicker", "elem", "tmp2", "AxDropdown", "pType", "tmpCounter", "AxCounter", "n", "cell", "$target", "_a", "currentMom", "p", "monthDisplay", "searchData", "SearchDto", "checkbox", "selectedLevelNames", "i", "e", "text", "html", "txt", "LandingPage", "_lessonFilter", "LessonFilter", "_requestHelper", "RequestHelper", "initData", "AxModal", "AxLoad", "defaultLevel", "x", "currentSearch", "__decorate", "ModuleName", "AxFilterOverlay", "_bodyUtility", "BodyUtility", "init", "e", "active", "__decorate", "ModuleName", "SelectionAddSlot", "_priceHelper", "PriceHelper", "_requestHelper", "RequestHelper", "_i18nHelper", "I18nHelper", "_axLimestone", "AxLimeStone", "_axLoading", "AxLoading", "lessonFilter", "init", "AxLoad", "AxModal", "e", "x", "dataToSend", "y", "pre", "cur", "queryString", "parent", "$parent", "existingCart", "pack", "pType", "tmpCounter", "AxCounter", "n", "date", "$target", "arcNr", "lessonWebNr", "lessonDefNr", "lessonNr", "locationId", "levelNr", "resolve", "resp", "from", "to", "entry", "$template", "location", "level", "quantity", "$lessonButton", "existingEntry", "quantities", "SelectionCart", "tmpCart", "price", "cartItem", "unique", "Translations", "curr", "existingQ", "maxQ", "_a", "total", "totalQ", "listElem", "totalQuantity", "availableSlots", "pTypeQuantity", "_d", "_c", "_b", "tmpQuantity", "base", "tmpPackages", "Selection", "_axLoading", "AxLoading", "_lessonFilter", "LessonFilter", "_filterOverlay", "AxFilterOverlay", "_selectionAddSlot", "SelectionAddSlot", "_i18nHelper", "I18nHelper", "init", "e", "direction", "targetDate", "x", "searchDate", "bufferE", "$target", "bodyE", "instance", "tippy_esm_default", "$parent", "$popperInstance", "_a", "AxLoad", "defaultLevel", "currentTargetDate", "currentMom", "tmpMom", "i", "target", "$targetElem", "$targetHead", "currentSearch", "levelText", "Translations", "infoText", "text", "pTypeArr", "pType", "name", "locationArray", "date", "clone", "resp", "startOfWeek", "activeIndex", "count", "$bodyE", "options", "callback", "entries", "observer", "originalTrack", "entry", "trackedDate", "glide_esm_default", "move", "orgDate", "currentDate", "thisWeekDiff", "previousX", "previousRatio", "firstOfMonth", "currTrans", "currentX", "currentRatio", "switchDirection", "firstOfMonthDow", "nextMonth", "newMonthName", "element", "index", "__decorate", "ModuleName", "import_sweetalert2", "import_ts_input_mask", "PersonDataForm", "unitSystem", "AxDropdown", "riderData", "resolve", "Subject", "ConfigHelper", "ConfigDefinition", "useTextInput", "__awaiter", "validationFormOptions", "form", "inputs", "AxFormValidation", "i", "input", "AxInput", "radio", "event", "selectedVal", "e", "weightInLbs", "heightInMeter", "kg", "lbs", "meters", "feet", "inches", "totalInches", "heightInInches", "weight", "height", "_a", "RiderData", "elem", "value", "that", "dropdownVal", "inputElement", "listener", "maskFilled", "extractedValue", "formattedText", "Personalization", "_axLoading", "AxLoading", "_i18NHelper", "I18nHelper", "_axLimestone", "AxLimeStone", "_priceHelper", "PriceHelper", "_requestHelper", "RequestHelper", "init", "persDropdowns", "AxDropdown", "AxModal", "p", "e", "$parent", "$packageBlock", "currentPersonValue", "$header", "_b", "_a", "$blockTrigger", "resp", "newCount", "$nextBlockTrigger", "x", "result", "Swal", "Translations", "price", "pack", "pPrice", "pos", "newestMember", "a", "b", "dropdownE", "popperE", "template", "value", "riderData", "packNr", "tariffSheetNr", "index", "lessonNr", "cartEntry", "div", "$div", "personDataForm", "PersonDataForm", "inputs", "input", "data", "elem", "checkbox", "$elem", "packageNr", "tariffSheet", "packageEntry", "itemList", "box", "checked", "packagePosNr", "toggle", "tmpRentalItem", "y", "__decorate", "ModuleName", "LessonPackageStorage", "init", "options", "b", "curr", "x", "levels", "key", "value", "__decorate", "ModuleName", "ToCheckout", "_requestHelper", "RequestHelper", "init", "result", "ProgressBarMode", "errors", "__decorate", "ModuleName", "PopUpShoppingCart", "PopUpShoppingCart_1", "_bodyUtility", "BodyUtility", "cartEntryID", "promocode", "popUpCartFiller$", "popUpShoppingCart", "url", "data", "res", "AxLoad", "spinner$", "giftCardSerialNr", "result", "giftCard", "promoCodeResult", "errorLabel", "__decorate", "ModuleName", "HttpError", "errorMessage", "statusCode", "trueProto", "TimeoutError", "AbortError", "UnsupportedTransportError", "message", "transport", "DisabledTransportError", "FailedToStartTransportError", "FailedToNegotiateWithServerError", "AggregateErrors", "innerErrors", "HttpResponse", "statusCode", "statusText", "content", "HttpClient", "url", "options", "__spreadProps", "__spreadValues", "LogLevel", "NullLogger", "_logLevel", "_message", "VERSION", "Arg", "val", "name", "values", "Platform", "_Platform", "getDataDetail", "data", "includeContent", "detail", "isArrayBuffer", "formatArrayBuffer", "view", "str", "num", "pad", "sendMessage", "logger", "transportName", "httpClient", "url", "content", "options", "__async", "headers", "value", "getUserAgentHeader", "LogLevel", "responseType", "response", "__spreadValues", "createLogger", "ConsoleLogger", "NullLogger", "SubjectSubscription", "subject", "observer", "index", "_", "minimumLogLevel", "logLevel", "message", "msg", "userAgentHeaderName", "constructUserAgent", "getOsName", "getRuntime", "getRuntimeVersion", "version", "os", "runtime", "runtimeVersion", "userAgent", "majorAndMinor", "getErrorString", "e", "getGlobalThis", "FetchHttpClient", "HttpClient", "logger", "Platform", "requireFunc", "__require", "getGlobalThis", "request", "__async", "AbortError", "abortController", "error", "timeoutId", "msTimeout", "LogLevel", "TimeoutError", "isArrayBuffer", "response", "__spreadValues", "e", "errorMessage", "deserializeContent", "HttpError", "payload", "HttpResponse", "url", "cookies", "c", "responseType", "content", "XhrHttpClient", "HttpClient", "logger", "request", "AbortError", "resolve", "reject", "xhr", "isArrayBuffer", "headers", "header", "HttpResponse", "HttpError", "LogLevel", "TimeoutError", "DefaultHttpClient", "HttpClient", "logger", "Platform", "FetchHttpClient", "XhrHttpClient", "request", "AbortError", "url", "TextMessageFormat", "_TextMessageFormat", "output", "input", "messages", "HandshakeProtocol", "handshakeRequest", "TextMessageFormat", "data", "messageData", "remainingData", "isArrayBuffer", "binaryData", "separatorIndex", "responseLength", "textData", "messages", "response", "MessageType", "Subject", "item", "observer", "err", "SubjectSubscription", "MessageBuffer", "protocol", "connection", "bufferSize", "message", "__async", "serializedMessage", "backpressurePromise", "backpressurePromiseResolver", "backpressurePromiseRejector", "isArrayBuffer", "resolve", "reject", "BufferedItem", "e", "ackMessage", "newestAckedMessage", "index", "element", "MessageType", "currentId", "sequenceId", "messages", "error", "id", "resolver", "rejector", "DEFAULT_TIMEOUT_IN_MS", "DEFAULT_PING_INTERVAL_IN_MS", "DEFAULT_STATEFUL_RECONNECT_BUFFER_SIZE", "HubConnectionState", "HubConnection", "_HubConnection", "connection", "logger", "protocol", "reconnectPolicy", "serverTimeoutInMilliseconds", "keepAliveIntervalInMilliseconds", "statefulReconnectBufferSize", "LogLevel", "Arg", "HandshakeProtocol", "data", "error", "MessageType", "url", "__async", "Platform", "handshakePromise", "resolve", "reject", "version", "handshakeRequest", "MessageBuffer", "e", "startPromise", "state", "AbortError", "methodName", "args", "streams", "streamIds", "invocationDescriptor", "promiseQueue", "subject", "Subject", "cancelInvocation", "invocationEvent", "message", "sendPromise", "newMethod", "method", "handlers", "removeIdx", "callback", "messages", "getErrorString", "responseMessage", "remainingData", "nextPing", "invocationMessage", "methods", "methodsCopy", "expectsResponse", "res", "exception", "completionMessage", "m", "prevRes", "c", "reconnectStartTime", "previousReconnectAttempts", "retryError", "nextRetryDelay", "previousRetryCount", "elapsedMilliseconds", "retryReason", "callbacks", "key", "nonblocking", "invocationId", "streamId", "err", "item", "i", "argument", "arg", "id", "result", "DEFAULT_RETRY_DELAYS_IN_MILLISECONDS", "DefaultReconnectPolicy", "retryDelays", "retryContext", "HeaderNames", "AccessTokenHttpClient", "HttpClient", "innerClient", "accessTokenFactory", "request", "__async", "allowRetry", "response", "HeaderNames", "url", "HttpTransportType", "TransferFormat", "AbortController", "LongPollingTransport", "httpClient", "logger", "options", "AbortController", "url", "transferFormat", "__async", "Arg", "TransferFormat", "LogLevel", "name", "value", "getUserAgentHeader", "headers", "__spreadValues", "pollOptions", "pollUrl", "response", "HttpError", "getDataDetail", "e", "TimeoutError", "data", "sendMessage", "deleteOptions", "error", "err", "logMessage", "ServerSentEventsTransport", "httpClient", "accessToken", "logger", "options", "url", "transferFormat", "__async", "Arg", "TransferFormat", "LogLevel", "resolve", "reject", "opened", "eventSource", "Platform", "cookies", "headers", "name", "value", "getUserAgentHeader", "__spreadValues", "e", "getDataDetail", "error", "data", "sendMessage", "WebSocketTransport", "httpClient", "accessTokenFactory", "logger", "logMessageContent", "webSocketConstructor", "headers", "url", "transferFormat", "__async", "Arg", "TransferFormat", "LogLevel", "token", "resolve", "reject", "webSocket", "cookies", "opened", "Platform", "name", "value", "getUserAgentHeader", "HeaderNames", "__spreadValues", "_event", "event", "error", "message", "getDataDetail", "data", "MAX_REDIRECTS", "HttpConnection", "url", "options", "Arg", "createLogger", "webSocketModule", "eventSourceModule", "Platform", "__require", "requireFunc", "AccessTokenHttpClient", "DefaultHttpClient", "transferFormat", "__async", "TransferFormat", "LogLevel", "message", "AbortError", "data", "TransportSendQueue", "error", "resolve", "e", "HttpTransportType", "negotiateResponse", "redirects", "accessToken", "LongPollingTransport", "headers", "name", "value", "getUserAgentHeader", "negotiateUrl", "response", "__spreadValues", "FailedToNegotiateWithServerError", "errorMessage", "HttpError", "connectionToken", "requestedTransport", "requestedTransferFormat", "connectUrl", "transportExceptions", "transports", "negotiate", "endpoint", "transportOrError", "ex", "FailedToStartTransportError", "AggregateErrors", "transport", "WebSocketTransport", "ServerSentEventsTransport", "callStop", "useStatefulReconnect", "transportMatches", "s", "UnsupportedTransportError", "DisabledTransportError", "aTag", "searchParams", "actualTransport", "_TransportSendQueue", "_transport", "PromiseSource", "transportResult", "arrayBuffers", "totalLength", "b", "result", "offset", "item", "reject", "reason", "JSON_HUB_PROTOCOL_NAME", "JsonHubProtocol", "TransferFormat", "input", "logger", "NullLogger", "messages", "TextMessageFormat", "hubMessages", "message", "parsedMessage", "MessageType", "LogLevel", "value", "errorMessage", "LogLevelNameMapping", "LogLevel", "parseLogLevel", "name", "mapping", "HubConnectionBuilder", "logging", "Arg", "isLogger", "logLevel", "ConsoleLogger", "url", "transportTypeOrOptions", "__spreadValues", "__spreadProps", "protocol", "retryDelaysOrReconnectPolicy", "DefaultReconnectPolicy", "milliseconds", "options", "httpConnectionOptions", "connection", "HttpConnection", "HubConnection", "NullLogger", "JsonHubProtocol", "logger", "OneRiskNotification", "HubConnectionBuilder", "err", "message", "jsonData", "import_sweetalert2", "OneRisk", "_Progressbar", "ProgressBar", "_I18nHelper", "I18nHelper", "_AxLoading", "AxLoading", "init", "haveOneRiskWaiver", "e", "$forwardEmail", "$email", "waiverEmail", "regex", "cartEntryID", "waiverURL", "transNr", "isWaiverSent", "Translations", "$button", "$this", "_", "tripple", "serienNr", "cartEntryId", "verifyWaiverStatus", "queryString", "signingOffIsDone", "$message", "Swal", "result", "$oneRiskCompleted", "allWaiverCompleted", "allWaiverForwarded", "self", "isOneRiskReq", "isCompeling", "$consentDocButton", "tooltipText", "selector", "tippy_esm_default", "i", "serialForEntry", "__decorate", "ModuleName", "initCustomerProps", "parentId", "formElementPrefix", "LessonBuyerInfoModule", "lessonBuyerInfoInit", "i", "id", "CustomerLessonProperties", "__decorate", "ModuleName", "ConsentDocuments", "init", "index", "element", "consentDoc", "__decorate", "ModuleName", "QuantitySelection", "_i18nHelper", "I18nHelper", "_axLoading", "AxLoading", "_priceHelper", "PriceHelper", "mainModule", "tippy_esm_default", "popper", "reference", "width", "x", "date", "$popperProdPopper", "$selectedOption", "openOnLoad", "resp", "div", "$resp", "isSingleSelection", "desktopContent", "$desktopCounter", "elem", "desktopFilter", "subTypeIdentifier", "quantity", "$priceElements", "total", "priceElem", "totalSum", "c", "Translations", "elementsToCopy", "$popper", "lastSelectionElement", "i", "separator", "$elemC", "mode", "$elem", "axCounter", "AxCounter", "_a", "_b", "tmp", "LandingQuickSelection", "_i18nHelper", "I18nHelper", "_AxLimestone", "AxLimeStone", "SearchStates", "AxDropdown", "init", "LandingQuickSelectionMobilePortlet", "QuantitySelection", "x", "mode", "defaultProd", "tippyDefaultOptions", "tooltipInstance", "tippy_esm_default", "Translations", "groupId", "$target", "$popperDatePopper", "$popperProdPopper", "$selectedOption", "preDateAble", "$datePicker", "startDate", "AxDatePicker", "Mode", "$popper", "$overlay", "cell", "dropdown", "instance", "tripleArr", "requestURL", "request", "_a", "_b", "c", "subTypeIdentifier", "toAdd", "$parent", "count", "article", "checkbox", "$checkbox", "articleNr", "checked", "_c", "_d", "_f", "_e", "_h", "_g", "result", "AxLoad", "__decorate", "ModuleName", "LandingQuickSelectionMobilePortlet", "SearchStates", "rentalMainModule", "init", "i18nHelper", "defaultCat", "defaultProd", "defaultDate", "_b", "_a", "value", "link", "x", "startDate", "AxDatePicker", "Mode", "originalPosition", "counters", "c", "mode", "totalQuantity", "$mobileSubmit", "Translations", "$currentCategory", "$currentProduct", "wrapper", "innerWrapper", "iconWrapper", "iconElem", "textWrapper", "locationElem", "currentCell", "elem", "preDateAble", "str", "App", "AxMain", "Payment", "AxTopBar", "AxProdDetail", "AxProdMain", "AxProdSelection", "LandingPage", "Selection", "Personalization", "AxProdSelectionCalendar", "AxProdBooking", "AxPackBooking", "AxProdNonPredateable", "AxProdSummary", "LandingQuickSelection", "AxProdPredateable", "AxPackPredateable", "AxPackNonPredateable", "AxPackSelectionCalendar", "ShoppingCart", "CategoryFilter", "ToCheckout", "RentalShopDetails", "Registration", "B2BHistory", "SeasonCardBooking", "TimeSlots", "LessonPackageStorage", "VoucherPayment", "Reserved", "OrderHistory", "ComplexPackageFilter", "ComplexPackageSelection", "ConsentDocuments", "ComplexPackageDetails", "Eguma", "AxBirthDateInputTriple", "SubmenuAim", "RetailDetail", "RetailMain", "RetailFilter", "RentalMain", "RentalFilter", "Shipping", "ComplexPackageBookingOptions", "ComplexPackageBookingTicketsOptions", "CompPackBookingLessonProgramOptions", "CompPackBookingPersonOptions", "CompPackBookingRentalOptions", "CompPackBookingLessonOptions", "PasswordValidation", "MyChipCards", "Redirect", "LessonsLoadingSpinner", "MyFamily", "ShoppingCartEntryRetail", "ComplexPackageSearchBar", "ShoppingCartPersonalisation", "FindMyTicket", "UtilityInit", "ShoppingCartReservationTimer", "PersonalizeGiftCard", "MainGiftCards", "AxFireShoppingCartModal", "AxGA4Module", "AxStaticConfigModule", "ServerErrorPopUp", "HeroModule", "Banner", "Unsubscribe", "Resubscribe", "PersonalData", "MissingMandatoryData", "MaintenanceScriptInfo", "PopUpShoppingCart", "RegisterForm", "PackageMinMaxConstraint", "BleQrCodes", "ShoppingCartDateInputTriple", "RentalProductDetails", "LocalizationModule", "RiderDetailsModule", "DateModule", "OneRiskNotification", "OneRisk", "CustomerLessonProperties", "LessonBuyerInfoModule", "inputMaskHelper", "AxFilterOverlay", "AxLimeStone", "AxLoad", "B2bMode"] }